statsmodels.tsa.vector_ar.vecm.VECM¶
-
class
statsmodels.tsa.vector_ar.vecm.
VECM
(endog, exog=None, exog_coint=None, dates=None, freq=None, missing='none', k_ar_diff=1, coint_rank=1, deterministic='nc', seasons=0, first_season=0)[source]¶ Class representing a Vector Error Correction Model (VECM).
A VECM(\(k_{ar}-1\)) has the following form
\[\Delta y_t = \Pi y_{t-1} + \Gamma_1 \Delta y_{t-1} + \ldots + \Gamma_{k_{ar}-1} \Delta y_{t-k_{ar}+1} + u_t\]where
\[\Pi = \alpha \beta'\]as described in chapter 7 of [1].
- Parameters
- endogarray_like (
nobs_tot
x
neqs
) 2-d endogenous response variable.
- 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.
- datesarray_like
of
datetime
,optional
See
statsmodels.tsa.base.tsa_model.TimeSeriesModel
for more information.- freq
str
,optional
See
statsmodels.tsa.base.tsa_model.TimeSeriesModel
for more information.- missing
str
,optional
See
statsmodels.base.model.Model
for more information.- k_ar_diff
int
Number of lagged differences in the model. Equals \(k_{ar} - 1\) in the formula above.
- coint_rank
int
Cointegration rank, equals the rank of the matrix \(\Pi\) and the number of columns of \(\alpha\) and \(\beta\).
- 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). When using a constant term you have to choose whether you want to restrict it to the cointegration relation (i.e."ci"
) or leave it unrestricted (i.e."co"
). Do not use both"ci"
and"co"
. The same applies for"li"
and"lo"
when using a linear term. See the Notes-section 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.
- endogarray_like (
Notes
A VECM(\(k_{ar} - 1\)) with deterministic terms has the form
\[\begin{split}\Delta y_t = \alpha \begin{pmatrix}\beta' & \eta'\end{pmatrix} \begin{pmatrix}y_{t-1}\\D^{co}_{t-1}\end{pmatrix} + \Gamma_1 \Delta y_{t-1} + \dots + \Gamma_{k_{ar}-1} \Delta y_{t-k_{ar}+1} + C D_t + u_t.\end{split}\]In \(D^{co}_{t-1}\) we have the deterministic terms which are inside the cointegration relation (or restricted to the cointegration relation). \(\eta\) is the corresponding estimator. To pass a deterministic term inside the cointegration relation, we can use the exog_coint argument. For the two special cases of an intercept and a linear trend there exists a simpler way to declare these terms: we can pass
"ci"
and"li"
respectively to the deterministic argument. So for an intercept inside the cointegration relation we can either pass"ci"
as deterministic or np.ones(len(data)) as exog_coint if data is passed as the endog argument. This ensures that \(D_{t-1}^{co} = 1\) for all \(t\).We can also use deterministic terms outside the cointegration relation. These are defined in \(D_t\) in the formula above with the corresponding estimators in the matrix \(C\). We specify such terms by passing them to the exog argument. For an intercept and/or linear trend we again have the possibility to use deterministic alternatively. For an intercept we pass
"co"
and for a linear trend we pass"lo"
where the o stands for outside.The following table shows the five cases considered in [2]. The last column indicates which string to pass to the deterministic argument for each of these cases.
Case
Intercept
Slope of the linear trend
deterministic
I
0
0
"nc"
II
\(- \alpha \beta^T \mu\)
0
"ci"
III
\(\neq 0\)
0
"co"
IV
\(\neq 0\)
\(- \alpha \beta^T \gamma\)
"coli"
V
\(\neq 0\)
\(\neq 0\)
"colo"
References
- 1
Lütkepohl, H. 2005. New Introduction to Multiple Time Series Analysis. Springer.
- 2
Johansen, S. 1995. Likelihood-Based Inference in Cointegrated * *Vector Autoregressive Models. Oxford University Press.
- Attributes
endog_names
Names of endogenous variables.
exog_names
The names of the exogenous variables.
Methods
fit
([method])Estimates the parameters of a VECM.
from_formula
(formula, data[, subset, drop_cols])Create a Model from a formula and dataframe.
hessian
(params)The Hessian matrix of the model.
information
(params)Fisher information matrix of model.
Initialize (possibly re-initialize) a Model instance.
loglike
(params)Log-likelihood of model.
predict
(params[, exog])After a model has been fit predict returns the fitted values.
score
(params)Score vector of model.
Methods
fit
([method])Estimates the parameters of a VECM.
from_formula
(formula, data[, subset, drop_cols])Create a Model from a formula and dataframe.
hessian
(params)The Hessian matrix of the model.
information
(params)Fisher information matrix of model.
Initialize (possibly re-initialize) a Model instance.
loglike
(params)Log-likelihood of model.
predict
(params[, exog])After a model has been fit predict returns the fitted values.
score
(params)Score vector of model.
Properties
Names of endogenous variables.
The names of the exogenous variables.