Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      Seems that org.apache.commons.math3.distribution lacks a ParetoDistribution for some reason. This is a real common type of distribution, so providing it would be very nice!

      1. MATH-968.zip
        7 kB
        Thomas Neidhart

        Activity

        Hide
        Gilles added a comment -

        [...] for some reason.

        Because there is no patch?
        Contributions welcome.

        Show
        Gilles added a comment - [...] for some reason. Because there is no patch? Contributions welcome.
        Hide
        Thomas Neidhart added a comment - - edited

        Please find attached a patch that adds support for the Pareto distribution.

        The test values have been created with R (cran module VGAM contains a pareto distribution), although there seems to be a small bug in the module as the density for x == scale/k is returned as 0.

        Looking at the wikipedia page or wolfram (http://reference.wolfram.com/mathematica/ref/ParetoDistribution.html) you can see that for this case the density should be <> 0. So I adapted the test values for this case.

        Show
        Thomas Neidhart added a comment - - edited Please find attached a patch that adds support for the Pareto distribution. The test values have been created with R (cran module VGAM contains a pareto distribution), although there seems to be a small bug in the module as the density for x == scale/k is returned as 0. Looking at the wikipedia page or wolfram ( http://reference.wolfram.com/mathematica/ref/ParetoDistribution.html ) you can see that for this case the density should be <> 0. So I adapted the test values for this case.
        Hide
        Gilles added a comment -

        Raising the comments formatting issue, again.

        We agreed that UTF-8 characters can be used. Should we go further and further so as to use them in formulae that "translitterates" the code implemented? Since the Javadoc is mainly intended for Java programmers, I think that the comment does not need to be excessively "beautified". An additional argument is that the (plain) Javadoc will never match the "correct" (LaTeX) layout, so that we are left with a hybrid: part Java statement syntax, part mathematical notation, part neither (like the caret "^" character when used to represent exponentiation).

        IMHO, in the class Javadoc, it is enough to use links (to "reference" sites). If necessary, beautified formulae could be added there (and in the user guide).
        In a method's Javadoc, I'd tend to stay close to the programming language syntax.

        Show
        Gilles added a comment - Raising the comments formatting issue, again. We agreed that UTF-8 characters can be used. Should we go further and further so as to use them in formulae that "translitterates" the code implemented? Since the Javadoc is mainly intended for Java programmers, I think that the comment does not need to be excessively "beautified". An additional argument is that the (plain) Javadoc will never match the "correct" (LaTeX) layout, so that we are left with a hybrid: part Java statement syntax, part mathematical notation, part neither (like the caret "^" character when used to represent exponentiation). IMHO, in the class Javadoc, it is enough to use links (to "reference" sites). If necessary, beautified formulae could be added there (and in the user guide). In a method's Javadoc, I'd tend to stay close to the programming language syntax.
        Hide
        Thomas Neidhart added a comment -

        What about this approach: http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html

        Write latex formulas which are anyway similar to the ones we already use, and these will be rendered nicely in HTML.

        Show
        Thomas Neidhart added a comment - What about this approach: http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html Write latex formulas which are anyway similar to the ones we already use, and these will be rendered nicely in HTML.
        Hide
        Gilles added a comment -

        I proposed to test something similar some time ago: http://users.informatik.uni-halle.de/~grau/LaTeXlet/

        But there has been significant reluctance about licensing, dependencies, and plainly having LaTeX code inside the Javadoc.

        IMHO, there are two options:

        1. LaTeX-based extension to create beautiful (when generated!) comments
        2. Basic Javadoc, no fancy formulae (especially not using plain HTML)
        Show
        Gilles added a comment - I proposed to test something similar some time ago: http://users.informatik.uni-halle.de/~grau/LaTeXlet/ But there has been significant reluctance about licensing, dependencies, and plainly having LaTeX code inside the Javadoc. IMHO, there are two options: LaTeX-based extension to create beautiful (when generated!) comments Basic Javadoc, no fancy formulae (especially not using plain HTML)
        Hide
        Thomas Neidhart added a comment -

        Added patch in r1480056.

        Show
        Thomas Neidhart added a comment - Added patch in r1480056.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alex Gryzlov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development