This project is read-only.

e/e swap versus conditioning

Topics: Models
Jul 13, 2015 at 3:31 PM
Hello everyone,

I have a question regarding the functioning of conditional forecasts with unanticipated shocks. What is the difference between simulating a future shock (t+2) with a desired impact using endogeneity / exogeneity swap and conditioning using only the same shock ? I was under the impression the two simulations should give identical results, but when I use condition I get non-zero shocks before the period where I want the fix the variable.

I copied below the file I used, a modified version of the simulate_complex_shocks code from the SPBC tutorial (I used the 20150611 release with Matlab 2014a) .


Many anticipated thanks,
Cristian


%% More Complex Simulation Experiments
% by Jaromir Benes
%
% Simulate the differences between anticipated and unanticipated future
% shocks, run experiments with temporarily exogenised variables, and show
% how easy it is to examine simulations with mutliple different
% parameterisations.
%% Clear Workspace
%
% Clear workspace, close all graphics figures, clear command window, and
% check the IRIS version.
clear;close all;clc;
irisrequired 20140315;
%% Load Solved Model Object
load read_model.mat m;

%% Define Dates and Ranges
startDate = 1;
endDate = 40;
plotRng = startDate-1 : startDate+19;

plotList = { ...
' "Inflation, Q/Q PA [Pp Dev]" dP^4 ', ...
' "Policy rate, PA [Pp Dev]" R^4 ', ...
' "Output [Pct Level Dev]" Y ', ...
' "Hours Worked [Pct Level Dev]" N ', ...
' "Real Wage [Pct Level Dev]" W/P ', ...
' "Capital Price [Pct Level Dev]" Pk', ...
};
%% e/e swap versus conditioning
% 1. e/e swap
d = zerodb(m,startDate-3:startDate);
d.Y(startDate+2) = 1.01;

p = plan(m,startDate:endDate);
p = exogenise(p,'Y',startDate+2);
p = endogenise(p,'Ey',startDate+2);
s = simulate(m,d,startDate:endDate,'deviation=',true,'plan=',p,'anticipate',false);
s = dbextend(d,s);

% 2. conditioning
d = zerodb(m,startDate-3:startDate);
d.Y(startDate+2) = 1.01;

p = plan(m,startDate:endDate);
p=condition(p, 'Y',startDate+2);
% p = exogenise(p,'Y',startDate+2);
% p = endogenise(p,'Ey',startDate+2);
list_shocks=union(get(m,'exlist'),get(m,'eylist'));
list_shocks=setdiff(list_shocks,'Ey');

for i=1:length(list_shocks)
m.(['std_',list_shocks{i}])=0;
end

s_ = jforecast(m,d,startDate:endDate,'deviation=',true,'plan=',p,'anticipate',false);
s_ = dbextend(d,s_.mean);

% 3. compare
s__=s&s_;
dbplot(s__,plotRng,plotList,'tight=',true,'transform=',@(x) 100*(x-1));
grfun.ftitle('Consumption Demand Shock with Exact Impact');
legend('e/e swap','conditioning')

[(s__.Ey{1:10}) (s__.Ep{1:10}) (s__.Ea{1:10}) (s__.Er{1:10}) (s__.Ew{1:10})]