Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linearpredictor and linearpredictor! #19

Merged
merged 4 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docs/site/
*.jl.cov
*.jl.*.cov
*.jl.mem
Manifest.toml
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StatsAPI"
uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
authors = ["Milan Bouchet-Valat <[email protected]"]
version = "1.4.0"
version = "1.5.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
17 changes: 16 additions & 1 deletion src/regressionmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ 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

"""
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