linearmodels.system.model.SUR¶
-
class linearmodels.system.model.SUR(equations: Mapping[str, Mapping[str, ndarray | DataArray | DataFrame | Series | None] | Sequence[ndarray | DataArray | DataFrame | Series | None]], *, sigma: ndarray | DataArray | DataFrame | Series | None =
None
)[source]¶ Seemingly unrelated regression estimation (SUR/SURE)
- Parameters:¶
- equations: Mapping[str, Mapping[str, ndarray | DataArray | DataFrame | Series | None] | Sequence[ndarray | DataArray | DataFrame | Series | None]]¶
Dictionary-like structure containing dependent and exogenous variable values. Each key is an equations label and must be a string. Each value must be either a tuple of the form (dependent, exog, [weights]) or a dictionary with keys “dependent” and “exog” and the optional key “weights”.
- sigma: ndarray | DataArray | DataFrame | Series | None =
None
¶ Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma.
Notes
Estimates a set of regressions which are seemingly unrelated in the sense that separate estimation would lead to consistent parameter estimates. Each equation is of the form
\[y_{i,k} = x_{i,k}\beta_i + \epsilon_{i,k}\]where k denotes the equation and i denoted the observation index. By stacking vertically arrays of dependent and placing the exogenous variables into a block diagonal array, the entire system can be compactly expressed as
\[Y = X\beta + \epsilon\]where
\[\begin{split}Y = \left[\begin{array}{x}Y_1 \\ Y_2 \\ \vdots \\ Y_K\end{array}\right]\end{split}\]and
\[\begin{split}X = \left[\begin{array}{cccc} X_1 & 0 & \ldots & 0 \\ 0 & X_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & X_K \end{array}\right]\end{split}\]The system OLS estimator is
\[\hat{\beta}_{OLS} = (X'X)^{-1}X'Y\]When certain conditions are satisfied, a GLS estimator of the form
\[\hat{\beta}_{GLS} = (X'\Omega^{-1}X)^{-1}X'\Omega^{-1}Y\]can improve accuracy of coefficient estimates where
\[\Omega = \Sigma \otimes I_N\]where \(\Sigma\) is the covariance matrix of the residuals.
SUR is a special case of 3SLS where there are no endogenous regressors and no instruments.
Methods
add_constraints
(r[, q])Add parameter constraints to a model.
fit
(*[, method, full_cov, iterate, ...])Estimate model parameters
from_formula
(formula, data, *[, sigma, weights])Specify a SUR using the formula interface
multivariate_ls
(dependent, exog)Interface for specification of multivariate regression models
predict
(params, *[, equations, data, eval_env])Predict values for additional data
Remove all model constraints
Properties
Model constraints
Set or get the formula used to construct the model
Vector indicating which equations contain constants
Model parameter names