ERROR IN RMSE
Posted:
Wed Jun 28, 2017 11:58 am
by aghayan_beh
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
Re: ERROR IN RMSE
Posted:
Wed Jun 28, 2017 8:20 pm
by jpfeifer
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.
Re: ERROR IN RMSE
Posted:
Thu Jun 29, 2017 5:30 pm
by aghayan_beh
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.
Re: ERROR IN RMSE
Posted:
Thu Jun 29, 2017 6:31 pm
by jpfeifer
Please provide the updated file
Re: ERROR IN RMSE
Posted:
Fri Jun 30, 2017 8:15 am
by jpfeifer
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.
Re: ERROR IN RMSE
Posted:
Fri Jun 30, 2017 2:10 pm
by aghayan_beh
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.
Re: ERROR IN RMSE
Posted:
Tue Jul 04, 2017 12:49 pm
by jpfeifer
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.