Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-385

Characteristic (support, mean, variance, ...) on Distributions

    Details

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

      Description

      I wish that the Distributions could contain some characteristics. For example support, mean, and variance.

      Support:
      AbstractContinuousDistribution and AbstractIntegerDistribution should have double getSupport

      {Lower, Upper}Bound() and int getSupport{Lower, Upper}

      Bound(), respectively. Also methods a la boolean isSupport

      {Lower, Upper}BoundInclusive() on AbstractContinuousDistribution should reflect if the support is open of closed. In practise the implemented distributions are easy since the support for all continuous distributions are real intervals (connected sets), and the support for all the discrete distributions are connected integer sets. This means that the lower and upper bound (together with isSupport{Lower, Upper}

      BoundInclusive() on AbstractContinuousDistribution because it is not needed on the discrete distributions because of their nature) are sufficient for determine the support.

      Mean and variance:
      double get

      {Mean, Variance}

      () should be on AbstractDistribution.

      With such characteristic an invalidateParameters-method might come in handy because they often depend on the parameters. The characteristics should not be calculated before the first time they are get'ted, and when calculated, they should be saved for later use. When parameters change, an invalidateParameters-method should be called to force the characteristics to be recalculated.

      Values such as Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, and Double.NaN should be used where appropriate.

        Attachments

        1. MATH385-PATCH1
          22 kB
          Mikkel Meyer Andersen
        2. MATH385-PATCH2
          41 kB
          Mikkel Meyer Andersen
        3. MATH385-PATCH3
          61 kB
          Mikkel Meyer Andersen

          Activity

            People

            • Assignee:
              mikl Mikkel Meyer Andersen
              Reporter:
              mikl Mikkel Meyer Andersen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5h
                5h
                Remaining:
                Remaining Estimate - 5h
                5h
                Logged:
                Time Spent - Not Specified
                Not Specified