Usage
## S3 method for class 'distribution'
family(
object,
links,
score = TRUE,
hessian = FALSE,
update = FALSE,
expected = FALSE,
...
)
## S3 method for class 'GAMLSS'
family(object, ...)
## S3 method for class 'gamlss.family'
family(object, score = TRUE, hessian = FALSE, update = FALSE, ...)
distributions3_family(
distribution,
links,
score = TRUE,
hessian = FALSE,
update = FALSE,
expected = FALSE,
create_distribution = "structure",
type = NULL,
valid.response = NULL,
initialize = NULL,
...
)
Details
The workhorse function distributions3_family sets up a gamlss2.family list by leveraging the generic functions and methods from the distributions3 package. The main idea is that gamlss2 in each iteration and in the final model fit provides a list of fitted parameters. These can then be mapped to the corresponding distribution class and all the corresponding methods (such as pdf for computing the probability density function) from distributions3 can be leveraged to compute the building blocks for fitting the model (e.g., pdf, score, hessian, etc.) and for assessing the final model fit.
The family methods all call distributions3_family internally but help to automatically infer and set up some of the elements of the family.