0% found this document useful (0 votes)
52 views

15.S24 Fundamentals of Financial Mathematics Problem Set 5 Shihui Chen ID: 913599770

The document contains statistical analysis of financial data. Tables 1-7 provide summary statistics for different datasets and time periods, including means, standard deviations, and correlations. Line plots show linear regressions fitted to different dataset IDs. The analysis examines whether variables are stationary and normally distributed.

Uploaded by

shihui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

15.S24 Fundamentals of Financial Mathematics Problem Set 5 Shihui Chen ID: 913599770

The document contains statistical analysis of financial data. Tables 1-7 provide summary statistics for different datasets and time periods, including means, standard deviations, and correlations. Line plots show linear regressions fitted to different dataset IDs. The analysis examines whether variables are stationary and normally distributed.

Uploaded by

shihui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

15.

S24 Fundamentals of Financial Mathematics


Problem Set 5
Shihui Chen
ID: 913599770
Question 3
(a)

Table 1 General Summary


X
MEAN
S.D.
Cor

(b)

0.0090
0.0032
0.8171

0.0750
0.0195

Table 2 Summary for Each ID


ID
12300
12835
14277
17978
18056

(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

0.003316625 0.075009091 0.020315681


0.003316625
0.075 0.020232449
0.003316625
0.075 0.020304236
0.003316625 0.075009091 0.020316567
0.003316625 0.075009091 0.020305785

Correlation of
X and Y
0.816420516
0.820226175
0.816286739
0.816236506
0.816521437

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
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

Line Fit Plot for ID=17978


0.12

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

Line Fit Plot for ID=14277


y = 5.1063x + 0.0288
R = 0.6377

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

Line Fit Plot for ID=12835


0.14

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

Line Fit Plot for ID=12300


0.12

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)

Table 3 Summary of Each period for Log Return


Ann_mean

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)

Table 4 Summary for Each Period of Simple Return


Ann_mean

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)

Table 5 Correlation and Beta for each Period


Correlation

Beta

CAT&SPX(1-3y)

0.7711057

0.05179002

CAT&SPX(4-6y)

0.955098

0.15264288

CAT&SPX all

0.5824057

0.03269968

Personally speaking, I do not think the correlation or beta is stationary.


Though, for most of the case, a portfolio beta is going to be stationary as it
stays at the same level through a long period of time. However, in our case,
the market has experienced huge financial crisis in 2008, making the beta
of portfolio changed a lot. Therefore, its reasonable to say that the beta
and correlation are nor stationary.

Question 6
(a)

(b)

Table 6 Data Summary


9.6

SD

90.49518

-216 is likely to be an outlier.


It is (Z=

(c)

Mean

-216-9.6
=) -2.4929504 away from the mean.
90.49518

P = n 1 N 2.4929504

(d)

(e)

= 0.06334325

Table 7 New Data Summary


Mean

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

##### Question (a)


setwd("/Users/Sophie/Dropbox/MIT/Summer 2016/Math/HW/HW5")
data2=read.table("PS5-data2.txt",header=TRUE)
ticker=colnames(data2)[-1]
logreturn=data.frame(matrix(rep(0,nrow(data2)*5),ncol=5))
colnames(logreturn)=paste(ticker,"Log",sep = "_")
data2=cbind.data.frame(data2,logreturn)
for (i in 1:5){
data2[,(i+6)]=c(NA,diff(log(data2[,(i+1)])))
}
period1=data2[1:756,];period2=data2[757:1512,]
Annual_stats=matrix(rep(0,18),ncol=3,
dimnames = list(c("S&P 1-3y","AGG 1-3y","S&P 46y","AGG 4-6y","S&P all","AGG all"),

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)

##### 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 46y","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$C
AT)/sd(data2$SPX)
beta

You might also like