Page 1 of 1

apparent data loading problem

PostPosted: Sun Apr 03, 2016 4:55 am
by jimmyk
Strange problem: Several programs I've written work for my co-author on his computer, but not on mine. In one case, parameter estimates don't converge when I run the identical program with identical data, while he gets convergence. As far as I can tell, the only difference is he's on a unix system and I'm in Windows. We both run the program from the folder that has the data file. In the attached case I get errors that prevent the program from running, specifically, this happens after the steady state is calculated, at the point where the data should load: Where my colleague gets

Loading 193 observations from autodata_ur.xls

Initial value of the log posterior (or likelihood): 573.5629


I get

Error using -
Matrix dimensions must agree.

Error in set_prior (line 270)
elseif any(bayestopt_.p5-old.bayestopt_.p5(:))

Error in dynare_estimation_init (line 123)
[xparam1,estim_params_,bayestopt_,lb,ub,M_] = set_prior(estim_params_,M_,options_);

Error in dynare_estimation_1 (line 59)
[dataset_,xparam1, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_, dname, [], M_, options_,
oo_, estim_params_, bayestopt_);

Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);

Error in invmod6ml_ur_base (line 226)
dynare_estimation(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;


I've run programs like this before, so I'm really baffled.

Re: apparent data loading problem

PostPosted: Tue Apr 05, 2016 6:14 pm
by jpfeifer
The difference between Windows and Unix most probably has to do with different random numbers. Using a longer chain should still give you convergence. The second issue you report seems to come from a
previous
Code: Select all
definition.mat

file present in the prior subfolder, although I cannot trace why such an error might occur. Have you tried Dynare 4.4.3? In any case, you should be able to run the file in an empty folder.

Re: apparent data loading problem

PostPosted: Wed Apr 06, 2016 4:50 am
by jimmyk
Yes, both of these problems occurred with 4.4.3. I will try your solutions, thanks for responding.

Re: apparent data loading problem

PostPosted: Wed Apr 06, 2016 7:52 am
by jpfeifer
You cannot have used Dynare 4.4.3, because there line 270 of set_prior.m is different.

Re: apparent data loading problem

PostPosted: Sat Apr 16, 2016 11:32 am
by jimmyk
I should have said they *also* occurred with 4.4.3. I had originally run them on 4.4.3, but when they didn't run on my computer, but did on my colleagues (who was running an earlier version), I then ran them on the earlier version, thinking maybe it was a problem with 4.4.3.

In any case, I was able to get the program that I had attached to run properly from an empty folder. As for the other problem with parameter estimates not converging: I should have mentioned that I was just using ML estimation, not Bayesian. Does that even use random number generation? And if so, is the chain something set in Dynare or in Matlab? Thanks again, and I was traveling for a week hence my delayed response.

Re: apparent data loading problem

PostPosted: Mon Apr 18, 2016 8:44 pm
by jpfeifer
The chain comment refers to Bayesian. If you do ML, the answer depends on the mode-finder. If you use
Code: Select all
mode_compute=4
that randomly perturbs the search direction, which can explain the difference (similarly for 6 and 9).