% figure7b.m

% Ron Alquist

% Bank of Canada

% January 2009


% This program returns Figure 7b of Alquist and Kilian's "What Do We Learn From the Price of

% Crude Oil Futures?"

clear all;

load impvol1m.txt;

load pd.txt;

b = find(impvol1m(:,1)==1989 & impvol1m(:,2)==1);

e = find(impvol1m(:,1)==2006 & impvol1m(:,2)==12);

ivmat = impvol1m(b:e,:);

iv1mdm = ivmat(:,3) - mean(ivmat(:,3));

pddm = pd(:,3) - mean(pd(:,3));

time = [1989 + 1/12 : 1/12 : 2007]';

plot(time,pddm,'k',time,iv1mdm,'b--','LineWidth',3),legend('VAR-Based Precautionary Demand Component of Spot Price', '1-Month Ahead Implied Volatility'),axis([1989 2007 -100 100]);