Commit ec53cae4 authored by michel's avatar michel
Browse files

bugs correction for exo_det

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2067 ac1d8469-bf42-47a9-8791-bf33cf982152
parent ea271e7e
No preview for this file type
......@@ -130,7 +130,7 @@ function info = forecast(var_list,task)
end
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
if options_.nograph == 0
......
......@@ -108,21 +108,27 @@ function [y_,int_width]=simultexdet(y0,ex,ex_det, iorder,var_list,M_,oo_,options
end
[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_u1 = ghu1*M_.Sigma_e*ghu1';
sigma_y = 0;
for i=1:iter
var_yf(i,dr.order_var) = diag(sigma_y(1:endo_nbr,1:endo_nbr))';
if i == iter
break
end
sigma_u = A*sigma_u*A';
sigma_y = sigma_y+sigma_u;
sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1;
var_yf(i,:) = diag(sigma_y1)';
if i == iter
break
end
sigma_u = A*sigma_u*A';
sigma_y = sigma_y+sigma_u;
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);
for i=1:endo_nbr
int_width(:,i) = fact*sqrt(var_yf(:,i));
......
......@@ -90,12 +90,12 @@ SymbolTable::writeOutput(ostream &output) const
}
if (exo_det_nbr > 0)
{
output << "lgxdet_ = '" << getNameByID(eExogenousDet, 0) << "';" << endl;
output << "lgxdet_tex_ = '" << getTeXNameByID(eExogenousDet, 0) << "';" << endl;
output << "M_.exo_det_names = '" << getNameByID(eExogenousDet, 0) << "';" << endl;
output << "M_.exo_det_names_tex = '" << getTeXNameByID(eExogenousDet, 0) << "';" << endl;
for (int id = 1; id < exo_det_nbr; id++)
{
output << "lgxdet_ = srtvcat(lgxdet_, '" << getNameByID(eExogenousDet, id) << "');" << endl
<< "lgxdet_tex_ = strvcat(lgxdet_tex_, '" << getTeXNameByID(eExogenousDet, id) << "');" << endl;
output << "M_.exo_det_names = srtvcat(M_.exo_det_names, '" << getNameByID(eExogenousDet, id) << "');" << endl
<< "M_.exo_det_names_tex = strvcat(M_.exo_det_names_tex, '" << getTeXNameByID(eExogenousDet, id) << "');" << endl;
}
}
if (endo_nbr > 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment