statsmodels.sandbox.sysreg.SUR

class statsmodels.sandbox.sysreg.SUR(sys, sigma=None, dfk=None)[source]

Seemingly Unrelated Regression

Parameters:
  • sys (list) – [endog1, exog1, endog2, exog2,…] It will be of length 2 x M, where M is the number of equations endog = exog.
  • sigma (array-like) – M x M array where sigma[i,j] is the covariance between equation i and j
  • dfk (None, 'dfk1', or 'dfk2') – Default is None. Correction for the degrees of freedom should be specified for small samples. See the notes for more information.
cholsigmainv

The transpose of the Cholesky decomposition of pinv_wexog

Type:array
df_model

Model degrees of freedom of each equation. p_{m} - 1 where p is the number of regressors for each equation m and one is subtracted for the constant.

Type:array
df_resid

Residual degrees of freedom of each equation. Number of observations less the number of parameters.

Type:array
endog

The LHS variables for each equation in the system. It is a M x nobs array where M is the number of equations.

Type:array
exog

The RHS variable for each equation in the system. It is a nobs x sum(p_{m}) array. Which is just each RHS array stacked next to each other in columns.

Type:array
history

Contains the history of fitting the model. Probably not of interest if the model is fit with igls = False.

Type:dict
iterations

The number of iterations until convergence if the model is fit iteratively.

Type:int
nobs

The number of observations of the equations.

Type:float
normalized_cov_params

sum(p_{m}) x sum(p_{m}) array \(\left[X^{T}\left(\Sigma^{-1}\otimes\boldsymbol{I}\right)X\right]^{-1}\)

Type:array
pinv_wexog

The pseudo-inverse of the wexog

Type:array
sigma

M x M covariance matrix of the cross-equation disturbances. See notes.

Type:array
sp_exog

Contains a block diagonal sparse matrix of the design so that exog1 … exogM are on the diagonal.

Type:CSR sparse matrix
wendog

M * nobs x 1 array of the endogenous variables whitened by cholsigmainv and stacked into a single column.

Type:array
wexog

M*nobs x sum(p_{m}) array of the whitened exogenous variables.

Type:array

Notes

All individual equations are assumed to be well-behaved, homoeskedastic iid errors. This is basically an extension of GLS, using sparse matrices.

\[\begin{split}\Sigma=\left[\begin{array}{cccc} \sigma_{11} & \sigma_{12} & \cdots & \sigma_{1M}\\ \sigma_{21} & \sigma_{22} & \cdots & \sigma_{2M}\\ \vdots & \vdots & \ddots & \vdots\\ \sigma_{M1} & \sigma_{M2} & \cdots & \sigma_{MM}\end{array}\right]\end{split}\]

References

Zellner (1962), Greene (2003)

Methods

fit([igls, tol, maxiter]) igls : bool
initialize()
predict(design)
whiten(X) SUR whiten method.