Formula

Formula(self, formula, *additionals)

Model formula

Allows to describe a model with multiple formulas. The first formula describes the response variable and its predictors. The following formulas describe predictors for other parameters of the likelihood function, allowing distributional models.

Parameters

Name Type Description Default
formula str A model description written using the formula syntax from the formulae library. required
*additionals str Additional formulas that describe model parameters rather than a response variable. ()

Methods

Name Description
check_additional Check if an additional formula matches the expected format
check_additionals Check if the additional formulas match the expected format
get_all_formulas Get all the model formulas

check_additional

Formula.check_additional(self, additional)

Check if an additional formula matches the expected format

Parameters

Name Type Description Default
additional str A model formula that describes a model parameter. required

Raises

Type Description
ValueError If the formula does not contain a response term.
ValueError If the response term is not a plain name.

check_additionals

Formula.check_additionals(self, additionals)

Check if the additional formulas match the expected format

Parameters

Name Type Description Default
additionals Sequence[str] Model formulas that describe model parameters rather than a response variable. required

Returns

Type Description
Sequence[str] If all formulas match the required format, it return them.

get_all_formulas

Formula.get_all_formulas(self)

Get all the model formulas

Returns

Type Description
list All the formulas in the instance.