Commit 33f19d35 authored by Sébastien Villemot's avatar Sébastien Villemot

Merge branch 'conditional_forecast' into 'master'

imcforecast.m: Make code robust to 1 period

See merge request !1659
parents 6b9a86b0 fc9197a9
Pipeline #1693 passed with stages
in 71 minutes and 56 seconds
......@@ -265,13 +265,21 @@ forecasts.instruments = options_cond_fcst.controlled_varexo;
for i = 1:EndoSize
forecasts.cond.Mean.(M_.endo_names{oo_.dr.order_var(i)}) = mFORCS1(i,:)';
tmp = sort(squeeze(FORCS1(i,:,:))');
if size(FORCS1,2)>1
tmp = sort(squeeze(FORCS1(i,:,:))');
else
tmp = sort(squeeze(FORCS1(i,:,:)));
end
forecasts.cond.ci.(M_.endo_names{oo_.dr.order_var(i)}) = [tmp(t1,:)' ,tmp(t2,:)' ]';
end
for i = 1:n1
forecasts.controlled_exo_variables.Mean.(options_cond_fcst.controlled_varexo{i}) = mFORCS1_shocks(i,:)';
tmp = sort(squeeze(FORCS1_shocks(i,:,:))');
if size(FORCS1_shocks,2)>1
tmp = sort(squeeze(FORCS1_shocks(i,:,:))');
else
tmp = sort(squeeze(FORCS1_shocks(i,:,:)));
end
forecasts.controlled_exo_variables.ci.(options_cond_fcst.controlled_varexo{i}) = [tmp(t1,:)' ,tmp(t2,:)' ]';
end
......@@ -290,7 +298,11 @@ mFORCS2 = mean(FORCS2,3);
for i = 1:EndoSize
forecasts.uncond.Mean.(M_.endo_names{oo_.dr.order_var(i)})= mFORCS2(i,:)';
tmp = sort(squeeze(FORCS2(i,:,:))');
if size(FORCS2,2)>1
tmp = sort(squeeze(FORCS2(i,:,:))');
else
tmp = sort(squeeze(FORCS2(i,:,:)));
end
forecasts.uncond.ci.(M_.endo_names{oo_.dr.order_var(i)}) = [tmp(t1,:)' ,tmp(t2,:)' ]';
end
forecasts.graph.title = graph_title;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment