drawdowns {timeSeries} | R Documentation |
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. |
drawdowns(x, ...) drawdownsStats(x, ...)
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 .
|
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.
Peter Carl and Sankalp Upadhyay for code from the contributed R package PerformanceAnalytics.
## 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)