% FAKE_GR   Determines if Gali-Rabanal can uncover the theoretical 
%           impulse response working with data in fakedat.dat.
%           Edit this code to change options.
%

%           Ellen McGrattan, 3-13-04
%           Revised, ERM, 6-16-04

%
% User Options:
%   nt     = number of quarters of response to compute
%
%   p      = number of lags in VAR
%
%   alpha in [0,1] with 0 implying hours in levels, 
%                       1 implying hours differenced
%                      <1 implying quasi-differenced
%
%
nt    = 101;
p     = 4;
alpha = 1;

%
% Load data on hours and output
%
load fakedat.dat
prd  = fakedat(:,1);
hpc  = fakedat(:,2);

%
% Construct the inputs to Blanchard-Quah
%
nobs   = length(hpc);
x      = log(prd);
n      = log(hpc);
x      = x-x(1);
n      = n-n(1);
dx     = x(2:nobs)-x(1:nobs-1);
dn     = n(2:nobs)-alpha*n(1:nobs-1); 
x      = [dx,dn];

%
% Call Blanchard-Quah routine 
%
[X1,X2] = bquah(x,p,nt);

