gbel
#1
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.

```
@#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

gbel
#2
Additional info. The auxiliary variables in the steady state file generated by the 4.2.2 preprocessor comes from an inverted loop:

```
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

Thanks for reporting this bug. I opened a ticket in our bug tracker: dynare.org/trac/ticket/219

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