# Example 11.4, Efficient Markets Hypothesis
# Data set: nyse
# Function for result reporting
source("_report.R")
# Load the data and estimate the model in the background
load("nyse.Rdata")
names(data)[names(data)=="return"]="return.t"
names(data)[names(data)=="return_1"]="return.t_1"
data=ts(data,start=1,frequency=1)
model=lm(return.t~return.t_1,data=data)
dig=c(3,3,4)
# Describe the model
cat("The data set contains weekly returns of New York Stock Exchange over about 13 years, with the maximum being ",
round(max(data[-1,"return.t"]),2), "% and the minimum ", round(min(data[-1,"return.t"]),2),
"%. We want to test the efficient markets hypothesis (EMH), which states that that information observable to the market prior to week t should not help to predict the return during week t. To test this hypothesis, we estimate an AR(1) model:",
"\nreturn.t = beta0 + beta1 * return.t_1 + u.t",
"\nwhere return is ", paste(desc[desc[,1]=="return",2]),
"\nFor this model, the EMH can be stated as H0: beta1 = 0. We assume the homoskedasticity assumption to be true for now. Under the H0, returns are serially uncorrelated, so we can safely assume that they are weakly dependent",
sep="")
# Report results
{
cat("The estimated regression line is")
reportreg(model,dig,suffix=".hat",adj=T)
}
# Interpretation
cat("The t statistic for beta1hat is ", printt(model,2,dig[2]), ", so we cannot reject H0 at the 10% level. That is, while there appears to be a slight positive correlation in the NYSE return from one week to the next, it is not strong enough to warrant rejection of the EMH",
sep="")