cum.utils {PerformanceAnalytics}R Documentation

wrapper to calculate cumprod on all columns in a matrix

Description

calculate cumulative values for the observation series given, including multicolumn extensions to cummax and cumprod
cummax.column cumulative maxima by column, useful for drawdowns
cumprod.column cumulative product by column, useful for compound returns

A prior version of these functions included specific NA handling. This was removed due to a conflict with the general cumulative functions in the R core. Please be aware that you may have issues with series of different lengths, and may need to explicitly handle NAs as a result.

Usage

## S3 method for class 'column':
cumprod(x)
## S3 method for class 'column':
cummax(x)

Arguments

x a vector, matrix, data frame, timeSeries or zoo object of observations

Value

transformed matrix of cumprod's or cummax's

Author(s)

Peter Carl

See Also

cumprod cummax


[Package PerformanceAnalytics version 0.9.7 Index]