[
https://issues.apache.org/jira/browse/MATH-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795553#action_12795553
]
Phil Steitz commented on MATH-323:
----------------------------------
Happy almost New Year to you, Larry!
Great progress here. I like the the less smelly approach to defining upper and
lower than a boolean. I do have a couple of comments:
* This class should extend either AbstractStorelessUnivatiateStatistic or
AbstractUnivariateStatistic. The former is for stats that do not require the
full array of values to be provided and stored. I am honestly not sure at this
point whether we are going to be able to define increment() methods for this
statistic, so it could be AbstractUnivariateStatistic is a better parent. Once
you do this, you can replace your argument checking with calls to the test()
method defined in AbstractUnivariateStatistic. Have a look at how Variance
does this.
* The cutoff and direction should be optional constructor parameters. The
UnivariateStatistic interface requires that statistics have evaluate methods
that require no parameters beyond the input array and subarray indices. To
implement this interface while supporting the other config options, you need to
supply the config parameters in constructor arguments.
* I am still struggling a little with the definition. This is why the
"documentation goes here" bits would really help ;). I was assuming that when
you use a cutoff value in place of the mean, you compute deviations from the
cutoff rather than from the mean. That would correspond more neatly to the
variance decomposition that I thought this statistic was supposed to measure.
If I have this right, you don't need to compute the mean when a cutoff value is
provided and deviations should be computed against the cutoff.
> Add Semivariance calculation
> ----------------------------
>
> Key: MATH-323
> URL: https://issues.apache.org/jira/browse/MATH-323
> Project: Commons Math
> Issue Type: New Feature
> Affects Versions: 2.1
> Reporter: Larry Diamond
> Assignee: Phil Steitz
> Priority: Minor
> Fix For: 2.1
>
> Attachments: patch.txt, patch2.txt, SemiVariance.java,
> SemiVarianceTest.java, StatUtils.java, StatUtils.java, StatUtilsTest.java,
> StatUtilsTest.java
>
>
> I've added semivariance calculations to my local build of commons-math and I
> would like to contribute them.
> Semivariance is described a little bit on
> http://en.wikipedia.org/wiki/Semivariance , but a real reason you would use
> them is in finance in order to compute the Sortino ratio rather than the
> Sharpe ratio.
> http://en.wikipedia.org/wiki/Sortino_ratio gives an explanation of the
> Sortino ratio and why you would choose to use that rather than the Sharpe
> ratio. (There are other ways to measure the performance of your portfolio,
> but I wont bore everybody with that stuff)
> I've already got the coding completed along with the test cases and building
> using mvn site.
> The only two files I've modified is
> src/main/java/org/apache/commons/stat/StatUtils.java and
> src/test/java/org/apache/commons/math/stat/StatUtilsTest.java
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.