Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
206 views

Constant Correlation Model

This document describes a constant correlation model for analyzing stock return data. It calculates the correlation between stock returns, computes necessary metrics like average returns and standard deviations, and uses these values to create covariance and expected return matrices. It then calculates efficient portfolios with and without short sales allowed by solving these matrices. The document generates a plot comparing the individual stocks to the efficient portfolios.

Uploaded by

api-285777244
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
206 views

Constant Correlation Model

This document describes a constant correlation model for analyzing stock return data. It calculates the correlation between stock returns, computes necessary metrics like average returns and standard deviations, and uses these values to create covariance and expected return matrices. It then calculates efficient portfolios with and without short sales allowed by solving these matrices. The document generates a plot comparing the individual stocks to the efficient portfolios.

Uploaded by

api-285777244
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Constant Correlation Model

YIK LUN, KEI


allen29@ucla.edu
data1<-read.table("http://www.stat.ucla.edu/~nchristo/statistics_c183_c283/stocks_10.txt",header=TRUE)
rho <- (sum(cor(data1[1:(length(data1)-1)]))-(length(data1)-1))/
((length(data1)-1)*(length(data1)-2))
col<-matrix(NA,ncol=3,nrow=length(data1)-1)
mat <- matrix(rep(0,100), ncol=(length(data1)-1), nrow=(length(data1)-1))
#Compute necessary quantities:
Rbar <- colMeans(data1[1:10])
rf<- 0.0003
Rbar_f <- Rbar-rf
sigma <- apply(data1[1:10], 2, sd)
Ratio <- Rbar_f/sigma
#Initial table:
xx <- (cbind(Rbar, Rbar_f, sigma, Ratio))
#Order the table based on the excess return to sigma ratio:
aaa <- xx[order(-Ratio),]
#Create the last 3 columns of the table:
for(i in(1:10)) {
col[i,1] <- rho/(1-rho+i*rho)
col[i,2] <- sum(aaa[,4][1:i])
}
#Compute the Ci:
for(i in (1:10)) {
col[i,3] <- col[i,1]*col[i,2]
}
#Create the entire table until now:
xxx <- cbind(aaa, col)
#Var-covar matrix based on the constant correlation model:
for(i in 1:10){
for(j in 1:10){
if(i==j){mat[i,j]=aaa[i,3]^2}
else{mat[i,j]=rho*aaa[i,3]*aaa[j,3]}
}
}
#SHORT SALES ALLOWED:
znew <- solve(mat) %*% aaa[,2]
xnew <- znew/sum(znew)

#The final table:


aaaa <- cbind(xxx, znew, xnew)
#SHORT SALES NOT ALLOWED:
#Find composition of optimum portfolio when short sales are not allowed:
aaaaa <- aaaa[1:which(aaaa[,7]==max(aaaa[,7])), ]
z_no <- (1/((1-rho)*aaaaa[,3]))*(aaaaa[,4]-aaaaa[,7][nrow(aaaaa)])
x_no <- z_no/sum(z_no)
#Final table:
a_no <- cbind(aaaaa, z_no, x_no)

#Calculate the expected return and sd of the point of tangency


#when short sales allowed
sd_p_opt <- (t(xnew) %*% mat %*% xnew)^.5
R_p_opt <- t(xnew) %*% aaaa[,1]

#Calculate the expected return and sd of the point of tangency


#when short sales are not allowed
sd_p_opt_no <- (t(x_no) %*%
mat[1:which(aaaa[,7]==max(aaaa[,7])),1:which(aaaa[,7]==max(aaaa[,7]))]%*% x_no)^.5
R_p_opt_no <- t(x_no) %*% aaaaa[,1]

#Plot all the stocks and the two tangency points:


plot(aaaa[,3], aaaa[,1], ylim=c(-0.013, 0.023), xlab="Risk", ylab="Expected return")
points(sd_p_opt,R_p_opt, col="green", pch=19)
points(sd_p_opt_no,R_p_opt_no, col="blue", pch=19)

0.020
0.010

Expected return

0.000
0.010
0.08

0.10

0.12

0.14
Risk

0.16

0.18

0.20

0.22

You might also like