A table of estimates of rolling period return measures

table.RollingPeriods(R, periods = subset(c(12, 36, 60), c(12, 36, 60) <
  length(as.matrix(R[, 1]))), FUNCS = c("mean", "sd"),
  funcs.names = c("Average", "Std Dev"), digits = 4, ...)

table.TrailingPeriodsRel(R, Rb, periods = subset(c(12, 36, 60), c(12, 36, 60)
  < length(as.matrix(R[, 1]))), FUNCS = c("cor", "CAPM.beta"),
  funcs.names = c("Correlation", "Beta"), digits = 4, ...)

Arguments

R

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

periods

number of periods to use as rolling window(s), subset of c(3, 6, 9, 12, 18, 24, 36, 48)

FUNCS

list of functions to apply the rolling period to

funcs.names

vector of function names used for labeling table rows

digits

number of digits to round results to

any other passthru parameters for functions specified in FUNCS

Rb

an xts, vector, matrix, data frame, timeSeries or zoo object of index, benchmark, portfolio, or secondary asset returns to compare against

See also

rollapply

Examples

data(edhec) table.TrailingPeriods(edhec[,10:13], periods=c(12,24,36))
#> Merger Arbitrage Relative Value Short Selling #> Last 12 month Average 0.0025 0.0003 0.0026 #> Last 24 month Average 0.0024 0.0006 0.0079 #> Last 36 month Average 0.0049 0.0034 0.0036 #> Last 12 month Std Dev 0.0141 0.0331 0.0537 #> Last 24 month Std Dev 0.0126 0.0246 0.0460 #> Last 36 month Std Dev 0.0121 0.0207 0.0403 #> Funds of Funds #> Last 12 month Average -0.0067 #> Last 24 month Average -0.0043 #> Last 36 month Average 0.0002 #> Last 12 month Std Dev 0.0284 #> Last 24 month Std Dev 0.0242 #> Last 36 month Std Dev 0.0217
result=table.TrailingPeriods(edhec[,10:13], periods=c(12,24,36)) require("Hmisc")
#> Loading required package: Hmisc
#> Warning: there is no package called ‘Hmisc’
textplot(format.df(result, na.blank=TRUE, numeric.dollar=FALSE, cdec=rep(3,dim(result)[2])), rmar = 0.8, cmar = 1.5, max.cex=.9, halign = "center", valign = "top", row.valign="center", wrap.rownames=15, wrap.colnames=10, mar = c(0,0,3,0)+0.1)
#> Error in format.df(result, na.blank = TRUE, numeric.dollar = FALSE, cdec = rep(3, dim(result)[2])): could not find function "format.df"
title(main="Trailing Period Statistics")
#> Error in title(main = "Trailing Period Statistics"): plot.new has not been called yet