All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sdsu.algorithms.data.NoInverseDistribution

java.lang.Object
   |
   +----sdsu.algorithms.data.ProbabilityDistribution
           |
           +----sdsu.algorithms.data.DiscreteProbability
                   |
                   +----sdsu.algorithms.data.NoInverseDistribution

public abstract class NoInverseDistribution
extends DiscreteProbability
An abstract class handling discrete probability distributions with no inverse or easly computable inverse. The inverse is determined by brute force. Let the sample space contain items s1, s2, ..., sn. Let PD( x) denote the density function of x. Map the interval [0, 1] to the sample space by:
[0, PD(s1)] <-> s1,
(PD(s1), PD(s1) + PD(s2) ] <-> s2,
(PD(s1) + PD(s2), PD(s1) + PD(s2) + PD(s3)] <-> s3,
etc. In this way the cumulative distribution of s1, s2, ..., sn gives the inverse. This class computes cumulative distribution.

Version:
1.0 12 June 1997
Author:
Roger Whitney (whitney@cs.sdsu.edu)

Constructor Index

 o NoInverseDistribution()

Method Index

 o nextElement()
Return the next element in a random selection of items in the sample space, using distribution of concrete subclass.

Constructors

 o NoInverseDistribution
 public NoInverseDistribution()

Methods

 o nextElement
 public double nextElement()
Return the next element in a random selection of items in the sample space, using distribution of concrete subclass. The next element is an integer value from 1 to size of the sample space.

Overrides:
nextElement in class ProbabilityDistribution

All Packages  Class Hierarchy  This Package  Previous  Next  Index