OlsModel
- class pyoptex.analysis.estimators.sams.models.ols_model.OlsModel(*args, **kwargs)[source]
A default OLS model for use with the SAMS algorithm which extends the
Modelinterface.Attributes
- Xnp.array(2d)
The encoded, normalized model matrix of the data
- ynp.array(1d)
The output variable.
- forcednp.array(1d)
Any terms that must be included in the model.
- modeNone or ‘weak’ or ‘strong’
The heredity model during sampling.
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.
- ss_interceptfloat
The sum of squared residuals for a model with only the intercept.
- __init__(*args, **kwargs)[source]
Initializes the OLS model
Parameters
- Xnp.array(2d)
The encoded, normalized model matrix of the data.
- ynp.array(1d)
The output variable.
- forcednp.array(1d)
Any terms that must be included in the model.
- modeNone or ‘weak’ or ‘strong’
The heredity model during sampling.
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model (output from Y2X). Term i depends on term j if dep(i, j) = true.
Methods
OlsModel.fit(model)Fits an OLS model
OlsModel.init(model)Create a random model by sequential sampling.
OlsModel.mutate(model)Mutate the model by removing atleast one term and replacing it.