[R-SIG-Finance] Omega calculation in PerformanceAnalytics package
Brian G. Peterson
brian at braverock.com
Mon Sep 29 16:23:18 CEST 2008
Ryan,
Thank you for spotting this. I've corrected the function in CVS, and it
will be part of version 0.9.7 of PerformanceAnalytics that we are
currently testing for release to CRAN.
After implementing the function and some initial testing, we didn't find
a lot of utility in the Omega ratio (this could be because of the error
in our calculation!, although the interpolated method gave results which
we also found of questionable utility).
Would you mind sharing why/how you find Omega useful?
Thanks again,
- Brian
On Sun, 2008-09-28 at 09:15 -0400, ryan.sheftel at malbecpartners.com
wrote:
>
> I am looking at the Omega() function in the PerformanceAnalytics
> package and it appears there may be an issue with the code and the
> answers it gives. It is entirely possible that it is just my
> understanding of the Omega ratio, but here is what I think needs to be
> fixed. Please correct me if I am wrong:
>
> R version 2.5.0
> PerformanceAnalytics package v 0.9.5
>
> I am using the function Omega with the following inputs and result:
>
> > Omega(-2:3, L=0, method='simple')
> [1] 1.5
>
> This answer did not seem correct, so I went into the code and see that
> the calculation is:
>
> ...
> switch(method, simple = {
> numerator = exp(-rf) * mean(max(x - L, 0))
> denominator = exp(-rf) * mean(max(L - x, 0))
> omega = numerator/denominator
> ...
>
> From my understanding of the Omega ratio, the problem lies in the use
> of the "max" in the code and not "pmax". The max function returns on
> the single largest value from the vector, so the mean(max()) is the
> same as just max(). I believe the proper code should be:
>
> ...
> switch(method, simple = {
> numerator = exp(-rf) * mean(pmax(x - L, 0))
> denominator = exp(-rf) * mean(pmax(L - x, 0))
> omega = numerator/denominator
> ...
>
> Which would give the proper result of 2. This is because the Omega is
> an average of all the values above the threshold and average of all
> the values below, and not just the extreme values.
>
> If this has been fixed in a later version of PerformanceAnalytics, my
> apologies.
>
>
> Ryan Sheftel
> Malbec Quantys Fund
> 200 Park Avenue
> New York, NY 10166
> (212) 271-4006
> ryan.sheftel at malbecpartners.com
More information about the R-SIG-Finance
mailing list