fixing problems related to auxiliary variables

time-shift
Michel Juillard 2011-10-19 12:44:27 +02:00
parent 6ad56d9508
commit 9425b36358
4 changed files with 33 additions and 20 deletions

View File

@ -47,25 +47,10 @@ end
steady_state_old = oo_.steady_state;
% If using a steady state file, initialize oo_.steady_state with that file
if options_.steadystate_flag
[ys,check] = feval([M_.fname '_steadystate'], ...
oo_.steady_state, ...
[oo_.exo_steady_state; ...
oo_.exo_det_steady_state]);
if size(ys, 1) < M_.endo_nbr
if length(M_.aux_vars) > 0
ys = add_auxiliary_variables_to_steadystate(ys,M_.aux_vars, ...
M_.fname, ...
oo_.exo_steady_state, ...
oo_.exo_det_steady_state, ...
M_.params,...
options_.bytecode);
else
error([M_.fname '_steadystate.m doesn''t match the model']);
end
end
oo_.steady_state = ys;
[oo_.steady_state,M.params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,0);
if info(1)
print_info(info,options_.noprint)
end
% Compute the residuals

View File

@ -4020,7 +4020,7 @@ DynamicModel::substituteLeadLagInternal(aux_var_t type, bool deterministic_model
// - lead variables from lower lead to higher lead (need to be listed in reverse order)
// - lag variables from lower lag to higher lag
if ((type == avEndoLead) || (type == avExoLead))
copy(neweqs.rbegin(), neweqs.rend(), back_inserter(aux_equations));
copy(neweqs.begin(), neweqs.end(), back_inserter(aux_equations));
else
copy(neweqs.begin(), neweqs.end(), back_inserter(aux_equations));

View File

@ -30,6 +30,7 @@ MODFILES = \
steady_state/walsh1_old_ss.mod \
steady_state/walsh1_ssm.mod \
steady_state/walsh1_ssm_block.mod \
steady_state/multi_leads.mod
steady_state_operator/standard.mod \
steady_state_operator/use_dll.mod \
steady_state_operator/block.mod \

View File

@ -0,0 +1,27 @@
@#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,irf=0) ;