On Fri, 6 Aug 2010, Artur T. wrote:
I am estimating a restricted VECM using the --jitter option. I run
the
estimation several times using a loop function with the --progressive
option. I want to calculate the average likelihood value of the
restricted model, the average p-value for the LR test on the imposed
over-identifying restrictions and the average beta matrix. Applying the
loop only to the first two values works fine. But running the loop also
for the beta matrix results in a crash. Even if this option is not
supported for a matrix, gretl should not crash.
The basic loop looks like this:
----------
vecm 1 1 X
genr llB = $lnl
loop 100 --progressive --quiet
restrict --jitter
b[1,1]=0
end restrict
genr rlnl = $rlnl
genr LRB = pvalue(X, df, 2*(llB-rlnl))
matrix beta = $jbeta
print rlnl LRB
print beta
endloop
----------
I have discovered and fixed one bug in this general area, but I'm
not sure if it's the same one that caused the crash in your case.
If you could send me a complete case (data and script) I'll check.
Besides the crash you got (which obviously should not happen)
there are a few points to note:
* You should use the $pvalue accessor to get the p-value from
the restrict command each time round your loop.
* Only scalars can be printed via the "print" command in a
progressive loop. If you want a full record of jbeta so as to be
able to calculate statistics after the loop, use a matrix:
matrix JBETA = zeros(n, k)
scalar i=1
loop n --progressive
# do stuff
JBETA[i,] = $jbeta'
i++
endloop
If $jbeta has more than one column you'd have to take its vec().
Allin Cottrell