Skip to content

Commit 14e0ba7

Browse files
authored
Merge pull request #19 from JuliaStats/aa/linpred
Add `linearpredictor` and `linearpredictor!`
2 parents e42a88a + a634719 commit 14e0ba7

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ docs/site/
44
*.jl.cov
55
*.jl.*.cov
66
*.jl.mem
7+
Manifest.toml

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StatsAPI"
22
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
33
authors = ["Milan Bouchet-Valat <[email protected]"]
4-
version = "1.4.0"
4+
version = "1.5.0"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/regressionmodel.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ function reconstruct! end
114114
offset(model::RegressionModel)
115115
116116
Return the offset used in the model, i.e. the term added to the linear predictor with
117-
known coefficient 1.
117+
known coefficient 1, or `nothing` if the model was not fit with an offset.
118118
"""
119119
function offset end
120+
121+
"""
122+
linearpredictor(model::RegressionModel)
123+
124+
Return the model's linear predictor, `Xβ` where `X` is the model matrix and `β` is the
125+
vector of coefficients, or `Xβ + offset` if the model was fit with an offset.
126+
"""
127+
function linearpredictor end
128+
129+
"""
130+
linearpredictor!(storage, model::RegressionModel)
131+
132+
In-place version of [`linearpredictor`](@ref), storing the result in `storage`.
133+
"""
134+
function linearpredictor! end

0 commit comments

Comments
 (0)