15.S24 Fundamentals of Financial Mathematics Problem Set 5 Shihui Chen ID: 913599770
15.S24 Fundamentals of Financial Mathematics Problem Set 5 Shihui Chen ID: 913599770
(b)
0.0090
0.0032
0.8171
0.0750
0.0195
(c)
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
Question 4
Line Fit Plot for ID=18056
0.14
y = 4.8222x + 0.0334
R = 0.71015
0.12
0.1
0.08
0.06
0.04
0.02
0
0
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
0.018
0.02
y = 5.1151x + 0.0278
R = 0.69788
0.1
0.08
0.06
0.04
0.02
0
-0.002
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
0.14
0.12
0.1
0.08
0.06
0.04
0.02
0
-0.002
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
y = 5.371x + 0.0257
R = 0.67875
0.12
0.1
0.08
0.06
0.04
0.02
0
-0.002
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
y = 5.0864x + 0.029
R = 0.63534
0.1
0.08
0.06
0.04
0.02
0
-0.002
0.002
0.004
0.006
0.008
0.01
0.012
0.014
0.016
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)
Ann_SD
SE
S&P(1-3y)
-0.107843508
0.26145368 0.08267891
AGG(1-3y)
0.011753093
0.07772261 0.02457805
S&P(4-6y)
0.110320351
0.23178368 0.07329643
AGG(4-6y)
0.018812795
0.0478017
S&P(all)
0.04931047
0.20781972 0.06571837
AGG
0.007117097
0.05418262 0.01713405
0.01511623
(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 noisethe
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)
Ann_SD
SE
S&P(1-3y)
-0.07378823
0.26101453 0.08254004
AGG(1-3y)
0.01474989
0.07712365 0.02438864
S&P(4-6y)
0.13715499
0.23156839 0.07322836
AGG(4-6y)
0.01995444
0.04779746 0.01511488
S&P(all)
0.07085327
0.20755159 0.06563357
AGG(all)
0.00857789
0.05392073 0.01705123
The means of Annual Simple Returns are a bit lower than those of Annual
Log Returns, given the Tylor Extension shown on class. However, the
standard deviations of two return calculations are about the same.
(d)
Beta
CAT&SPX(1-3y)
0.7711057
0.05179002
CAT&SPX(4-6y)
0.955098
0.15264288
CAT&SPX all
0.5824057
0.03269968
Question 6
(a)
(b)
SD
90.49518
(c)
Mean
-216-9.6
=)
-2.4929504
away
from
the
mean.
90.49518
P = n 1 N 2.4929504
(d)
(e)
= 0.06334325
34.66667
SD
46.30605
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.
Appendix I
Coding for R
##### Question5
c("Annual_mean","Annual_SD","SE")))
Annual_mean=function(df,stock,years)
sum(df[,stock],na.rm
sd(df[,stock],na.rm
TRUE)/years
Annual_sd=function(df,stock,years)
TRUE)*sqrt(252)
s=rep(list(period1,period2,data2),each=2);t=rep(c("SPX_Log","AGG_Lo
g"),3);m=rep(c(3,3,10),each=2)
for (i in 1:6){
Annual_stats[i,1]=Annual_mean(s[[i]],t[i],m[i])
Annual_stats[i,2]=Annual_sd(s[[i]],t[i])
Annual_stats[i,3]=Annual_sd(s[[i]],t[i])/sqrt(10)
}
Annual_stats
#####Qustion (b)
par(mfrow=c(1,2))
acf(diff(data2[,"SPX_Log"]), lag.max = 40, type = "correlation", plot = T,
main = "SPX Correlogram", na.action = na.pass)
acf(diff(data2[,"AGG_Log"]), lag.max = 40, type = "correlation", plot = T,
main = "AGG Correlogram", na.action = na.pass)
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)
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