Professional Documents
Culture Documents
Problem Set 5
Question 3
(a)
Table 1 General Summary
X
MEAN
S.D.
Cor
(b)
Y
0.0090
0.0032
0.8171
0.0750
0.0195
12300
12835
14277
17978
18056
Mean
for X
0.009
0.009
0.009
0.009
0.009
S.D. for X
Mean for Y
S.D. for Y
Correlation of
X and Y
0.816420516
0.820226175
0.816286739
0.816236506
0.816521437
(c)
The statistic in X is constant across SecIDs, while means and
standard deviation for Y change a little. Therefore, the correlation of X
and Y changes from ID to ID.
Question 4
Line Fit Plot for ID=18056
f(x) = 4.82x + 0.03
R = 0.71
0.08
0.06
0.04
0.02
0
0
0.01
0.01
0.01
0.01
0.01
0.02
0.01
0.01
0.01
0.01
0.01
0.02
0.01
0.01
0.01
0.01
0.01
0.02
The regressions are at the similar level, saying that they are almost
equally good. However, from the R-squares, we can tell that the
regression for ID=18056 is a bit higher than others (0.71comepared with
0.6+).
Question 5
(a)
Table 3 Summary of Each period for Log Return
Ann_mean
Ann_SD
SE
S&P(1-3y)
-0.107843508
0.2614536 0.0826789
8
1
AGG(1-3y)
0.011753093
0.0777226 0.0245780
1
5
S&P(4-6y)
0.110320351
0.2317836 0.0732964
8
3
AGG(4-6y)
0.018812795
0.0478017 0.01511623
S&P(all)
0.04931047
0.2078197 0.0657183
2
7
AGG
0.007117097
0.0541826 0.0171340
2
5
(b)
According to the plots above, neither SPX nor AGG is stationary. From
the charts we observed that both of them have ACF outside white noise
the blue barat lag 1. Therefore, both of them are not stationary.
Shown in the Q-Q Plot, both sets deviate from the theoretical line at the
end, even though they are approximately normal distributed in the
middle. Therefore, they may have a fat tail, making them deviate from the
normal distribution.
(c)
It is
P=n [ 1N (2.4929504 ) ]=0.06334325
Z=
(c)
(d)
SD
46.30605
(e) Both the mean and the standard deviation changed quite a bit after
excluding this data point. However, its hard to say whether or not should
we exclude it. Since Chauvenets criterion requires a normal distribution,
such a small sample can hardly satisfy this condition. We may need more
data points or further information about the cause of this extreme point
before reaching to any further conclusions.
(f) Different from previous case, its reasonable to apply Chauvenets
criterion to SPX and AGG daily log return. Since the log return obey
normal distribution and both data set have relatively large samples. The
data satisfy the assumptions of Chauvenets criterion. However, we may
also need to think twice before adopting this criterion. As financial crisis
exerts a relatively long-term effects on overall market, its hard to decide
the exact set of data points to exclude.
par(mfrow=c(1,2))
qqnorm(data2[,"SPX_Log"],cex=0.1);qqline(data2[,"SPX_Log"], col = 2)
qqnorm(data2[,"AGG_Log"],cex=0.1);qqline(data2[,"AGG_Log"], col =
2)
##### Question (c)
simplereturn=data.frame(matrix(rep(0,nrow(data2)*5),ncol=5))
colnames(simplereturn)=paste(ticker,"Simple",sep = "_")
data2=cbind.data.frame(data2,simplereturn)
for (i in 1:5){
data2[,(i+11)]=c(exp(data2[,(i+6)])-1)
}
period1=data2[1:756,];period2=data2[757:1512,]
Annual_stats_simple=matrix(rep(0,18),ncol=3,
dimnames = list(c("S&P 1-3y","AGG 1-3y","S&P 4-6y","AGG
4-6y","S&P
all","AGG
all"),
c("Annual_mean","Annual_SD","SE")))
s=rep(list(period1,period2,data2),each=2);t=rep(c("SPX_Simple","AGG_
Simple"),3);m=rep(c(3,3,10),each=2)
for (i in 1:6){
Annual_stats_simple[i,1]=Annual_mean(s[[i]],t[i],m[i])
Annual_stats_simple[i,2]=Annual_sd(s[[i]],t[i])
Annual_stats_simple[i,3]=Annual_sd(s[[i]],t[i])/sqrt(10)
}
Annual_stats_simple
##### Question (d)
beta=matrix(rep(0,6),ncol=2,
dimnames = list(c("CAT&SPX 1-3y","CAT&SPX 46y","CAT&SPX all"),
c("Correlation","Beta")))
beta[1,1]=cor(period1$CAT,period1$SPX);beta[2,1]=cor(period2$CAT,p
eriod2$SPX);beta[3,1]=cor(data2$CAT,data2$SPX)
beta[1,2]=beta[1,1]*sd(period1$CAT)/sd(period1$SPX);beta[2,2]=beta[2,
1]*sd(period2$CAT)/sd(period2$SPX);beta[3,2]=beta[3,1]*sd(data2$CA
T)/sd(data2$SPX)
beta