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='n'
, seasons=0
, first_season=0
)[source]¶ Class representing a Vector Error Correction Model (VECM).
A VECM(
) has the following formwhere
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
in the formula above.- coint_rank
int
Cointegration rank, equals the rank of the matrix
and the number of columns of and .- deterministic
str
{"n"
,"co"
,"ci"
,"lo"
,"li"
} "n"
- 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 (
- Attributes:¶
endog_names
Names of endogenous variables.
exog_names
The names of the exogenous variables.
Notes
A VECM(
) with deterministic terms has the formIn
we have the deterministic terms which are inside the cointegration relation (or restricted to the cointegration relation). 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 for all .We can also use deterministic terms outside the cointegration relation. These are defined in
in the formula above with the corresponding estimators in the matrix . 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
"n"
II
0
"ci"
III
0
"co"
IV
"coli"
V
"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.
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.