% figure4.m

% Ron Alquist

% Bank of Canada

% January 2009


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

% Crude Oil Futures?"

clear all;

load prices.txt;

date = prices(:,1:2);

s = prices(:,3);

f3m = prices(:,5);

f6m = prices(:,6);

f9m = prices(:,7);

f12m = prices(:,8);

sprd3m = 100*(f3m - s)./s;

sprd6m = 100*(f6m - s)./s;

sprd9m = 100*(f9m - s)./s;

sprd12m = 100*(f12m - s)./s;

sprdmat = [date sprd3m sprd6m sprd9m sprd12m];

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

e = find(sprdmat(:,1)==2007 & sprdmat(:,2)==2);

sprdmat1 = sprdmat(b:e,:);

sprd3m1 = sprdmat1(:,3);

sprd6m1 = sprdmat1(:,4);

sprd9m1 = sprdmat1(:,5);

sprd12m1 = sprdmat1(:,6);

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

plot(time,-sprd3m1,'b:',time,-sprd6m1,'g--',time,-sprd9m1,'r',time,-sprd12m1,'c-.','LineWidth',2),legend('3 Month','6 Month', '9 Month', '12 Month'),axis([1989 2007 -50 50]), ylabel('Percent')

grid on;

h1 = vline([1990+7/12 1997+6/12 2001+8/12 2003+3/12],{'k', 'k', 'k', 'k'},{'Invasion of Kuwait','Baht Devaluation', '9/11', 'Invasion of Iraq'});
