PainRatio | R Documentation |
To calculate Pain ratio we divide the difference of the portfolio return and the risk free rate by the Pain index
PainRatio(R, Rf = 0, ...)
R |
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |
Rf |
risk free rate, in same period as your returns |
... |
any other passthru parameters |
Pain ratio = \frac{r_P - r_F}{\sum^{n}_{i=1} \frac{\mid D'_i \mid}{n}}
where r_P
is the annualized portfolio return, r_F
is the risk free
rate, n
is the number of observations of the entire series, D'_i
is
the drawdown since previous peak in period i
Matthieu Lestel
Carl Bacon, Practical portfolio performance measurement and attribution, second edition 2008 p.91
data(portfolio_bacon)
print(PainRatio(portfolio_bacon[,1])) #expected 2.66
data(managers)
print(PainRatio(managers['1996']))
print(PainRatio(managers['1996',1]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.