Loading Initial and Historical Value Data

Is there are way in dynare to load initial values or historical values from a matlab database much like you can load parameter values and use the “set_param_value” function? My sense is no from looking through the documentation and previous discussions, but I wanted to ask in case this feature has been added to the software recently.

Thanks,
Daniel

In which context, i.e. for which command?

for the histval or initval block of code in the .mod file.

rather than

initval;
y = log(30)
end;

I want to do something like

initval;
y = X;
end;

where X is a value stored in a matlab database corresponding to the actual level of output (GDP) in the data.

Thanks for your help.

See the manual on

initval_file

Hello everyone,
I have a theoretical and a practical questions related to this topic. Suppose you have a model with two variables A et B. A has one lag and B has three lags (which means, correct if I am wrong, that both are state variables).
1- when forecasting, should we have historical values up to three lags for B or is it enough to have an historical value for only the first lag of B?
2- I have read that the command smoother2histval is designed to construct historical values for forecasting. But it seems that it just uses the last observations of the smoothed value as historical value. Is it consistent when you have A and B in the model?

  1. You need initial values for all state variables. If B has three lags, all three lags will be state variables.
  2. The Kalman smoother will infer the last value of all states and use that for forecasting when using smoother2histval. Please use at least Dynare 5 for that exercise. Before that, there was a bug that might affect the exercise.

As always, thanks a lot.

However, variables from the smoother2histval command are different from the M_.endo_names(M_.state_var). There are more variables in dseries from the smoother2histval command than from M_.endo_names(M_.state_var). From my point of view there is something wrong with the mapping or not ?

No, you simply set the full vector of variables, but obviously only the states actually matter.

I understand, thank you.