Commit b2e3a481 authored by Sébastien Villemot's avatar Sébastien Villemot

Fix for histval with auxiliary lead variables corresponding to non-linear terms

The M_.params structure was not correctly passed to
dynamic_set_auxiliary_series.m, leading to crashes if a parameter was needed to
compute an auxiliary variable (typically an auxiliayr lead variable
corresponding to a non-linear term in stochastic setup).
parent a69c6536
......@@ -378,7 +378,7 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini
}
output << "if exist(['+' M_.fname '/dynamic_set_auxiliary_series'])" << endl
<< " eval(['M_.histval_dseries = ' M_.fname '.dynamic_set_auxiliary_series(M_.histval_dseries, []);']);" << endl
<< " eval(['M_.histval_dseries = ' M_.fname '.dynamic_set_auxiliary_series(M_.histval_dseries, M_.params);']);" << endl
<< "end" << endl
<< "M_.endo_histval = M_.histval_dseries{M_.endo_names{:}}(dates(sprintf('%dY', 1-M_.maximum_lag)):dates('0Y')).data';" << endl
<< "M_.endo_histval(isnan(M_.endo_histval)) = 0;" << endl; // Ensure that lead aux variables do not have a NaN
......
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