Page 1 of 1

Bug in 4.2.2

PostPosted: Thu Oct 06, 2011 3:35 pm
by gbel
Hi,

There's a bug with 4.2.2 with calculating the steady state of auxiliary variables when leads are higher then 2. The bug does not appear on 4.2.1.

Here's a short model to test it. Change N to see with various leads.
Code: Select all
@#define N = 4
var A B;
varexo eB;
parameters Bss rho;

Bss=1;
rho=0.9;

model;
A = B(@{N});
B = (1-rho)*Bss +rho*B(-1) +eB;
end;

steady_state_model;
A = Bss;
B = Bss;
end;

resid;
steady;
check;

shocks;
var eB ; stderr 1 ;
end;

stoch_simul(order=1,periods=300,irf=20) ;


Thanks,
Gilles

Re: Bug in 4.2.2

PostPosted: Thu Oct 06, 2011 4:35 pm
by gbel
Additional info. The auxiliary variables in the steady state file generated by the 4.2.2 preprocessor comes from an inverted loop:
Code: Select all
function [ys_, check_] = test_steadystate(ys_orig_, exo_)
% Steady state generated by Dynare preprocessor
    ys_=zeros(5,1);
    global M_
    ys_(1)=M_.params(1);
    ys_(2)=M_.params(1);
    % Auxiliary equations
ys_(5)=ys_(4);
ys_(4)=ys_(3);
ys_(3)=ys_(2);
    check_=0;
end


ys_(5) and ys_(4) are defined in the wrong sequence.

Gilles

Re: Bug in 4.2.2

PostPosted: Wed Oct 19, 2011 8:44 am
by SébastienVillemot
Thanks for reporting this bug. I opened a ticket in our bug tracker: https://www.dynare.org/trac/ticket/219

Re: Bug in 4.2.2

PostPosted: Wed Oct 19, 2011 12:11 pm
by MichelJuillard
Thanks Gilles. The bug has been fixed and the correction will be available in tomorrow's unstable version (dated 2011-10-20 or later)

Best

Michel