Commons Math
  1. Commons Math
  2. MATH-222

Need way to compute density of distributions


    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:


      Currently, there are a number of distributions defined in commons math, but the interface for Distribution and ContinuousDistribution doesn't provide for the computation of the PDF at a particular point.

      It is common for it to be necessary to compute the density function, for example in the Metropolis algorithm.

      It is also pretty common for it to be very difficult to compute a density function or for the density function to be undefined as certain points. Only the cumulative density is mathematically assured.

      Thus, I propose to create a new interface HasDensityFunction<T> that requires the implementation of a double density(T) method. T is the type of the argument for the density function which would be Double in the case of most univariate statistics, but could, for instance, be a vector of doubles for a Dirichlet distribution or a vector of integers for a Multinomial.

      1. MATH-222-with-beta.patch
        45 kB
        Ted Dunning
      2. MATH-222.patch
        37 kB
        Ted Dunning


        Ted Dunning created issue -
        Ted Dunning made changes -
        Field Original Value New Value
        Attachment MATH-222.patch [ 12389331 ]
        Ted Dunning made changes -
        Attachment MATH-222-with-beta.patch [ 12389333 ]
        Luc Maisonobe made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]


          • Assignee:
            Ted Dunning
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: