An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20080930/d2dc8809/attachment.pl>
PerformanceAnalytics and the UpsidePotentialRatio
4 messages · Ryan Sheftel, Brian G. Peterson
Ryan, We previously encountered this problem in the DownsideDeviation function. When looking at Sortino's various writings on the subject, we found that both interpretations (full series versus subset series) had been used in published papers. For DownsideDeviation, we implemented a "method" argument to allow the user to choose a "full" or "subset" series to be applied to the calculation, but did not carry that through to UpsidePotentialRatio. I'll give it some thought and extend the "method" argument to the UpsidePotentialRatio function as well. I'll try to post a patched function here that supports the "method" argument soon. Thank you very much for your thoughtful comments: questions, suggestions, and reports from users improve PerformanceAnalytics for all of us. Keep it coming! Regards, - Brian On Tue, 2008-09-30 at 14:36 -0400, ryan.sheftel at malbecpartners.com wrote:
Continuing to look at the PerformanceAnalytic package and this time the function UpsidePotentialRatio The code in the package is:
UpsidePotentialRatio
function (Ra, MAR = 0)
{
Ra = checkData(Ra, method = "vector")
r = subset(Ra, Ra > MAR)
return((sum(r - MAR)/(length(Ra)))/DownsideDeviation(Ra, MAR))
}
I believe there are two problems with this calculation according to my
understanding of the ratio.
- I think the numerator should be the average return of the
observations in excess of the MAR, so the lenght(Ra) should be
lenght(r).
(sum(r - MAR)/(length(r)))
- Second the denominator should the the deviation below the MAR, but
again only for the observations below the MAR. The DownsideDeviation
function looks to again be using all observations:
DownsideDeviation
function (Ra, MAR = 0)
{
Ra = checkDataVector(Ra)
r = subset(Ra, Ra < MAR)
return(sqrt(sum((r - MAR)^2)/(length(Ra))))
}
In here the final "length(Ra)" should be "length(r)"
Thanks for taking a look. The package is very impressive.
Ryan, I've updated the code to allow the use of a "method" argument for all the related functions. I was wondering if I could impose upon you to check my understanding of something. In June of 2007, I committed changes to the DownsideDeviation function with the comment: "fixed to use length of entire series, per Platinga, van der Meer, Sortino 2001", and in August 2007, I added the method argument so that users could choose. If you have the time and inclination, would you be willing to take a look at the reference and see if yourread of the paper matches my understanding that the length of the full series should be the default? Plantinga, A., van der Meer, R. and Sortino, F. The Impact of Downside Risk on Risk-Adjusted Performance of Mutual Funds in the Euronext Markets. July 19, 2001. Available at SSRN: http://ssrn.com/abstract=277352 I'm mostly concerned with setting the best default here. All the functions now support the method argument, I just want to make sure that the default is as rational as possible. I've copied the list in case any one else wants to chime in as well. Regards, - Brian On Tue, 2008-09-30 at 14:36 -0400, ryan.sheftel at malbecpartners.com wrote:
Continuing to look at the PerformanceAnalytic package and this time the function UpsidePotentialRatio The code in the package is:
UpsidePotentialRatio
function (Ra, MAR = 0)
{
Ra = checkData(Ra, method = "vector")
r = subset(Ra, Ra > MAR)
return((sum(r - MAR)/(length(Ra)))/DownsideDeviation(Ra, MAR))
}
I believe there are two problems with this calculation according to my
understanding of the ratio.
- I think the numerator should be the average return of the
observations in excess of the MAR, so the lenght(Ra) should be
lenght(r).
(sum(r - MAR)/(length(r)))
- Second the denominator should the the deviation below the MAR, but
again only for the observations below the MAR. The DownsideDeviation
function looks to again be using all observations:
DownsideDeviation
function (Ra, MAR = 0)
{
Ra = checkDataVector(Ra)
r = subset(Ra, Ra < MAR)
return(sqrt(sum((r - MAR)^2)/(length(Ra))))
}
In here the final "length(Ra)" should be "length(r)"
Thanks for taking a look. The package is very impressive.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20080930/dff98310/attachment.pl>