From 520162c06c2a1de2dc8adb24db282c48e27e67c0 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 30 Jul 2022 10:43:46 -0700 Subject: [PATCH 1/4] Add `linearpredictor` and `linearpredictor!` --- src/regressionmodel.jl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/regressionmodel.jl b/src/regressionmodel.jl index d7a2afc..bc3875c 100644 --- a/src/regressionmodel.jl +++ b/src/regressionmodel.jl @@ -117,3 +117,18 @@ Return the offset used in the model, i.e. the term added to the linear predictor known coefficient 1. """ function offset end + +""" + linearpredictor(model::RegressionModel) + +Return the model's linear predictor, `Xβ` where `X` is the model matrix and `β` is the +vector of coefficients, or `Xβ + offset` if the model was fit with an offset. +""" +function linearpredictor end + +""" + linearpredictor!(storage, model::RegressionModel) + +In-place version of [`linearpredictor`](@ref), storing the result in `storage`. +""" +function linearpredictor! end From 172b543c184babe0c249ebb066a70baab43de299 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sun, 31 Jul 2022 14:45:05 -0700 Subject: [PATCH 2/4] Document that `offset` should return `nothing` if no offset was used --- src/regressionmodel.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regressionmodel.jl b/src/regressionmodel.jl index bc3875c..3cc7a61 100644 --- a/src/regressionmodel.jl +++ b/src/regressionmodel.jl @@ -114,7 +114,7 @@ function reconstruct! end offset(model::RegressionModel) Return the offset used in the model, i.e. the term added to the linear predictor with -known coefficient 1. +known coefficient 1, or `nothing` if the model was not fit with an offset. """ function offset end From 120fbddd85eb07e5c2680b95e2e9ea50a8434fbd Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Sat, 30 Jul 2022 10:44:32 -0700 Subject: [PATCH 3/4] Bump minor version for new feature --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 555f422..b493fba 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StatsAPI" uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" authors = ["Milan Bouchet-Valat Date: Sat, 30 Jul 2022 10:45:03 -0700 Subject: [PATCH 4/4] Ignore the manifest --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f1b8e38..7749670 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ docs/site/ *.jl.cov *.jl.*.cov *.jl.mem +Manifest.toml