by tanya » Thu Sep 02, 2010 7:39 pm
Dear Stephane
Many many thanks for the links. The only page I can find on wiki suggests external_function which I cannot make working. More specifically, I have the following model that used to work under dynare 3 (see below). Adding external_function(myfunc) (after "parameters"?) did not help. I cannot provide any analytical derivatives, and I also have min 20 parameters a (can go up to 70) and about 10 of b's. I will be very grateful for any hints how to deal with this.
PS. Am I right it wants a scalar output? If so, is there any way out? My myfunc is extremely computationally intensive (my next challenge will be to parallel MH alg, this is why I want dynare 4 not 3), and I would prefer to call it once and get a vector output of size 20-70 as all parameters determined simultaneously, rather than call it 20-70 times and return only one parameter at a time.
PPS. Am i right in if I declare a1 a2 a3 as endogenous variables and provide steady state for them, then my model becomes non-linear and this is even bigger computational problem then to call my routine 20-70 times?
...
var X X1 X2 X3 X4 ...;
parameters b1 b2 b3;
parameters a1 a2 a3 a4;
model(linear);
...
[a1,a2,a3,a4] = myfunc(b1,b2,b3);
X = a1*X1(-1)+a2*X2(-1)+a3*X3(-1)+a4*X4(-1);
...
end;
...
b1,BETA_PDF,0.5,0.15;
...