Hypothesis Testing in the
CER Model
Econ 424/Amath 462
Eric Zivot
Summer 2013
Updated: July 23, 2013

© Eric Zivot 2006

Chi-Square Distribution© Eric Zivot 2006

Data for Examples-0.2
0.0-0.05 00.00 0.05 0.10
-0.4
-0.15

sp500

-0.2

msft

0.2
0-0.4

sbux
s

0.0

0.2

returns.z

1993

1994

1995

1996

1997

Index

© Eric Zivot 2006

1998

1999

2000

T = 100 months

H0:  = 0 vs. H1:  ≠ 0# construct test by brute force> nobs = nrow(returns.z)> muhat.vals
h tl = apply(returns.z,2,mean)l ( t2)> muhat.vals
sbux
msft
sp500
0.02777 0.02756 0.01253> sigmahat.vals = apply(returns.z,2,sd)> se.muhat = sigmahat.vals/sqrt(nobs)> se.muhat
sbux
sbu
msft
s t
sp500
0.01359 0.01068 0.003785> t.stats = muhat.vals/se.muhat> abs(tabs(t.stats)stats)|t t t | > 2 => we should|t-stats|
h ld
sbux msft sp500
reject H0:  = 0
2.044 2.58 3.312 © Eric Zivot 2006

H0:  = 0 vs. H1:  ≠ 0# compute 2-sided 5% critical values> cv.2sided = qqt(0.975, df=nobs-1)> cv.2sided[1] 1.984> abs(tabs(t.stats)stats) > cv
cv.2sided
2sidedsbux msft sp500
TTT# compute 2-sided p-values> 2*(1-pt(abs(t.stats),df=nobs-1))
sbux
msft
sp500
0.04363 0.01134 0.001295© Eric Zivot 2006

R t.test() function# TTestt H0
H0: mu = 0 ffor msft
ft
> t.test.msft = t.test(returns.z[,"msft"],+alternative="two.sided",+mu=0mu=0, conf.level=0.95)
conf level=0 95)> class(t.test.msft)[1] "htest"> t.test.msft
t test msft
One Sample t-test
data: returns.z[, "msft"]t = 2.580,2 580, df = 99, p-value
p value = 0.01134
0 01134
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
0.006368 0.048760
 = 0 does not lie in 95% CI so we
sample estimates:
reject H0 =0 at 5% levelmean of x0.02756© Eric Zivot 2006

Test for Normal Distribution-0.4-0.20.0-0.4 -0.2 0.0
0 0.2

cc returnn2.0
1.00.0cc returnn3.0

Starbucks monthly cc returns

0.2

returns.z[, "sbux"]

Sample Quantiles

32density esstimate

10-0.60 6-0.4
0 4-0.20 2

0 0
0.00 2
0.2

0 4
0.4

cc return-0.4 -0.2 0.0 0.2

Normal Q-Q Plot

4

Smoothed density

2-2-1
101

Theoretical Quantiles© Eric Zivot 2006

2Jarque-Bera Test for Normality> sbux.skew = skewness(returns.z[,"sbux"])> sbux.ekurt= kurtosis(returns.z[,"sbux"])> sbux.skew
bk[1] -0.8272737> sbux.ekurt[1] 1.761706> JB = nobs*(sbux.skew^2 + 0.25*sbux.ekurt^2)/6> JB
JB = 24.34 > 6 so we reject H0:[1] 24.33806
returns on sbux are normally
distributed at the 5% level> p.value = 1 - pchisq(JB, df = 2)
> p.value[1] 55.188691e-06
188691e 06© Eric Zivot 2006

tseries function jarque.bera.test()
j q()> library(tseries)> jarque.bera.test(returns.z[,"sbux"])
Jarque Bera Test
data: returns.z[,[, "sbux"]]
X-squared = 24.34, df = 2, p-value = 5.189e-06

JB statistic© Eric Zivot 2006

Testing for Serial Correlation

0.0



-0.2

-0.1

ACF

0.1

0.2

Series returns.z[, "sbux"]

0.5

1.0
Lag

> acf(returns.ts[,”sbux”]© Eric Zivot 2006

1.52T

ComputepRollingg Means using
g zoo function rollapply()pp y()# 24-month rolling means incremented by 1 month> roll.muhat = rollapply(returns.z[,"sbux"], width=24,+
FUN=mean, align="right")> class(roll.muhat)[1] "zoo"> roll.muhat[1:5]
Jun 1994 Jul 1994 Aug 1994 Sep 1994 Oct 1994
0.03415 0.03244 0.03418 0.01758 0.02538© Eric Zivot 2006

-0.4
4

-0
0.2

returns

0.00.2

24 month rolling means for SBUX

Rolling mean
Monthly returns
1994

1996
Index
© Eric Zivot 2006

1998

2000

-0.05
-0.10
-0.1
15

returnns0.00

0.05

0.10
0

24 month rolling means for SP500

Rollingg mean
Monthly returns
1994

1996
Index
© Eric Zivot 2006

1998

2000

Compute Rolling SDs Using zoo Function rollapply()# 24-month rolling SD incremented by 1 month> roll.sigmahat = rollapply(returns.z[,"sbux"], width=24,+
FUN=sd, align="right")> class(roll.sigmahat)[1] "zooreg" "zoo"> roll.sigmahat[1:5]
Jun 1994 Jul 1994 Aug 1994 Sep 1994 Oct 1994
0.11010.10800.10670.11140.1148© Eric Zivot 2006

-0.4

-0.2

Returnns

0.00.2

24 month rolling SDs for SBUX

Rollingg SD
Monthly returns19941996Index© Eric Zivot 2006

19982000

0.00
-0.05
-0.10
-0.1
15Returnns0.05

0.10

24 month rolling SDs for SP500

Rolling SD
Monthly returns1994

1996
Index

© Eric Zivot 2006

1998

2000

Compute Rolling Correlations Using zoo Function
rollapply()# compute 24-month rolling correlations between# sp500 and sbux
# function to compute pairwise correlationrhohat = function(x) {co ( )[ , ]cor(x)[1,2]}> roll.rhohat = rollapply(returns.z[,c("sp500","sbux")],+width=24,FUN=rhohat,+by.column=FALSE, align="right")> class(roll.rhohat)[1] "zoo"> roll.rhohat[1:5]
Jun 1994 Jul 1994 Aug 1994 Sep 1994 Oct 1994
0.47860.45700.36940.45150.4683© Eric Zivot 2006

0.4
0.2
0.0

rhohat

0.6

0.8

1.0

24 month rolling correlations b/w sbux and sp500

1995

1996

1997

1998
Index

© Eric Zivot 2006

1999

2000

2001

Summary of Hypothesis Testing in CER
modeld l• Hypothesis tests about μ are not very powerfulbecause SE( ) is typically very large• Can often rejectjhypothesisypthat monthly
y returns
are normally distributionyp
y cannot rejectjhypothesisypthat monthlyy• Typically
returns are uncorrelated over time
• Rolling window estimates indicate that ,  andij are typically not constant over time
– Assumption of covariance stationarity is suspect!
© Eric Zivot 2006