problem with datafile

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

problem with datafile

Postby stavakoli » Thu Dec 08, 2016 1:15 pm

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?
Attachments
Policya.mod
(1.46 KiB) Downloaded 96 times
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Thu Dec 08, 2016 6:52 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 7:53 am

Thanks but I did as u said and it did'nt worked.
Attachments
PolicyA_stimation.rar
(26.69 KiB) Downloaded 95 times
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 7:57 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 8:18 am

So if I want to add shocks what should I do? Because the model is nonlinear
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 8:23 am

Actually yet I get the following error
Error using ==> read_variables at 84
Can't find datafile: datapolicya
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 8:56 am

Is the datafile really located in the same folder? Try downloading your own posted file in a different folder and run it.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 9:01 am

Yes it's in the same folder. I did it with the RAR file I send to u but I got the same error
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 9:12 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 9:20 am

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) ;
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 9:23 am

What does
Code: Select all
which datapolicya.xlsx

return, when you enter it into Matlab's command window?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 9:26 am

F:\Thesis\SWF\model\DSGE\Model nonlinear\Stimation\PolicyA\datapolicya.xlsx
it's the same path of my .mod file
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 9:33 am

Have you tried reinstalling Dynare or using the unstable version. Which version are you using?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with datafile

Postby stavakoli » Sat Dec 10, 2016 9:35 am

I'm using dynare 4.3
Is it working properly for u Johannes?
stavakoli
 
Posts: 32
Joined: Tue Nov 22, 2016 3:13 pm

Re: problem with datafile

Postby jpfeifer » Sat Dec 10, 2016 9:48 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Next

Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 4 guests