Fix behavior of smoother2histval

  • The smoother will only store the M_.orig_endo_nbr variables for Bayesian estimation. So calling smoother2histval will "forget" about the auxiliary variables we introduce. Thus, by convention they will be initialized at their steady state - which differs from the description in the manual that it

    will use these values to construct initial conditions (as if they had been manually entered through histval).

    In case of histval, the non-mentioned variables would be set to 0.

    In contrast, for ML it will work.

  • @MichelJuillard In b70d99d1 the code was refactored. But the treatment of lags seems inconsistent. Initialization assumes one lag via

    M_.endo_histval = repmat(oo_.steady_state, 1, M_.maximum_lag);

    but later we have

    k = M_.orig_maximum_endo_lag - M_.maximum_endo_lag + 1: M_.orig_maximum_lag;
    v = s((period-M_.orig_maximum_endo_lag+1):period);% + steady_state(j);
    M_.endo_histval(j, :) = v(k);

    which relies on orig_maximum_endo_lag and may have more than one lag. Using grep, it seems most other files expect M_.endo_histval to be a vector not a matrix.

  • Depending on whether output is to a file or M_.endo_histval, non-requested variables will be set to 0 or the steady state. We must be consistent.

Edited by Johannes Pfeifer