You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dennis Hendriks (Created) (JIRA)" <ji...@apache.org> on 2012/01/13 10:07:39 UTC

[jira] [Created] (MATH-733) Add LogNormal distribution

Add LogNormal distribution
--------------------------

                 Key: MATH-733
                 URL: https://issues.apache.org/jira/browse/MATH-733
             Project: Commons Math
          Issue Type: New Feature
            Reporter: Dennis Hendriks
             Fix For: 3.0


It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187556#comment-13187556 ] 

Dennis Hendriks commented on MATH-733:
--------------------------------------

bq. please have a look to r1232324 [...]

Some comments:
 - LogNormalDistribution constructor: LocalizedFormats.STANDARD_DEVIATION -> change to LocalizedFormats.NOT_POSITIVE_SHAPE
 - LogNormalDistributionTest: testGetMean -> testGetScale, testGetStandardDeviation -> testGetShape
 - LogNormalDistributionTest: checkDensity function: rename 'mean' and 'sd' parameters

Also, the <a id="parameters">...</a> and <a href="#parameters">scale</a> stuff is not Eclipse Java text editor compatible. It probably works just fine in the html pages generated from the Javadoc. However, I would prefer to stick with {@link ...}, if possible.
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187505#comment-13187505 ] 

Sébastien Brisard commented on MATH-733:
----------------------------------------

Hi Dennis,
please have a look to {{r1232324}}, and let me know if you are happy with the changes I've carried out (along the lines discussed above).
Thanks for this contribution!
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (MATH-733) Add LogNormal distribution

Posted by "Dennis Hendriks (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-733:
---------------------------------

    Labels: distribution  (was: )
    
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188312#comment-13188312 ] 

Dennis Hendriks commented on MATH-733:
--------------------------------------

bq. Done in r1232755. Shall we resolve this issue?

I have no further comments, so go ahead.
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Gilles (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187642#comment-13187642 ] 

Gilles commented on MATH-733:
-----------------------------

bq. LogNormalDistribution constructor: LocalizedFormats.STANDARD_DEVIATION -> change to LocalizedFormats.NOT_POSITIVE_SHAPE

The change should be to "LocalizedFormats.SHAPE".

bq. I would prefer to stick with {@link ...}, [...]

+1
Also, we should be careful not to refer to the "private" API from the doc of the "public" one. I mean that you cannot just replace everywhere
{noformat}
<a href="#parameters">scale</a>
{noformat}
with
{noformat}
{@link #scale}
{noformat}

I think that we can safely assume that the users will read _all_ the class documentation; it is not necessary to have those many pointers "back to the top" (i.e. the {{<a href="#parameters">}} links).

                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Dennis Hendriks (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186742#comment-13186742 ] 

Dennis Hendriks commented on MATH-733:
--------------------------------------

Hi Sébastien,

I completely understand your objection to using mean and standardDeviation. I think changing them to scale and shape would indeed be a good idea. Please go ahead with your proposed changes. And thanks for looking at my contribution!
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13188299#comment-13188299 ] 

Sébastien Brisard commented on MATH-733:
----------------------------------------

Done in {{r1232755}}. Shall we resolve this issue?
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-733) Add LogNormal distribution

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13186732#comment-13186732 ] 

Sébastien Brisard commented on MATH-733:
----------------------------------------

Hi Dennis,
thanks for this contribution. I've looked into it, and am uncomfortable with the naming conventions {{mean}} and {{standardDeviation}} which are *not* the mean and sd of the log-normal distribution, but rather the underlying normal distribution.
Would you object to my renaming all these parameters and class variables to {{scale}} and {{shape}}, as you yourself mention these naming conventions in the javadoc? I would then move your explanation of the definition of these parameters to the class's documentation comment.
>From the user's perspective (heavily relying on automatic completion) I think it is dangerous that {{getMean()}} should *not* return the mean value of the current distribution. Of course, your javadoc comments are very clear, but... Also, my experience in materials science is that people are always a bit "fuzzy" about log-normal distributions. What they call "sigma" is never very clear...
Please let me know what you think.
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (MATH-733) Add LogNormal distribution

Posted by "Dennis Hendriks (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Hendriks updated MATH-733:
---------------------------------

    Attachment: lognormal_distribution.patch

Implementation of the log-normal distribution. Implementation based on Wikipedia formulas and the already present implementation of the normal distribution.

Unit tests included. Also based on test cases for the normal distribution.

Checkstyle fails:

{code}
<file name="src/main/java/org/apache/commons/math/distribution/LogNormalDistribution.java">
<error line="0" severity="error" message="Got an exception - java.lang.RuntimeException: Unable to get class information for @throws tag &apos;NotStrictlyPositiveException&apos;." source="com.puppycrawl.tools.checkstyle.TreeWalker"/>
</file>
{code}

However, it does so for most of the distributions...
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MATH-733) Add LogNormal distribution

Posted by "Sébastien Brisard (Resolved JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sébastien Brisard resolved MATH-733.
------------------------------------

    Resolution: Fixed

Patch contributed by Dennis successfully committed (with minor changes).

Thanks again for this contribution.
                
> Add LogNormal distribution
> --------------------------
>
>                 Key: MATH-733
>                 URL: https://issues.apache.org/jira/browse/MATH-733
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Dennis Hendriks
>            Assignee: Sébastien Brisard
>              Labels: distribution
>             Fix For: 3.0
>
>         Attachments: lognormal_distribution.patch
>
>
> It would be nice to have a log-normal distribution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira