# Example 12.8, Heteroskedasticity and the 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"
tsdata=ts(data,start=1,frequency=1)
model1=lm(return.t~return.t_1,data=tsdata)
dig1=c(3,3,4)
# Recap the model
cat("This example uses the NYSE data set that was used in Example 11.4. In the previous example we estimated the model: return.t = beta0 + beta1 * return.t_1 + u.t. The t statistic for beta1hat was ",
printt(model1,2,dig1[2]), ", which was not strong evidence against the EMH. However, the EMH says nothing about the conditional variance of the returns over time. Thus, we now use the Breusch-Pagan test to test for heteroskedasticity, regressing squared residuals on the independent variable",
sep="")
# Test for HC
data[c(3:nrow(data)),"uhatsq.t"]=(model1$residuals)^2
tsdata=ts(data,start=1,frequency=1)
model2=lm(uhatsq.t~return.t_1,data=tsdata)
dig2=c(2,3,3)
{
cat("The estimation result is")
reportreg(model2,dig2,suffix=".hat")
}
# Interpretation
cat("The t statistic on return.t_1 is ", printt(model2,2,dig2[2],tdig=1), ", which is strong evidence of heteroskedasticity. The coefficient implies that volatility in stock returns is lower when the previous return was high, and vice versa. Empirical financial studies suggest that it is indeed the case that the expected value of stock returns does not depend on past returns, but the variance of returns does",
sep="")