I guess the nice matrix and scripting capabilities of gretl would
also
be enough to make that work, so I could help with the prototype. It
would be useful, however, if one could access some preliminary
variables/matrices from the Johansen procedure (like S00, S11 etc.) from
a script, similar to what $jalpha apparently does now. I mean not
officially and not documented, but just so I can help without starting
from scratch. Would that be easy to do for you Allin, or would it just
shift workload from me to you?
And how actually does it work now to test the homogeneous restrictions
you mentioned, e.g. via GUI? I wasn't obvious to me.
the matrices S00 & co. are quite easy to build by combining lists, loop, genr
and matrix functions; all in all, you need moment matrices of residuals. On
the other hand, I've modified the code for vecm estimation (patch attached,
Allin) so to enable the user to retrieve the covariance matrix of the
estimated beta (after triangular normalisation), which is NOT trivial to
compute. This makes it possible to compute Wald tests on cointegration
vectors, JMulTi style (but see below).
With the attached patch, here comes an example, which uses (surprise,
surprise) Johansen's Denmark example data: we test two restrictions: unit
elasticity wrt income and that the spread between the two rates measures the
cost of holding money.
Note that we can already do this via a LR test. A Wald test, however, can be
used for nonlinear restrictions too, via the delta method.
# ------------------- begin example script -----------------------------
open denmark
vecm 2 1 1 2 3 4 --rc --seasonal
matrix b = $jbeta
matrix V = $jvbeta
matrix R = { 1, 1, 0, 0, 0 ; 0, 0, 1, 1, 0 }
scalar df = rows(R)
matrix W = R * b
matrix R = R[,2:5]
matrix V = R * V * R'
scalar WT = W' * inv(V) * W
printf "Wald test: %g (%d df, pvalue = %g)\n", WT, df, pvalue(X,WT,df)
# -------------------- end example script ------------------------------
While I tested this, I realised that I couldn't reproduce Johansen's results
with JMulTi; either I'm missing something, or JMulTi's VECM estimation goes
through a different algorithm from ours. We do VECMs as per Johansen's book;
so does PcGive, and I believe there should be no differences between our
results and what PcGive yields. But then again, Microfit seems to differ too
(I don't have Microfit, so I can't run an in-depth comparison).
Allin, if you approve the patch, I'll update the manual.
Riccardo "Jack" Lucchetti
Dipartimento di Economia
Facoltà di Economia "G. Fuà"
Ancona