inst/BookEx/C13R8.R

## Plotting of densities
CopPriorSim <- sampleFrom(CopPost@marketDist, NumSim)
CopPostSim <- CopPost@posteriorSims
oldpar <- par(no.readonly = TRUE)
par(mfrow = c(2, 2))
for(i in 1:NAssets){
  plot(density(CopPostSim[, i]), main = ANames[i],
       ylab = "density", ylim = c(0, 0.12), xlab = "")
  lines(density(CopPriorSim[, i]), col = "grey", lty = 2)
  abline(v = mean(CopPostSim[, i]))
  abline(v = mean(CopPriorSim[, i]), col = "grey", lty = 2)
  legend("topleft", legend = c("Posterior", "Prior"), 
        lty = c(1, 2), col = c("black", "grey"), bty = "n") 
}
par(oldpar)

Try the FRAPO package in your browser

Any scripts or data that you put into this service are public.

FRAPO documentation built on May 2, 2019, 6:33 a.m.