Page 1 of 1

Bug in dr1.m with loglinear option in estimation.

PostPosted: Mon Apr 09, 2012 10:38 pm
by bkjecn
Hi,

I believe that dr1.m contains a bug. I found the bug while working with a model that I estimated using 'loglinear'. To illustrate the point, I made a very simple model (which is actually loglinear). I attached the mod file. When the loglinear option is in the estimation command, the matrix multiplication in line 263 of dr1.m has incorrect dimensions. Currently, it reads:

dr.ghx = repmat(1./dr.ys,1,size(dr.ghx,2)).*dr.ghx.* ...
repmat(dr.ys(klags),size(dr.ghx,1),1);

I think it should read

dr.ghx = repmat(1./dr.ys,1,size(dr.ghx,2)).*dr.ghx.* ...
repmat(dr.ys(klags)',size(dr.ghx,1),1);

You can see that things work fine when you delete the loglinear option from estimation. If one of the developers could look at this, it would be great. Also, if you could please advise on the best place to register bugs, I would appreciate it.

Best,

Ben

Re: Bug in dr1.m with loglinear option in estimation.

PostPosted: Sun Apr 15, 2012 4:03 pm
by MichelJuillard
Dear Ben,

thank you for reporting the problem. It will be corrected in tomorrow's unstable version.

Kind regards,

Michel

Re: Bug in dr1.m with loglinear option in estimation.

PostPosted: Sun Apr 15, 2012 4:37 pm
by bkjecn
Hi Michel,

Thanks so much! I really appreciate your time and attention to this issue. Thanks for all your work on Dynare!

Best,
Ben