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@malbecpartners.com
	[[alternative HTML version deleted]]

