Page 1 of 2

problem with datafile

PostPosted: Thu Dec 08, 2016 1:15 pm
by stavakoli
Hi everybody.
I read section 5.7 of the userguide, in the description of the "datafile", "first_obs" and "nobs" options and do the same but I received the following error:
??? Error using ==> read_variables at 84
Can't find datafile: Data
What's wrong with my code?

Re: problem with datafile

PostPosted: Thu Dec 08, 2016 6:52 pm
by jpfeifer
You need to provide the datafile as well (use a zip-file to upload everything). Also: do never name your data-file "data", it will result in name conflicts.

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 7:53 am
by stavakoli
Thanks but I did as u said and it did'nt worked.

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 7:57 am
by jpfeifer
I get the error message
initial_estimation_checks:: Estimation can't take place because there are less declared shocks than
observed variables!

You cannot estimate a model with four observables and only 1 shock. That leads to stochastic singularity.

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 8:18 am
by stavakoli
So if I want to add shocks what should I do? Because the model is nonlinear

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 8:23 am
by stavakoli
Actually yet I get the following error
Error using ==> read_variables at 84
Can't find datafile: datapolicya

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 8:56 am
by jpfeifer
Is the datafile really located in the same folder? Try downloading your own posted file in a different folder and run it.

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:01 am
by stavakoli
Yes it's in the same folder. I did it with the RAR file I send to u but I got the same error

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:12 am
by jpfeifer
Try using the parameteric version:
Code: Select all
estimation(datafile='datapolicya.xlsx',xls_sheet=sheet1, mh_replic=30000 , mh_drop=0.2, mh_jscale=0.08) c i gc gi or y;

Also, try typing
Code: Select all
which datapolicya.xlsx

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:20 am
by stavakoli
I'm so sorry but again I've got the following error
??? Error using ==> read_variables at 84
Can't find datafile: datapolicya.xlsx

Error in ==> initialize_dataset at 31
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);

Error in ==> dynare_estimation_init at 322
dataset_ =
initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);

Error in ==> dynare_estimation_1 at 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 at 70
dynare_estimation_1(var_list,dname);

Error in ==> policya at 259
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:23 am
by jpfeifer
What does
Code: Select all
which datapolicya.xlsx

return, when you enter it into Matlab's command window?

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:26 am
by stavakoli
F:\Thesis\SWF\model\DSGE\Model nonlinear\Stimation\PolicyA\datapolicya.xlsx
it's the same path of my .mod file

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:33 am
by jpfeifer
Have you tried reinstalling Dynare or using the unstable version. Which version are you using?

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:35 am
by stavakoli
I'm using dynare 4.3
Is it working properly for u Johannes?

Re: problem with datafile

PostPosted: Sat Dec 10, 2016 9:48 am
by jpfeifer
Yes, it is properly working for me, with basically any Dynare version. Therefore, it might be a problem with Excel on your machine, because Matlab uses it to read in data. Is it intentional that there are data entries in cells like A1032247? That can create problems. Try saving just the original data entries in a new Excel file