Formula

Formula(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 response distribution, allowing distributional models.

Parameters

formula : str

A model description written using the formula syntax from the formulae library.

*additionals : tuple of 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(additional)

Check if an additional formula matches the expected format

Parameters

additional : str

A model formula that describes a model parameter.

Raises

: 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(additionals)

Check if the additional formulas match the expected format

Parameters

additionals : sequence of str

Model formulas that describe model parameters rather than a response variable.

Returns

additionals : sequence of str

If all formulas match the required format, it returns them.

get_all_formulas

Formula.get_all_formulas()

Get all the model formulas

Returns

: list of str

All the formulas in the instance.