Last chance! 50% off unlimited learning
Sale ends in
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, ...)
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
risk free rate, in same period as your returns
any other passthru parameters
where
Carl Bacon, Practical portfolio performance measurement and attribution, second edition 2008 p.91
# NOT RUN {
data(portfolio_bacon)
print(PainRatio(portfolio_bacon[,1])) #expected 2.66
data(managers)
print(PainRatio(managers['1996']))
print(PainRatio(managers['1996',1]))
# }
Run the code above in your browser using DataLab