statsmodels.tsa.vector_ar.vecm.VECMResults¶
-
class
statsmodels.tsa.vector_ar.vecm.
VECMResults
(endog, exog, exog_coint, k_ar, coint_rank, alpha, beta, gamma, sigma_u, deterministic='nc', seasons=0, first_season=0, delta_y_1_T=None, y_lag1=None, delta_x=None, model=None, names=None, dates=None)[source]¶ Class for holding estimation related results of a vector error correction model (VECM).
- Parameters
endog : ndarray (neqs x nobs_tot)
Array of observations.
exog : ndarray (nobs_tot x neqs) or None
Deterministic terms outside the cointegration relation.
exog_coint : ndarray (nobs_tot x neqs) or None
Deterministic terms inside the cointegration relation.
k_ar : int, >= 1
Lags in the VAR representation. This implies that the number of lags in the VEC representation (=lagged differences) equals \(k_{ar} - 1\).
coint_rank : int, 0 <= coint_rank <= neqs
Cointegration rank, equals the rank of the matrix \(\Pi\) and the number of columns of \(\alpha\) and \(\beta\).
alpha : ndarray (neqs x coint_rank)
Estimate for the parameter \(\alpha\) of a VECM.
beta : ndarray (neqs x coint_rank)
Estimate for the parameter \(\beta\) of a VECM.
gamma : ndarray (neqs x neqs*(k_ar-1))
Array containing the estimates of the \(k_{ar}-1\) parameter matrices \(\Gamma_1, \dots, \Gamma_{k_{ar}-1}\) of a VECM(\(k_{ar}-1\)). The submatrices are stacked horizontally from left to right.
sigma_u : ndarray (neqs x neqs)
Estimate of white noise process covariance matrix \(\Sigma_u\).
deterministic : str {
"nc"
,"co"
,"ci"
,"lo"
,"li"
}"nc"
- no deterministic terms"co"
- constant outside the cointegration relation"ci"
- constant within the cointegration relation"lo"
- linear trend outside the cointegration relation"li"
- linear trend within the cointegration relation
Combinations of these are possible (e.g.
"cili"
or"colo"
for linear trend with intercept). See the docstring of theVECM
-class for more information.seasons : int, default: 0
Number of periods in a seasonal cycle. 0 means no seasons.
first_season : int, default: 0
Season of the first observation.
delta_y_1_T : ndarray or None, default: None
Auxiliary array for internal computations. It will be calculated if not given as parameter.
y_lag1 : ndarray or None, default: None
Auxiliary array for internal computations. It will be calculated if not given as parameter.
delta_x : ndarray or None, default: None
Auxiliary array for internal computations. It will be calculated if not given as parameter.
model :
VECM
An instance of the
VECM
-class.names : list of str
Each str in the list represents the name of a variable of the time series.
dates : array_like
For example a DatetimeIndex of length nobs_tot.
References
Attributes
nobs
(int) Number of observations (excluding the presample).
model
(see Parameters)
y_all
(see endog in Parameters)
exog
(see Parameters)
exog_coint
(see Parameters)
names
(see Parameters)
dates
(see Parameters)
neqs
(int) Number of variables in the time series.
k_ar
(see Parameters)
deterministic
(see Parameters)
seasons
(see Parameters)
first_season
(see Parameters)
alpha
(see Parameters)
beta
(see Parameters)
gamma
(see Parameters)
sigma_u
(see Parameters)
det_coef_coint
(ndarray (#(determinist. terms inside the coint. rel.) x coint_rank)) Estimated coefficients for the all deterministic terms inside the cointegration relation.
const_coint
(ndarray (1 x coint_rank)) If there is a constant deterministic term inside the cointegration relation, then const_coint is the first row of det_coef_coint. Otherwise it’s an ndarray of zeros.
lin_trend_coint
(ndarray (1 x coint_rank)) If there is a linear deterministic term inside the cointegration relation, then lin_trend_coint contains the corresponding estimated coefficients. As such it represents the corresponding row of det_coef_coint. If there is no linear deterministic term inside the cointegration relation, then lin_trend_coint is an ndarray of zeros.
exog_coint_coefs
(ndarray (exog_coint.shape[1] x coint_rank) or None) If deterministic terms inside the cointegration relation are passed via the exog_coint parameter, then exog_coint_coefs contains the corresponding estimated coefficients. As such exog_coint_coefs represents the last rows of det_coef_coint. If no deterministic terms were passed via the exog_coint parameter, this attribute is None.
det_coef
(ndarray (neqs x #(deterministic terms outside the coint. rel.))) Estimated coefficients for the all deterministic terms outside the cointegration relation.
const
(ndarray (neqs x 1) or (neqs x 0)) If a constant deterministic term outside the cointegration is specified within the deterministic parameter, then const is the first column of det_coef_coint. Otherwise it’s an ndarray of size zero.
seasonal
(ndarray (neqs x seasons)) If the seasons parameter is > 0, then seasonal contains the estimated coefficients corresponding to the seasonal terms. Otherwise it’s an ndarray of size zero.
lin_trend
(ndarray (neqs x 1) or (neqs x 0)) If a linear deterministic term outside the cointegration is specified within the deterministic parameter, then lin_trend contains the corresponding estimated coefficients. As such it represents the corresponding column of det_coef_coint. If there is no linear deterministic term outside the cointegration relation, then lin_trend is an ndarray of size zero.
exog_coefs
(ndarray (neqs x exog_coefs.shape[1])) If deterministic terms outside the cointegration relation are passed via the exog parameter, then exog_coefs contains the corresponding estimated coefficients. As such exog_coefs represents the last columns of det_coef. If no deterministic terms were passed via the exog parameter, this attribute is an ndarray of size zero.
_delta_y_1_T
(see delta_y_1_T in Parameters)
_y_lag1
(see y_lag1 in Parameters)
_delta_x
(see delta_x in Parameters)
coint_rank
(int) Cointegration rank, equals the rank of the matrix \(\Pi\) and the number of columns of \(\alpha\) and \(\beta\).
llf
(float) The model’s log-likelihood.
cov_params
(ndarray (d x d)) Covariance matrix of the parameters. The number of rows and columns, d (used in the dimension specification of this argument), is equal to neqs * (neqs+num_det_coef_coint + neqs*(k_ar-1)+number of deterministic dummy variables outside the cointegration relation). For the case with no deterministic terms this matrix is defined on p. 287 in [R216] as \(\Sigma_{co}\) and its relationship to the ML-estimators can be seen in eq. (7.2.21) on p. 296 in [R216].
cov_params_wo_det
(ndarray) Covariance matrix of the parameters \(\tilde{\Pi}, \tilde{\Gamma}\) where \(\tilde{\Pi} = \tilde{\alpha} \tilde{\beta'}\). Equals cov_params without the rows and columns related to deterministic terms. This matrix is defined as \(\Sigma_{co}\) on p. 287 in [R216].
stderr_params
(ndarray (d)) Array containing the standard errors of \(\Pi\), \(\Gamma\), and estimated parameters related to deterministic terms.
stderr_coint
(ndarray (neqs+num_det_coef_coint x coint_rank)) Array containing the standard errors of \(\beta\) and estimated parameters related to deterministic terms inside the cointegration relation.
stderr_alpha
( ndarray (neqs x coint_rank)) The standard errors of \(\alpha\).
stderr_beta
(ndarray (neqs x coint_rank)) The standard errors of \(\beta\).
stderr_det_coef_coint
(ndarray (num_det_coef_coint x coint_rank)) The standard errors of estimated the parameters related to deterministic terms inside the cointegration relation.
stderr_gamma
(ndarray (neqs x neqs*(k_ar-1))) The standard errors of \(\Gamma_1, \ldots, \Gamma_{k_{ar}-1}\).
stderr_det_coef
(ndarray (neqs x det. terms outside the coint. relation)) The standard errors of estimated the parameters related to deterministic terms outside the cointegration relation.
tvalues_alpha
(ndarray (neqs x coint_rank))
tvalues_beta
(ndarray (neqs x coint_rank))
tvalues_det_coef_coint
(ndarray (num_det_coef_coint x coint_rank))
tvalues_gamma
(ndarray (neqs x neqs*(k_ar-1)))
tvalues_det_coef
(ndarray (neqs x det. terms outside the coint. relation))
pvalues_alpha
(ndarray (neqs x coint_rank))
pvalues_beta
(ndarray (neqs x coint_rank))
pvalues_det_coef_coint
(ndarray (num_det_coef_coint x coint_rank))
pvalues_gamma
(ndarray (neqs x neqs*(k_ar-1)))
pvalues_det_coef
(ndarray (neqs x det. terms outside the coint. relation))
var_rep
((k_ar x neqs x neqs)) KxK parameter matrices \(A_i\) of the corresponding VAR representation. If the return value is assigned to a variable
A
, these matrices can be accessed viaA[i]
for \(i=0, \ldots, k_{ar}-1\).cov_var_repr
(ndarray (neqs**2 * k_ar x neqs**2 * k_ar)) This matrix is called \(\Sigma^{co}_{\alpha}\) on p. 289 in [R216]. It is needed e.g. for impulse-response-analysis.
fittedvalues
(ndarray (nobs x neqs)) The predicted in-sample values of the models’ endogenous variables.
resid
(ndarray (nobs x neqs)) The residuals.
Methods
conf_int_alpha
([alpha])conf_int_beta
([alpha])conf_int_det_coef
([alpha])conf_int_det_coef_coint
([alpha])conf_int_gamma
([alpha])irf
([periods])ma_rep
([maxn])orth_ma_rep
([maxn, P])Compute orthogonalized MA coefficient matrices.
plot_data
([with_presample])Plot the input time series.
plot_forecast
(steps[, alpha, plot_conf_int, …])Plot the forecast.
predict
([steps, alpha, exog_fc, exog_coint_fc])Calculate future values of the time series.
summary
([alpha])Return a summary of the estimation results.
test_granger_causality
(caused[, causing, signif])Test for Granger-causality.
test_inst_causality
(causing[, signif])Test for instantaneous causality.
test_normality
([signif])Test assumption of normal-distributed errors using Jarque-Bera-style omnibus \(\\chi^2\) test.
test_whiteness
([nlags, signif, adjusted])Test the whiteness of the residuals using the Portmanteau test.
Methods
conf_int_alpha
([alpha])conf_int_beta
([alpha])conf_int_det_coef
([alpha])conf_int_det_coef_coint
([alpha])conf_int_gamma
([alpha])irf
([periods])ma_rep
([maxn])orth_ma_rep
([maxn, P])Compute orthogonalized MA coefficient matrices.
plot_data
([with_presample])Plot the input time series.
plot_forecast
(steps[, alpha, plot_conf_int, …])Plot the forecast.
predict
([steps, alpha, exog_fc, exog_coint_fc])Calculate future values of the time series.
summary
([alpha])Return a summary of the estimation results.
test_granger_causality
(caused[, causing, signif])Test for Granger-causality.
test_inst_causality
(causing[, signif])Test for instantaneous causality.
test_normality
([signif])Test assumption of normal-distributed errors using Jarque-Bera-style omnibus \(\\chi^2\) test.
test_whiteness
([nlags, signif, adjusted])Test the whiteness of the residuals using the Portmanteau test.
Properties
Gives the covariance matrix of the corresponding VAR-representation.
Return the in-sample values of endog calculated by the model.
Compute the VECM’s loglikelihood.
Return the difference between observed and fitted values.
Standard errors of beta and deterministic terms inside the cointegration relation.