"P.corshrreal" <- function (filename="corshrreal.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(corshrreal, type="b", axes=FALSE, xlab="", ylim=range(corshrreal.95ci), ylab="Correlation: shrink with realized") axis(2) axis(1, at=1:8, label=paste(rep(c("07", "08"), each=4), "Q", 1:4, sep="")) lines(corshrreal.95ci[,1], lty=2, col="red") lines(corshrreal.95ci[,2], lty=2, col="red") box() if(length(filename)) dev.off() } "P.corshrreal12020ls" <- function (filename="corshrreal12020ls.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(corshrreal12020ls, type="b", axes=FALSE, xlab="", ylab="Correlation: shrink with realized") axis(2) axis(1, at=1:8, label=paste(rep(c("07", "08"), each=4), "Q", 1:4, sep="")) abline(h=c(-.062, .062), lty=2, col="green") box() if(length(filename)) dev.off() } "P.corshrrealdn" <- function (filename="corshrrealdn.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(corshrrealdn30, type="b", axes=FALSE, xlab="", ylab="Correlation: shrink with realized") axis(2) axis(1, at=1:8, label=paste(rep(c("07", "08"), each=4), "Q", 1:4, sep="")) abline(h=c(-.062, .062), lty=2, col="green") box() if(length(filename)) dev.off() } "P.corshrrealpng" <- function (filename="corshrreal.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(corshrreal, type="b", axes=FALSE, xlab="", ylim=range(corshrreal.95ci), ylab="Correlation: shrink with realized") axis(2) axis(1, at=1:8, label=paste(rep(c("07", "08"), each=4), "Q", 1:4, sep="")) lines(corshrreal.95ci[,1], lty=2, col="red") lines(corshrreal.95ci[,2], lty=2, col="red") box() if(length(filename)) dev.off() } "P.evst1Q" <- function (filename="evst1Q.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(ppoints(20) * 100, sort(evalst.20.w10.t200.2008$percentile[61,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evst1Qpng" <- function (filename="evst1Q.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(100 * ppoints(20), sort(evalst.20.w10.t200.2008$percentile[61,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evst2Q" <- function (filename="evst2Q.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(100 * ppoints(20), sort(evalst.20.w10.t200.2008$percentile[125,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evst2Qpng" <- function (filename="evst2Q.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(100 * ppoints(20), sort(evalst.20.w10.t200.2008$percentile[125,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evst4Q" <- function (filename="evst4Q.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(100 * ppoints(20), sort(evalst.20.w10.t200.2008$percentile[253,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evst4Qpng" <- function (filename="evst4Q.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(100 * ppoints(20), sort(evalst.20.w10.t200.2008$percentile[253,]), ylim=c(0,100), xlab="Theoretical quantiles", ylab="Percentile") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.evstRandpng" <- function (filename="evstRand.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(ppoints(20), sort(runif(20)), ylim=c(0,1), xlab="Theoretical quantiles", ylab="p-value") abline(0,1, col="blue") if(length(filename)) dev.off() } "P.facshr07Q4" <- function (filename="facshr07Q4.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(100 * sqrt(252 * rp30s15.facexante.Q[[4]]), 100 * sqrt(252 * rp30s15.shrexante.Q[[4]]), xlab="Statistical factor model", ylab="Shrink to equal correlation", main="") abline(0, 1, col="blue") if(length(filename)) dev.off() } "P.facshr08Q4" <- function (filename="facshr08Q4.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(100 * sqrt(252 * rp30s15.facexante.Q[[8]]), 100 * sqrt(252 * rp30s15.shrexante.Q[[8]]), xlab="Statistical factor model", ylab="Shrink to equal correlation", main="") abline(0, 1, col="blue") if(length(filename)) dev.off() } "P.facshr08Q4png" <- function (filename="facshr08Q4.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(100 * sqrt(252 * rp30s15.facexante.Q[[8]]), 100 * sqrt(252 * rp30s15.shrexante.Q[[8]]), xlab="Statistical factor model", ylab="Shrink to equal correlation", main="") abline(0, 1, col="blue") if(length(filename)) dev.off() } "P.matchpm.t200.07" <- function (filename="matchpm.t200.07.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } the.den <- density(100 * pp.simpret( randser.20.w10.t200$value[c(1,252),])) plot(the.den, main="", xlab="2007 return (percent)", xlim=range(the.den$x, 100 * serret200.07)) abline(v=100 * serret200.07, col="blue", lwd=2) if(length(filename)) dev.off() } "P.matchpm.t200.0708" <- function (filename="matchpm.t200.0708.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } the.den <- density(100 * pp.simpret( randser.20.w10.t200$value[c(1,504),])) plot(the.den, xlim=range(the.den$x, 100 * serret200.0708), main="", xlab="2007-2008 return (percent)") abline(v=100 * serret200.0708, col="blue", lwd=2) if(length(filename)) dev.off() } "P.matchpm.t200.07png" <- function (filename="matchpm.t200.07.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } the.den <- density(100 * pp.simpret( randser.20.w10.t200$value[c(1,252),])) plot(the.den, main="", xlab="2007 return (percent)", xlim=range(the.den$x, 100 * serret200.07)) abline(v=100 * serret200.07, col="red", lwd=5) if(length(filename)) dev.off() } "P.matchpm.t400.07" <- function (filename="matchpm.t400.07.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } the.den <- density(100 * pp.simpret( randser.20.w10.t400$value[c(1,252),])) plot(the.den, main="", xlab="2007 return (percent)", xlim=range(the.den$x, 100 * serret400.07)) abline(v=100 * serret400.07, col="green", lwd=2) if(length(filename)) dev.off() } "P.matchpm.t400.0708" <- function (filename="matchpm.t400.0708.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } the.den <- density(100 * pp.simpret( randser.20.w10.t400$value[c(1,504),])) plot(the.den, xlim=range(the.den$x, 100 * serret400.0708), main="", xlab="2007-2008 return (percent)") abline(v=100 * serret400.0708, col="green", lwd=2) if(length(filename)) dev.off() } "P.minvol" <- function (filename="minvol.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(100 * sqrt(252 * rp30w10.minvar.dat), type='l', axes=FALSE, xlab="2007 2008", ylab="Minimum volatility") # a better approach to what 'xlab' is trying to do is to use 'mtext' # but this is good enough in this case axis(2) axis(1, at=quarter.ends[1:8] - 250, labels=FALSE) axis(1, at=quarter.ends[1:7] - 250 + 30, tick=FALSE, labels=paste("Q", c(1:4, 1:3), sep="")) box() if(length(filename)) dev.off() } "P.mvu2dat" <- function (filename="mvu2dat.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(density( rp30w10.mvu2.dat * 1000), col='black', lwd=2, ylim=c(0, 0.5), main="", xlab="Mean-variance utility with risk aversion 2") lines(density( rp30w10vv20.mvu2.dat * 1000), col='blue', lwd=2) if(length(filename)) dev.off() } "P.mvu2datpng" <- function (filename="mvu2dat.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(density( rp30w10.mvu2.dat * 1000), col='white', lwd=5, ylim=c(0, 0.5), main="", xlab="Mean-variance utility with risk aversion 2") lines(density( rp30w10vv20.mvu2.dat * 1000), col='yellow', lwd=5) if(length(filename)) dev.off() } "P.mvu2smo" <- function (filename="mvu2smo.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(density( rp30w10.mvu2.smo * 1000), col='black', lwd=2, ylim=c(0, .31), main="", xlab="Mean-variance utility with risk aversion 2") lines(density(rp30w10v08.mvu2.smo * 1000), col="blue", lwd=2) if(length(filename)) dev.off() } "P.mvu2y2007" <- function (filename="mvu2y2007.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(density( rp30w10.mvu2.2007 * 1000), col='black', lwd=2, ylim=c(0, 3.2), main="", xlab="Mean-variance utility with risk aversion 2") lines(density( rp30w10v08.mvu2.2007 * 1000), col='blue', lwd=2) if(length(filename)) dev.off() } "P.simpm07" <- function (filename="simpm07.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(density(100 * rp251.20.w10.ret07), main="", xlab="2007 return (percent)") abline(v=100 * serret200.07, col="blue", lwd=2) abline(v=100 * serret400.07, col="green", lwd=2) if(length(filename)) dev.off() } "P.simpm0708" <- function (filename="simpm0708.eps") { if(length(filename)) { postscript(file=filename, height=3, width=5, horiz=FALSE) par(mar=c(5,4,0,2) + .1, cex.axis=.7, cex.lab=.7) } plot(density(100 * rp251.20.w10.ret0708), main="", xlab="2007-2008 return (percent)") abline(v=100 * serret200.0708, col="blue", lwd=2) abline(v=100 * serret400.0708, col="green", lwd=2) if(length(filename)) dev.off() } "P.simpm0708png" <- function (filename="simpm0708.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(density(100 * rp251.20.w10.ret0708), main="", xlab="2007-2008 return (percent)") abline(v=100 * serret200.0708, col="red", lwd=5) if(length(filename)) dev.off() } "P.simpm07png" <- function (filename="simpm07.png") { if(length(filename)) { png(file=filename, bg="transparent", width=650) par(col="yellow", col.axis="yellow", col.lab="yellow", cex=2, lwd=5, mar=c(5,4,0,2) + .1) } plot(density(100 * rp251.20.w10.ret07), main="", xlab="2007 return (percent)") abline(v=100 * serret200.07, col="red", lwd=5) if(length(filename)) dev.off() }