# Replicate James Hamilton's analysis of the relationship
# between the US and Italian price levels and the Dollar
# to Lira exchange rate ("Time Series Analysis", Princeton
# 1994, ch. 20)
open hamilton.gdt
# log of US price level
genr p = 100*(log(PZUNEW)-log(PZUNEW[1973:01]))
# log of exchange rate
genr s = -100*(log(EXRITL)-log(EXRITL[1973:01]))
# log of Italian price level
genr pf = 100*(log(PC6IT)-log(PC6IT[1973:01]))
# Set the sample period used by Hamilton
smpl 1974:2 ;
# Determine cointegration rank
coint2 12 p s pf
# Estimate VECM: lag order 12, cointegration rank 1
Hamilton <- vecm 12 1 p s pf
# First test: Is the middle coefficient zero? (That is,
# the cointegrating vector, "beta", involves only the two
# price levels.)
restrict Hamilton
b[2] = 0
end restrict --verbose
# Second test: The real exchange rate is stationary, or beta
# is proportional to (1, -1, -1)'
restrict Hamilton
b[1] + b[2] = 0
b[1] + b[3] = 0
end restrict --verbose