ERROR IN RMSE

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.

ERROR IN RMSE

Postby aghayan_beh » Wed Jun 28, 2017 11:58 am

HI
I try to compute the root mean square error (RMSE) with dynare_sensitivity for a DSGE model but I encounter this error:


Operands to the || and && operators must be convertible to logical scalar values.
Error in initialize_dataset (line 35)
if isempty(nobs) || rows(rawdata)<nobs+first-1 %case 2: dataset has changed
Error in dynare_estimation_init (line 475)
dataset_ =
initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);
Error in dynare_sensitivity (line 87)
[dataset_,xparam1,hh, M_, options_, oo_, estim_params_,bayestopt_]=dynare_estimation_init(M_.endo_names,fname_,1, M_,
options_, oo_, estim_params_, bayestopt_);
Error in dsge (line 376)
dynare_sensitivity(options_gsa);
Error in dynare (line 180)
evalin('base',fname) ;


Thank you for your help!


dsge.rar
(11.08 KiB) Downloaded 59 times
aghayan_beh
 
Posts: 6
Joined: Fri Jun 10, 2016 5:40 pm

Re: ERROR IN RMSE

Postby jpfeifer » Wed Jun 28, 2017 8:20 pm

Please upgrade to Dynare 4.5. I am getting a different error message there. The problem is that your dataset has 96 observation, but you set first_obs=10 and nobs=[90:96], meaning that you want to select 90 periods after first_obs, which would imply you want to use observation 10 to 99.
------------
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: ERROR IN RMSE

Postby aghayan_beh » Thu Jun 29, 2017 5:30 pm

Hi
Thank you very much for your reply.
I have 96 observation. My goal is that have an in-sample forecast for the last two data and for 2 horizons and then do RMSE.I upgrade my dynare and I write this nobs=[85:86]

Estimation
(datafile=data_dsge,first_obs=10,prefilter=1,mh_nblocks=2,tex,mh_jscale=0.6,mh_replic=1500,mode_compute=6,lik_init=2,mh_drop=0.4,nodisplay,nograph,mode_check,nobs=[85:86],forecast=2)pi;

dynare_sensitivity (datafile=data_dsge,first_obs=10,pprior=0,ppost=1,prefilter=1,lik_only = 0,nobs=[85:86],rmse=1,var_rmse=(pi)) ;

But this error accrue:
Error using : (line 38)
dates::colon: In an expression like A:B, A and B must be dates objects!

Error in makedataset (line 252)
DynareDataset = DynareDataset(FIRSTOBS:lastobs);

Error in dynare_estimation_init (line 538)
[dataset_, dataset_info, newdatainterfaceflag] = makedataset(options_, options_.dsge_var*options_.dsge_varlag, gsa_flag);

Error in dynare_sensitivity (line 121)
[dataset_,dataset_info,xparam1,hh, M_, options_, oo_,
estim_params_,bayestopt_]=dynare_estimation_init(M_.endo_names,fname_,1, M_, options_, oo_, estim_params_,
bayestopt_);
Error in dsge (line 387)
dynare_sensitivity(options_gsa);
Error in dynare (line 228)
evalin('base',fname) ;


What should i exactly write for dynare_sensitivity?
Thanks for your reply.
aghayan_beh
 
Posts: 6
Joined: Fri Jun 10, 2016 5:40 pm

Re: ERROR IN RMSE

Postby jpfeifer » Thu Jun 29, 2017 6:31 pm

Please provide the updated 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

Re: ERROR IN RMSE

Postby aghayan_beh » Fri Jun 30, 2017 6:48 am

hi
this is my update file

dsge.rar
(16.67 KiB) Downloaded 51 times


thanks for your reply
aghayan_beh
 
Posts: 6
Joined: Fri Jun 10, 2016 5:40 pm

Re: ERROR IN RMSE

Postby jpfeifer » Fri Jun 30, 2017 8:15 am

In contrast to the
Code: Select all
estimation
command, the command
Code: Select all
dynare_sensitivity
does not take a vector-sized
Code: Select all
nobs
. Please use a scalar here.
------------
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: ERROR IN RMSE

Postby aghayan_beh » Fri Jun 30, 2017 2:10 pm

Hi
As you said, I write nobs=85 (use a scalar) in dynare_sensitivity, but my program is still not working and this error occurs. I am confused.

Error using load
Unable to read file 'dsge/metropolis\dsge_data.mat'. No such file or directory.

Error in filt_mc_ (line 146)
load([DirectoryName filesep M_.fname '_data.mat']);

Error in dynare_sensitivity (line 416( filt_mc_(OutputDirectoryName,options_gsa,dataset_,dataset_info);

Error in dsge (line 387)
dynare_sensitivity(options_gsa);

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


Thanks for your reply.
aghayan_beh
 
Posts: 6
Joined: Fri Jun 10, 2016 5:40 pm

Re: ERROR IN RMSE

Postby jpfeifer » Tue Jul 04, 2017 12:49 pm

There is an incompatibility of
Code: Select all
dynare_sensitivity

with estimation being run in recursive estimation. I will try to fix this soon. For now, try to run the code for each nobs separately.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 12 guests