rank.test {tsDyn} | R Documentation |
Test of the cointegrating rank
Description
Maximum-likelihood test of the cointegrating rank.
Usage
rank.test(vecm, type = c("eigen", "trace"), r_null, cval = 0.05)
## S3 method for class 'rank.test'
print(x, ...)
## S3 method for class 'rank.test'
summary(object, digits = max(1, getOption("digits") - 3), ...)
Arguments
vecm |
‘VECM’ object computed with the function
|
type |
Type of test, either 'trace' or 'eigenvalue'. See details below. |
r_null |
Rank to test specifically. |
cval |
Critical value level for the automatic test. |
x |
The output from |
... |
Unused. |
object |
The output from |
digits |
The number of digits to use in |
Details
This function computes the two maximum-likelihood tests for the cointegration rank from Johansen (1996). Tests are:
- trace
Test the hypothesis of rank ‘h’ against rank ‘K’, i.e. against the alternative that the system is stationary.
- eigenvalue
Test the hypothesis of rank ‘h’ against rank ‘h+1’.
The test works for five specifications of the deterministic terms as in
Doornik et al (1998), to be specified in the previous call to
VECM
:
- H_ql
Unrestricted constant and trend: use
include="both"
- H_l
Unrestricted constant and restricted trend: use
include="const"
and LRinclude="trend"
- H_lc
Unrestricted constant and no trend: use
include="const"
- H_c
Restricted constant and no trend: use
LRinclude="const"
- H_z
No constant nor trend: use
include="none"
Two testing procedures can be used:
- Specific test
By specifying a value for ‘r_null’. The ‘pval’ value returned gives the speciifc p-value.
- Automatic test
If not value is specified for ‘r_null’, the function makes a simple automatic test: returns the rank (slot ‘r’) of the first test not rejected (level specified by arg
cval
) as recommend i.a. in Doornik et al (1998, p. 544).
A full table with both test statistics ad their respective p-values is given in the summary method.
P-values are obtained from the gamma approximation from Doornik (1998, 1999). Small sample values adjusted for the sample site are also available in the summary method. Note that the ‘effective sample size’ for the these values is different from output in gretl for example.
Value
An object of class ‘rank.test’, with ‘print’ and ‘summary methods’.
Comparison with urca
While ca.jo
in package
urca and rank.test
both implement Johansen tests, there are a
few differences:
-
rank.test
gives p-values, whileca.jo
gives only critical values. -
rank.test
allows for five different specifications of deterministic terms (see above),ca.jo
for only three. -
ca.jo
allows for seasonal and exogenous regressors, which is not available inrank.test
. The lag is specified differently:
K
fromca.jo
corresponds tolag
+1 inrank.test
.
Author(s)
Matthieu Stigler
References
- Doornik, J. A. (1998) Approximations to the Asymptotic Distributions of Cointegration Tests, Journal of Economic Surveys, 12, 573-93
- Doornik, J. A. (1999) Erratum [Approximations to the Asymptotic Distribution of Cointegration Tests], Journal of Economic Surveys, 13, i
- Doornik, Hendry and Nielsen (1998) Inference in Cointegrating Models: UK M1 Revisited, Journal of Economic Surveys, 12, 533-72
- Johansen, S. (1996) Likelihood-based inference in cointegrated Vector Autoregressive Models, Oxford University Press
See Also
VECM
for estimating a VECM. rank.select
to estimate the rank based on information criteria.
ca.jo
in package urca for another implementation of
Johansen cointegration test (see section ‘Comparison with urca’ for
more infos).
Examples
data(barry)
## estimate the VECM with Johansen!
ve <- VECM(barry, lag=1, estim="ML")
## specific test:
ve_test_spec <- rank.test(ve, r_null=1)
ve_test_spec_tr <- rank.test(ve, r_null=1, type="trace")
ve_test_spec
ve_test_spec_tr
## No specific test: automatic method
ve_test_unspec <- rank.test(ve)
ve_test_unspec_tr <- rank.test(ve, type="trace")
ve_test_unspec
ve_test_unspec_tr
## summary method: output will be same for all types/test procedure:
summary(ve_test_unspec_tr)
## The function works for many specification of the VECM(), try:
rank.test(VECM(barry, lag=3, estim="ML"))
rank.test(VECM(barry, lag=3, include="both",estim="ML"))
rank.test(VECM(barry, lag=3, LRinclude="const",estim="ML"))
## Note that the tests are simple likelihood ratio, and hence can be obtained also manually:
-2*(logLik(ve, r=1)-logLik(ve, r=2)) # eigen test, 1 against 2
-2*(logLik(ve, r=1)-logLik(ve, r=3)) # eigen test, 1 against 3