R/table.AnnualizedReturns.R
table.AnnualizedReturns.RdTable of Annualized Return, Annualized Std Dev, and Annualized Sharpe
table.AnnualizedReturns(R, scale = NA, Rf = 0, geometric = TRUE, digits = 4)an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
number of periods in a year (daily scale = 252, monthly scale = 12, quarterly scale = 4)
risk free rate, in same period as your returns
utilize geometric chaining (TRUE) or simple/arithmetic chaining (FALSE) to aggregate returns, default TRUE
number of digits to round results to
# don't test on CRAN, since it requires Suggested packages
data(managers)
table.AnnualizedReturns(managers[,1:8])
#> HAM1 HAM2 HAM3 HAM4 HAM5 HAM6 EDHEC LS EQ
#> Annualized Return 0.1375 0.1747 0.1512 0.1215 0.0373 0.1373 0.1180
#> Annualized Std Dev 0.0888 0.1272 0.1265 0.1843 0.1584 0.0825 0.0708
#> Annualized Sharpe (Rf=0%) 1.5491 1.3732 1.1955 0.6592 0.2356 1.6642 1.6657
#> SP500 TR
#> Annualized Return 0.0967
#> Annualized Std Dev 0.1500
#> Annualized Sharpe (Rf=0%) 0.6449
require("Hmisc")
#> Loading required package: Hmisc
#>
#> Attaching package: ‘Hmisc’
#> The following objects are masked from ‘package:base’:
#>
#> format.pval, units
result = t(table.AnnualizedReturns(managers[,1: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="Annualized Performance")