\(Y = X\beta + \mu\), where \(\mu\sim N\left(0,\Sigma\right).\)
Depending on the properties of \(\Sigma\), we have currently four classes available:
GLS : generalized least squares for arbitrary covariance \(\Sigma\)
OLS : ordinary least squares for i.i.d. errors \(\Sigma=\textbf{I}\)
WLS : weighted least squares for heteroskedastic errors \(\text{diag}\left (\Sigma\right)\)
GLSAR : feasible generalized least squares with autocorrelated AR(p) errors
\(\Sigma=\Sigma\left(\rho\right)\)
All regression models define the same methods and follow the same structure,
and can be used in a similar fashion. Some of them contain additional model
specific methods and attributes.
GLS is the superclass of the other regression classes except for RecursiveLS,
RollingWLS and RollingOLS.
References
General reference for regression models:
D.C. Montgomery and E.A. Peck. “Introduction to Linear Regression Analysis.” 2nd. Ed., Wiley, 1992.
Econometrics references for regression models:
R.Davidson and J.G. MacKinnon. “Econometric Theory and Methods,” Oxford, 2004.
W.Green. “Econometric Analysis,” 5th ed., Pearson, 2003.
Attributes
The following is more verbose description of the attributes which is mostly
common to all regression classes
pinv_wexogarrayThe p x n Moore-Penrose pseudoinverse of the whitened design matrix.
It is approximately equal to
\(\left(X^{T}\Sigma^{-1}X\right)^{-1}X^{T}\Psi\), where
\(\Psi\) is defined such that \(\Psi\Psi^{T}=\Sigma^{-1}\).
cholsimgainvarrayThe n x n upper triangular matrix \(\Psi^{T}\) that satisfies
\(\Psi\Psi^{T}=\Sigma^{-1}\).
df_modelfloatThe model degrees of freedom. This is equal to p - 1, where p is the
number of regressors. Note that the intercept is not counted as using a
degree of freedom here.
df_residfloatThe residual degrees of freedom. This is equal n - p where n is the
number of observations and p is the number of parameters. Note that the
intercept is counted as using a degree of freedom here.
llffloatThe value of the likelihood function of the fitted model.
nobsfloatThe number of observations n
normalized_cov_paramsarrayA p x p array equal to \((X^{T}\Sigma^{-1}X)^{-1}\).
sigmaarrayThe n x n covariance matrix of the error terms:
\(\mu\sim N\left(0,\Sigma\right)\).
wexogarrayThe whitened design matrix \(\Psi^{T}X\).
wendogarrayThe whitened response variable \(\Psi^{T}Y\).
Module Reference
Model Classes
OLS(endog[, exog, missing, hasconst])
Ordinary Least Squares
GLS(endog, exog[, sigma, missing, hasconst])
Generalized Least Squares
WLS(endog, exog[, weights, missing, hasconst])
Weighted Least Squares
GLSAR(endog[, exog, rho, missing, hasconst])
Generalized Least Squares with AR covariance structure
yule_walker(x[, order, method, df, inv, demean])
Estimate AR(p) parameters from a sequence using the Yule-Walker equations.
burg(endog[, order, demean])
Compute Burg's AP(p) parameter estimator.
An implementation of ProcessCovariance using the Gaussian kernel.
ProcessMLE(endog, exog, exog_scale, ...[, cov])
Fit a Gaussian mean/variance regression model.
Results Classes
Fitting a linear regression model returns a results class. OLS has a
specific results class with some additional methods compared to the
results class of the other linear models.
RegressionResults(model, params[, ...])
This class summarizes the fit of a linear regression model.
OLSResults(model, params[, ...])
Results class for for an OLS model.
PredictionResults(predicted_mean, ...[, df, ...])
Results class for predictions.