
Last chance! 50% off unlimited learning
Sale ends in
Table of specific risk, systematic risk and total risk
table.SpecificRisk(Ra, Rb, Rf = 0, digits = 4)
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
return vector of the benchmark asset
risk free rate, in same period as your returns
number of digits to round results to
Matthieu Lestel
Carl Bacon, Practical portfolio performance measurement and attribution, second edition 2008 p.76
SystematicRisk
SpecificRisk
TotalRisk
data(managers)
table.SpecificRisk(managers[,1:8], managers[,8])
# don't test on CRAN, since it requires Suggested packages
require("Hmisc")
result = t(table.SpecificRisk(managers[,1:8], managers[,8], Rf=.04/12))
textplot(format.df(result, na.blank=TRUE, numeric.dollar=FALSE, cdec=c(3,3,1)),
rmar = 0.8, cmar = 2, max.cex=.9, halign = "center", valign = "top",
row.valign="center", wrap.rownames=20, wrap.colnames=10,
col.rownames=c("red", rep("darkgray",5), rep("orange",2)), mar = c(0,0,3,0)+0.1)
title(main="Portfolio specific, systematic and total risk")
Run the code above in your browser using DataLab