bugs correction for exo_det

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2067 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2008-09-14 16:36:58 +00:00
parent ea271e7e84
commit ec53cae4d0
4 changed files with 20 additions and 14 deletions

Binary file not shown.

View File

@ -130,7 +130,7 @@ function info = forecast(var_list,task)
end end
for i=1:M_.exo_det_nbr for i=1:M_.exo_det_nbr
eval(['oo_.forecast.Exogenous.' lgx_det_(i,:) '= M_.exo_det_simul(:,' int2str(i) ');']); eval(['oo_.forecast.Exogenous.' M_.exo_det_names(i,:) '= oo_.exo_det_simul(:,' int2str(i) ');']);
end end
if options_.nograph == 0 if options_.nograph == 0

View File

@ -108,21 +108,27 @@ function [y_,int_width]=simultexdet(y0,ex,ex_det, iorder,var_list,M_,oo_,options
end end
[A,B] = kalman_transition_matrix(dr,nstatic+(1:npred),1:nc,dr.transition_auxiliary_variables,M_.exo_nbr); [A,B] = kalman_transition_matrix(dr,nstatic+(1:npred),1:nc,dr.transition_auxiliary_variables,M_.exo_nbr);
inv_order_var = dr.inv_order_var;
ghx1 = dr.ghx(inv_order_var(ivar),:);
ghu1 = dr.ghu(inv_order_var(ivar),:);
sigma_u = B*M_.Sigma_e*B'; sigma_u = B*M_.Sigma_e*B';
sigma_u1 = ghu1*M_.Sigma_e*ghu1';
sigma_y = 0; sigma_y = 0;
for i=1:iter for i=1:iter
var_yf(i,dr.order_var) = diag(sigma_y(1:endo_nbr,1:endo_nbr))'; sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1;
if i == iter var_yf(i,:) = diag(sigma_y1)';
break if i == iter
end break
sigma_u = A*sigma_u*A'; end
sigma_y = sigma_y+sigma_u; sigma_u = A*sigma_u*A';
sigma_y = sigma_y+sigma_u;
end end
fact = qnorm((1-options_.conf_sig)/2,0,1); fact = norminv((1-options_.conf_sig)/2,0,1);
int_width = zeros(iter,endo_nbr); int_width = zeros(iter,endo_nbr);
for i=1:endo_nbr for i=1:endo_nbr
int_width(:,i) = fact*sqrt(var_yf(:,i)); int_width(:,i) = fact*sqrt(var_yf(:,i));

View File

@ -90,12 +90,12 @@ SymbolTable::writeOutput(ostream &output) const
} }
if (exo_det_nbr > 0) if (exo_det_nbr > 0)
{ {
output << "lgxdet_ = '" << getNameByID(eExogenousDet, 0) << "';" << endl; output << "M_.exo_det_names = '" << getNameByID(eExogenousDet, 0) << "';" << endl;
output << "lgxdet_tex_ = '" << getTeXNameByID(eExogenousDet, 0) << "';" << endl; output << "M_.exo_det_names_tex = '" << getTeXNameByID(eExogenousDet, 0) << "';" << endl;
for (int id = 1; id < exo_det_nbr; id++) for (int id = 1; id < exo_det_nbr; id++)
{ {
output << "lgxdet_ = srtvcat(lgxdet_, '" << getNameByID(eExogenousDet, id) << "');" << endl output << "M_.exo_det_names = srtvcat(M_.exo_det_names, '" << getNameByID(eExogenousDet, id) << "');" << endl
<< "lgxdet_tex_ = strvcat(lgxdet_tex_, '" << getTeXNameByID(eExogenousDet, id) << "');" << endl; << "M_.exo_det_names_tex = strvcat(M_.exo_det_names_tex, '" << getTeXNameByID(eExogenousDet, id) << "');" << endl;
} }
} }
if (endo_nbr > 0) if (endo_nbr > 0)