Placing dates on the horizontal axis of shock decomposition

I want to put quarterly dates starting in 2002Q1 on horizontal axis of graphs of my shock decompositions?
How could I do this?

Try the dseries object. An example is at tests/dates/fs2000.mod · master · Dynare / dynare · GitLab, with the data being at tests/dates/fsdat_simul.m · master · Dynare / dynare · GitLab.

1 Like

Dear jpfeifer,
I im getting this message error:

[code]Error using -
Matrix dimensions must agree.

Error in demean (line 50)
c = x-mean(x);

Error in nanautocovariance (line 65)
data = demean(data);

Error in makedataset (line 279)
DatasetInfo.descriptive.autocovariance = nanautocovariance(DynareDataset.data, DynareOptions.ar);

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

Error in dynare_estimation_1 (line 115)
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_, estim_params_, bayestopt_, bounds] = …

Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);

Error in prometheo (line 2900)
oo_recursive_=dynare_estimation(var_list_);

Error in dynare (line 223)
evalin(‘base’,fname) ;[/code]

I attach my files.
mymod.rar (149 KB)

Are you using Dynare 4.5?

Yes dear jpfeifer, I am using Dynare 4.5.0 in Matlab 2015a.

Please, how could I fix this?

Thanks

ALdo

That is strange, because I am getting

[quote]Error using print_info (line 110)
Likelihood is not a number (NaN) or a complex number

Error in print_info (line 110)
error(‘Likelihood is not a number (NaN) or a complex number’);

Error in initial_estimation_checks (line 175)
print_info(info, DynareOptions.noprint, DynareOptions)

Error in dynare_estimation_1 (line 165)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);

Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);

Error in prometheo (line 2899)
oo_recursive_=dynare_estimation(var_list_);

Error in dynare (line 223)
evalin(‘base’,fname) ;[/quote]

which happens in a different line, suggesting that you were using a different mod-file than the one you provided.

Hi Aldo ; can you tell me how you fix this problem?

I solved it modifying plot_shock_decomposition.m.

In line 82 I replaced

initial_date = dates('1Y');

with

initial_date = dates('2002Q1');

Thanks for your answer

But i can’t open your file(.rar) …can you send your .mod dynare code?

The .rar is not necessary.

plot_shock_decomposition.m is in C:\dynare\4.5.7\matlab