Page 1 of 1

Problem running code

PostPosted: Sat Feb 07, 2015 2:18 am
by anup08
Hi,

I am very new to Dynare. I was trying to run the attached "modelEPR_Baseline.dyn" file on Dynare 4.4.3. But it seemed that Dynare cannot run a file with "dyn" extension. Therefore I changed the extension of the file from "dyn" to "mod". After running the file with renamed extension, Dynare gives me the following message:

"You did not declare endogenous variables after the estimation/calib_smoother command.
Posterior IRFs, posterior moments, smoothed variables and forecasts will be
computed for the 35 endogenous variables of your model, this
can be very long....


Choose one of the following options:

[1] Consider all the endogenous variables.
[2] Consider all the observed endogenous variables.
[3] Stop Dynare and change the mod file."

I was not sure which one to pick, but I picked [2] anyway. After that Dynare again encounters problem and gives me the following message:

??? Error using ==> read_variables at 60
Can't find datafile: usedata.{m,mat,xls,xlsx,csv}

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

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

Error in ==> dynare_estimation_1 at 81
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_, dname, [], M_, options_, oo_,
estim_params_, bayestopt_);

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

Error in ==> code at 330
dynare_estimation(var_list_);

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

--------------------------------

Please suggest me what should I do to or what's missing....

Attachment:
model3_data_mar12_2007.xls
(75.5 KiB) Downloaded 70 times

Re: Problem running code

PostPosted: Mon Feb 09, 2015 1:40 pm
by jpfeifer
You named your datafile "usedata", but the uploaded Excel file has a different name. You need to correct this.

Re: Problem running code

PostPosted: Mon Feb 09, 2015 8:25 pm
by anup08
jpfeifer wrote:You named your datafile "usedata", but the uploaded Excel file has a different name. You need to correct this.


Dear Professor:

Thanks for your reply. I already did that before. But that gave me the following errors:

??? Error using ==> load_xls_file_data at 117
load_xls_file_data: I am not able to read the dates!

Error in ==> read_variables at 92
[freq,init,data,varlist] = load_xls_file_data(fullname,xls_sheet,xls_range);

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

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

Error in ==> dynare_estimation_1 at 81
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_, dname, [], M_, options_, oo_,
estim_params_, bayestopt_);

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

Error in ==> modelEPR_Baseline at 330
dynare_estimation(var_list_);

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

Re: Problem running code

PostPosted: Tue Feb 10, 2015 11:47 am
by jpfeifer
But this error occurs later than the other one. Please provide the files that provoked this error.

Re: Problem running code

PostPosted: Tue Feb 10, 2015 9:16 pm
by anup08
Professor, I attached all the files in my first post. Thanks for your help.

Re: Problem running code

PostPosted: Wed Feb 11, 2015 5:03 pm
by jpfeifer
Delete the empty space in the name of the worksheet in Excel (i.e. ForMatlab instead of For Matlab) and then use
Code: Select all
estimation(datafile = model3_data_mar12_2007,
           xls_sheet=ForMatlab,

Re: Problem running code

PostPosted: Wed Feb 11, 2015 7:43 pm
by anup08
Can't thank you enough Professor! Your suggestion seemed to have solved the problem!