fig51 <- function(post=F) { if(post) {#ps.options (colors=ps.colors.rgb[c("blue", "magenta", "cyan", #"green", "MediumBlue", "red", "black", "yellow", "blue"),]) postscript("Fig51.ps", width=4.4, height=2.5, horizontal=F, pointsize=8) } else {if(dev.cur()==1) par(ask=T)} par(mfrow = c(1,2), mar=c(5,5,3,1)+0.1) par(mex=0.5,csi=0.11) mreturn <- c(5, 20, 50)/100 #excessive return vol <- c(12, 40, 110)/100 #volatility corr <- matrix(c(1, 0.7, 0.4, 0.7, 1, 0.5, 0.4, 0.5, 1),byrow=T, ncol=3) #correlation cova <- diag(vol) %*% corr %*% diag(vol) #covariance matrix alpha <- solve(cova, mreturn) #optional portifolio allocation P <- sum(mreturn*alpha) #Sharpe ratio sigma <- seq(0,5, 0.01) mu <- 1.05 + sqrt(P)*sigma plot(sigma^2, mu, xlab="variance", ylab="mean", type="l", ylim=c(0,4)) title("Mean-variance efficient frontier", "(a)") plot(sigma, mu, xlab="SD", ylab="mean", type="l", ylim=c(0,4)) title("Mean-SD efficient frontier", "(b)") if(post) dev.off() }