Proposal for PerformanceAnalytics::Omega, method = "interp"
I've been working on various risk measures recently, Omega being one of
them. In PerformanceAnalytics I saw two implemented methods ("simple"
and "interp"), so I studied both. A quick analysis shows that "interp"
does not work as intended (R 3.3.2, PerformanceAnalytics_1.4.3541):
It is quite simple to see that under normality assumption Omega at L = 0
converges to 1, so the "interp" estimate is looking strange. Here's the
relevant piece of code (truncated for clarity):
xcdf = Hmisc::Ecdf.default(x, pl=FALSE)
f <- approxfun(xcdf$x,xcdf$y,method="linear",ties="ordered")
omegafull = cumsum(1-f(xcdf$x))/cumsum(f(xcdf$x)) # ????????
g <- approxfun(xcdf$x,omegafull,method="linear",ties="ordered")
omega = g(L)
Here the ratio of cumulative sums is not a correct approximation for the
ratio of two integrals from the Omega definition (which is probably
pointed out by the comment with question marks). I originally wanted to
propose the replacement with left rectangle rule for approximation: