On Fri, 1 Feb 2019, Sven Schreiber wrote:
OK, so gretl and the tsDyn package for R seem to agree about the
p-values [...]
Here's a replication and extension of Sven's exercise. It's not
trivial to get R's tsDyn and urca packages to perform the same test
but I think I've succeeded. Note that using
include="const"
in tsDyn is equivalent to
ecdet="none"
in urca.
<hansl>
open denmark
coint2 4 LRM LRY --quiet
foreign language=R --send-data
require(tsDyn)
cidat <- gretldata[,1:2] # again LRM LRY
ve <- VECM(cidat, lag=3, estim="ML", include="const")
ve_test0 <- rank.test(ve, r_null=0, type="trace")
ve_test0
ve_test1 <- rank.test(ve, r_null=1, type="trace")
ve_test1
require(urca)
test2 <- ca.jo(cidat, type="trace", K=4, ecdet=c("none"))
summary(test2)
end foreign
</hansl>
The relevant portions of the output:
---------------------------
gretl (omitting the presumably more reliable small-sample p-values
that gretl provides):
Rank Eigenvalue Trace test p-value Lmax test p-value
0 0.19415 11.904 [0.1633] 11.009 [0.1557]
1 0.017402 0.89533 [0.3440] 0.89533 [0.3440]
R, tsDyn:
Test of rank 0 versus 2 (trace test), p-value: 0.1633226.
Test of rank 1 versus 2 (trace test), p-value: 0.344037.
R, urca:
Test type: trace statistic , with linear trend
Values of teststatistic and critical values of test:
test 10pct 5pct 1pct
r <= 1 | 0.9 6.50 8.18 11.65
r = 0 | 11.9 15.66 17.95 23.52
---------------------------
Gretl and tsDyn are clearly agreed. What about urca? Note that the
two tests appear in the opposite order relative to gretl and tsDyn.
a) Since "test" = 0.9 is less than "10pct" = 6.50, H0 is not
rejected at the 10% level. Agreed, since gretl and tsDyn show
p-value = 0.344.
b) Since "test" = 11.9 is less than "10pct" = 15.66, H0 is not
rejected at the 10% level. Agreed, since gretl and tsDyn show
p-value = 0.1633.
So I think we await a fully-specified example of disagreement
between R::urca and R::tsDyn or gretl.
Allin