rollingPerformance: rollingPerformance

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

get the rolling performance of the return series

Usage

1
2
rollingPerformance(rtn, FUN = "Return.annualized", width = 365, by = 30,
  align = "right", ...)

Arguments

rtn

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

FUN

any function that can be evaluated using a single set of returns (e.g., rolling CAPM.beta won't work, but Return.annualized will)

width

see rollapply for detail

by

see rollapply for detail

align

see rollapply for detail

...

other arguments to function FUN or rollapply

Value

A object of class xts with the results of the rolling function

Author(s)

Ruifei.Yin

Examples

1
2
3
4
rtn.long <- zoo(rnorm(100,0.001,0.02),as.Date("2010-01-01")+1:100)
rtn.short <- rtn.long + rnorm(100,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
re <- rollingPerformance(rtn, width=20, by=5)

QuantAndrew/QUtility documentation built on May 14, 2019, 7:36 a.m.