Problem with datafile

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?
Policya.mod (1.46 KB)

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.

Thanks but I did as u said and it did’nt worked.
PolicyA_stimation.rar (26.7 KB)

I get the error message

[quote]initial_estimation_checks:: Estimation can’t take place because there are less declared shocks than
observed variables!
[/quote]

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

So if I want to add shocks what should I do? Because the model is nonlinear

Actually yet I get the following error
Error using ==> read_variables at 84
Can’t find datafile: datapolicya

Is the datafile really located in the same folder? Try downloading your own posted file in a different folder and run it.

Yes it’s in the same folder. I did it with the RAR file I send to u but I got the same error

Try using the parameteric version:

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

I’m so sorry but again I’ve got the following error

[quote]??? 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) ;
[/quote]

What does

which datapolicya.xlsx
return, when you enter it into Matlab’s command window?

F:\Thesis\SWF\model\DSGE\Model nonlinear\Stimation\PolicyA\datapolicya.xlsx
it’s the same path of my .mod file

Have you tried reinstalling Dynare or using the unstable version. Which version are you using?

I’m using dynare 4.3
Is it working properly for u Johannes?

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

Thank you very much for your attention.
Actually I used the original data from Iranian Central Bank and I did anything by myself on them. Anyway, as your advise I saved the original data entries in a new Excel file and worked with them but unfortunately I have the same error. I think it’s unusual

Did reading Excel files ever work on your computer?

Thank you very much prof. Pfeifer for your advises.
The problem has been solved when I install dynare 4.4.3 . But I’ got such a new error:

[quote]Log data density [Laplace approximation] is -71142721660644.375000.

??? Error using ==> chol
Matrix must be positive definite.

Error in ==> metropolis_hastings_initialization at 68
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 62
ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = …

Error in ==> dynare_estimation_1 at 782
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 89
dynare_estimation_1(var_list,dname);

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

Error in ==> dynare at 180
evalin(‘base’,fname) ;[/quote]

That is an economic problem. Judging from the log data density, your observation equations are still wrong. Please see Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.

thank you very much prof. Pfeifer for your helpful advises.