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
| Name | Type | Description | Default |
|---|---|---|---|
| formula | str | A model description written using the formula syntax from the formulae library. |
required |
| *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
| Name | Type | Description | Default |
|---|---|---|---|
| additional | str | A model formula that describes a model parameter. | required |
Raises
| Name | 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(additionals)Check if the additional formulas match the expected format
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| additionals | sequence of str | Model formulas that describe model parameters rather than a response variable. | required |
Returns
| Name | Type | Description |
|---|---|---|
| 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
| Name | Type | Description |
|---|---|---|
| list of str | All the formulas in the instance. |