histval: use now the same treatment for exogenous and exogenous det
variables as for endogenous ones. Closes issue #617.time-shift
parent
f26551509c
commit
7d11ed7642
|
@ -491,6 +491,8 @@ oo_.exo_det_simul = [];
|
||||||
|
|
||||||
M_.params = [];
|
M_.params = [];
|
||||||
M_.endo_histval = [];
|
M_.endo_histval = [];
|
||||||
|
M_.exo_histval = [];
|
||||||
|
M_.exo_det_histval = [];
|
||||||
M_.Correlation_matrix = [];
|
M_.Correlation_matrix = [];
|
||||||
M_.Correlation_matrix_ME = [];
|
M_.Correlation_matrix_ME = [];
|
||||||
|
|
||||||
|
|
|
@ -39,15 +39,27 @@ if M_.exo_det_nbr > 1 && isempty(oo_.exo_det_steady_state)
|
||||||
end
|
end
|
||||||
|
|
||||||
% Initialize oo_.exo_simul
|
% Initialize oo_.exo_simul
|
||||||
if isempty(ex0_)
|
if isempty(M_.exo_histval)
|
||||||
oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
|
if isempty(ex0_)
|
||||||
|
oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
|
||||||
|
else
|
||||||
|
oo_.exo_simul = [ repmat(ex0_',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
|
||||||
|
end
|
||||||
else
|
else
|
||||||
oo_.exo_simul = [ repmat(ex0_',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
|
if isempty(ex0_)
|
||||||
end
|
oo_.exo_simul = [M_.exo_histval'; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1)];
|
||||||
|
else
|
||||||
|
error('histval and endval cannot be used simultaneously')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
% Initialize oo_.exo_det_simul
|
% Initialize oo_.exo_det_simul
|
||||||
if M_.exo_det_nbr > 0
|
if M_.exo_det_nbr > 0
|
||||||
oo_.exo_det_simul = [ones(M_.maximum_lag+options_.periods+M_.maximum_lead,1)*oo_.exo_det_steady_state'];
|
if isempty(M_.exo_det_histval)
|
||||||
|
oo_.exo_det_simul = repmat(oo_.exo_det_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
|
||||||
|
else
|
||||||
|
oo_.exo_det_simul = [M_.exo_det_histval'; repmat(oo_.exo_det_steady_state',options_.periods+M_.maximum_lead,1)];
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
% Add temporary shocks
|
% Add temporary shocks
|
||||||
|
|
|
@ -274,7 +274,9 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini
|
||||||
output << "%" << endl
|
output << "%" << endl
|
||||||
<< "% HISTVAL instructions" << endl
|
<< "% HISTVAL instructions" << endl
|
||||||
<< "%" << endl
|
<< "%" << endl
|
||||||
<< "M_.endo_histval = zeros(M_.endo_nbr,M_.maximum_lag);" << endl;
|
<< "M_.endo_histval = zeros(M_.endo_nbr,M_.maximum_lag);" << endl
|
||||||
|
<< "M_.exo_histval = zeros(M_.exo_nbr,M_.maximum_lag);" << endl
|
||||||
|
<< "M_.exo_det_histval = zeros(M_.exo_det_nbr,M_.maximum_lag);" << endl;
|
||||||
|
|
||||||
for (hist_values_t::const_iterator it = hist_values.begin();
|
for (hist_values_t::const_iterator it = hist_values.begin();
|
||||||
it != hist_values.end(); it++)
|
it != hist_values.end(); it++)
|
||||||
|
@ -312,9 +314,9 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini
|
||||||
if (type == eEndogenous)
|
if (type == eEndogenous)
|
||||||
output << "M_.endo_histval( " << tsid << ", M_.maximum_lag + " << lag << ") = ";
|
output << "M_.endo_histval( " << tsid << ", M_.maximum_lag + " << lag << ") = ";
|
||||||
else if (type == eExogenous)
|
else if (type == eExogenous)
|
||||||
output << "oo_.exo_simul( M_.maximum_lag + " << lag << ", " << tsid << " ) = ";
|
output << "M_.exo_histval( " << tsid << ", M_.maximum_lag + " << lag << ") = ";
|
||||||
else if (type != eExogenousDet)
|
else if (type == eExogenousDet)
|
||||||
output << "oo_.exo_det_simul( M_.maximum_lag + " << lag << ", " << tsid << " ) = ";
|
output << "M_.exo_det_histval( " << tsid << ", M_.maximum_lag + " << lag << ") = ";
|
||||||
|
|
||||||
expression->writeOutput(output);
|
expression->writeOutput(output);
|
||||||
output << ";" << endl;
|
output << ";" << endl;
|
||||||
|
|
Loading…
Reference in New Issue