Chapter 2
Chapter 2
data = read.csv("MCD_PriceDaily.csv")
head(data)
adjPrice = data[,7]
logReturn = diff(log(adjPrice))
n = length(adjPrice)
return = adjPrice[-1]/adjPrice[-n] - 1
plot(return,logReturn,ylab = "log return")
abline(a = 0,b = 1,col = "red",lwd = 2)
We see that the return and log return for any day are almost equal. This is
reasonable in light of the discussion in Section 2.1.3, especially Figure 2.1.
●
0.04
●
●
●●
●
●●
0.02
●●●
●
●
●●●
●
●
●
●
●●
●
●●●
●
●●
●
●●
●
●●
●
●●
●
●●
●
●●
●
●
log return
●
●
●
●●
●
●
●
●
●●
●
●
●
●
●●
●
●
●●
●
●●
0.00
●
●●
●
●
●●
●
●●
●
●●
●
●●
●
●
●●
●
●●
●
●
●●
●
●
●
●
●●
●
●
●
●
●●
●
●
●
●
●●
●
●●
●
●●
●
●
●●
●●
●
●●
●
●●
●
●●
●
●
●
●●
●
−0.02
●
●●
●
●
●
●
●
●●●●
●
●
●●
●
●●
●
●
●
●●
●
−0.04
●
●
●
return
Problem 13. The R output is below. We see that the means of the returns and log returns
are somewhat similar and the standard deviations of the returns and log returns
agree to three significant digits. (sd(return) = 0.00890 but R did not print
the final zero.)
> options(digits = 4)
> mean(return)
[1] 0.0005027
> mean(logReturn)
[1] 0.0004631
1
> sd(return)
[1] 0.0089
> sd(logReturn)
[1] 0.008901
Problem 14. It is crucial to use a paired t-test because the return and log return on any given
day are highly correlated and the independent samples t-test assumes that they
are independent. The paired t-test has a p-value of 2.2 × 10−16 . Therefore,
using any reasonable significance level including, of course, 5%, we reject the
null hypothesis that the mean of the returns and mean of the log returns are
equal.
Paired t-test
Let dt be the difference between the return and log return on day t. The
assumptions of the paired t-test are that d1 , . . . , dn are independent, that they
are normally distributed, and that they have a constant variance. Here n is the
sample size.
2
The normality assumption is unlikely to hold, but it is not crucial since, by the
central limit theorem, the mean of d1 , . . . , dn will be approximately normal and
that is enough for the t-test to be valid.
The assumption of a constant variance is likely to be met, although it is not
crucial since the t-test is robust to this assumption.
The independence assumption is unlikely to be met, since we might expect
some serial correlation and volatility clustering is likely. However, the serial
correlation should be small and the t-test is not much affected by volatility
clustering.
In summary, the assumptions of the t-test are unlikely to hold exactly, but the
conclusion of the t-test should be valid, nonetheless.
Problem 16. The R output is below. The expect value of the bet is slightly positive, with a
95% confidence equal to (0.05583, 0.06517), so you should be willing to make
this bet.
3
(c) r2 (1) = r2 and r2 (2) = r2 + r1 . Therefore, cov(r2 (1), r2 (2)) = var(r2 ) = 0.47.
(d) rt (3) = rt + rt−1 + rt−2 . Therefore, given rt−2 = 0.6, rt (3) is N 0.6 +
(2)(0.06), (2)(0.47) .
Exercise 8. (a) P (X2 > 1.3X0 ) = P (r1 + r2 > log(1.3)) and r1 + r2 is N (2µ, 2σ 2 ). This
probability can be found using R:
pnorm(log(1.3),mean = 2*mu,sd = sqrt(2)*sigma,lower.tail = FALSE)
Exercise 9. (a) P (X3 > 1.2X0 ) = P (log(X3 /X0 ) > log(1.2)) = pnorm(log(1.2),mean =
0.1 * 3,sd = sqrt(3) * 0.2,lower.tail = FALSE) = 0.633.
> t = 1:100
> prob = pnorm(log(2),mean = t * 0.1, sd = sqrt(t) * 0.2,
lower.tail = FALSE)
> min(which(prob > 0.9))
[1] 18