R/BernadoLedoitratio.R
BernardoLedoitRatio.RdTo calculate Bernardo and Ledoit ratio we take the sum of the subset of returns that are above 0 and we divide it by the opposite of the sum of the subset of returns that are below 0
BernardoLedoitRatio(R, ...)$$BernardoLedoitRatio(R) = \frac{\frac{1}{n}\sum^{n}_{t=1}{max(R_{t},0)}}{\frac{1}{n}\sum^{n}_{t=1}{max(-R_{t},0)}}$$
where \(n\) is the number of observations of the entire series
Carl Bacon, Practical portfolio performance measurement and attribution, second edition 2008 p.95
data(portfolio_bacon)
print(BernardoLedoitRatio(portfolio_bacon[,1])) #expected 1.78
#> [1] 1.779783
data(managers)
print(BernardoLedoitRatio(managers['1996']))
#> HAM1 HAM2 HAM3 HAM4 HAM5 HAM6 EDHEC LS EQ
#> Bernardo and Ledoit ratio 4.598338 2375 6.482812 3.615074 NaN NaN NaN
#> SP500 TR US 10Y TR US 3m TR
#> Bernardo and Ledoit ratio 4.340625 1.028277 -Inf
print(BernardoLedoitRatio(managers['1996',1])) #expected 4.598
#> [1] 4.598338