Skip to content

Commit

Permalink
Add modeltype generic, correct a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbates committed Aug 22, 2019
1 parent 416af55 commit f3c22d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/StatsBase.jl
Expand Up @@ -188,6 +188,7 @@ export
loglikelihood,
meanresponse,
modelmatrix,
modeltype,
mss,
response,
nobs,
Expand Down
19 changes: 15 additions & 4 deletions src/statmodels.jl
Expand Up @@ -115,7 +115,7 @@ rss(obj::StatisticalModel) = error("rss is not defined for $(typeof(obj)).")
Return the information matrix. By default the Fisher information matrix is returned,
while the observed information matrix can be requested with `expected = false`.
"""
informationmatrix(model::StatisticalModel; expected::Bool = true) =
informationmatrix(obj::StatisticalModel; expected::Bool = true) =
error("informationmatrix is not defined for $(typeof(obj)).")

"""
Expand All @@ -132,6 +132,13 @@ Return the variance-covariance matrix for the coefficients of the model.
"""
vcov(obj::StatisticalModel) = error("vcov is not defined for $(typeof(obj)).")

"""
modeltype(obj::StatisticalModel)
Short description of the model type, as a String
"""
modeltype(obj::StatisticalModel) = error("modeltype is not defined for $(typeof(obj))")

"""
weights(obj::StatisticalModel)
Expand All @@ -142,17 +149,21 @@ weights(obj::StatisticalModel) = error("weights is not defined for $(typeof(obj)
"""
isfitted(obj::StatisticalModel)
Indicate whether the model has been fitted.
Indicate whether the model has been fit.
"""
isfitted(obj::StatisticalModel) = error("isfitted is not defined for $(typeof(obj)).")

"""
Fit a statistical model.
fit(obj::StatisticalModel, args...)
Fit a statistical model. The `args` that apply depend on the model type.
"""
fit(obj::StatisticalModel, args...) = error("fit is not defined for $(typeof(obj)).")

"""
Fit a statistical model in-place.
fit!(obj::StatisticalModel, args...)
Fit a statistical model in-place. The `args` that apply depend on the model type.
"""
fit!(obj::StatisticalModel, args...) = error("fit! is not defined for $(typeof(obj)).")

Expand Down

0 comments on commit f3c22d4

Please sign in to comment.