fit_ols

pyoptex.analysis.utils.fit.fit_ols(X, y)[source]

Wrapper to fit a statsmodels OLS model. It includes the following additional attributes required for a more synchronized output between OLS and Mixed LM.

  • k_fe: The number of parameters.

  • vcomp: An empty array.

  • converged: True.

Parameters

Xnp.array(2d)

The normalized, encoded model matrix of the data.

ynp.array(1d)

The output variable

Returns

fitstatsmodels.regression.linear_model.RegressionResults

The statsmodels regression results with some additional attributes.