Octave: persistent variables do not get set in prior_draw
I noticed that running
tests/identification/as2007/as2007.mod of the master branch with Octave (ver. 4.4.1) does not work with the following error:
Monte Carlo Testing error: 'a' undefined near line 40 column 19 error: called from gamrnd at line 40 column 7 gamrnd at line 122 column 27 prior_draw at line 128 column 24 dynare_identification at line 529 column 20 driver at line 247 column 1 dynare at line 288 column 1 stopped in /home/wmutschl/dynare/wip/matlab/missing/stats/gamrnd.m at line 40 40: b = ones(size(a));
I think the reason is that in
dynare_identification in line 155/157
prior_draw(bayestopt_, options_.prior_trunc, false) is called once to initialize the following persistent variables in
persistent p6 p7 p3 p4 lb ub persistent uniform_index gaussian_index gamma_index beta_index inverse_gamma_1_index inverse_gamma_2_index weibull_index persistent uniform_draws gaussian_draws gamma_draws beta_draws inverse_gamma_1_draws inverse_gamma_2_draws weibull_draws
Once we have that,
prior_draw() generates a new draw. At least this is the ways it works in Matlab and the test file runs through.
However, in Octave the persistent variables do not get set for some reason, and hence
gamrnd is called with undefined inputs, as far as I can see.