drawdowns {timeSeries}R Documentation

Calculations of Drawdowns

Description

Compute series of drawdowns from financial returns and ccalculate drawdown statisitcs.

The functions are:

drawdowns Generates 'timeSeries' object of drawdown levels,
drawdownsStats Compute drawdown stats for univariate time series.

Usage

drawdowns(x, ...)

drawdownsStats(x, ...)

Arguments

x [drawdowns] -
an uni- or multivariate 'timeSeries' object of financial returns,
[drawdowns] -
an univariate 'timeSeries' object of financial returns.
... [drawdowns] -
optional arguments passed to the function na.omit,
[drawdownsStats] -
arguments passed to the function drawdowns.

Value

drawdowns
returns an object of class 'timeSeries'.
drawdownsStats
returns an object of class 'data.frame' wit the following entries:
"drawdown" - the depth of the drawdown,
"from" - the start date,
"trough" - the trough period,
"to" - the end date,
"length" - the length in number of records,
"peaktrough" - the peak trough, and ,
"recovery" - the recovery length in number of records.

Author(s)

Peter Carl and Sankalp Upadhyay for code from the contributed R package PerformanceAnalytics.

Examples

## Load Swiss Pension Fund Data Set -  
   setRmetricsOptions(myFinCenter = "GMT")
   data(LPP2005REC)
   head(LPP2005REC)

## Compute Drawdowns Statistics - 
   drawdownsStats(LPP2005REC[, "SPI"])
   
## Plot Drawdowns - 
   dd = drawdowns(LPP2005REC[, "SPI"])
   plot(dd)

[Package timeSeries version 2110.87 Index]