IIRC adding models to the model table (what "xxx" <- system would do) is
not allowed inside a function, because functions are not supposed to
affect/alter the outer scope. There was a discussion on this before I
think (may have been on the devel list instead of the users list).
But I would tend to agree that it's unfortunate that because of that you
cannot do restrictions in systems inside functions (because the other
system syntax does not let you apply restrictions AFAIK).
Sorry but right now I'm not able to suggest a solution, just obvious
workarounds like "don't put the code inside a function". Maybe somebody
else has an idea.
Am 29.11.2010 13:17, schrieb Ofer Cornfeld:
I have tried to use system, restrict and estimate within a function
in order to perform restricted VAR, passing the series I want to
estimate as parameters as follows:
function varappx(series p_d,series d_d, series r, scalar rho)
"xxx" <- system
equation p_d 0 p_d(-1) d_d(-1) r(-1)
equation d_d 0 p_d(-1) d_d(-1) r(-1)
equation r 0 p_d(-1) d_d(-1) r(-1)
1 - rho*b[1,1] - b[2,1] + b[3,1] = 0
-b[2,2] + b[3,2] - rho*b[1,2] = 0
-b[2,3] + b[3,3] - rho*b[1,3] = 0
estimate "xxx" method=fiml
Gretl fails on the system command with "Syntax error in command
The same syntax outside the function works just fine.
What am I doing wrong?
With kind regards,
_______________________________________________ Gretl-users mailing