sdsu.algorithms.data
Class NoInverseDistribution
java.lang.Object
|
+--sdsu.algorithms.data.ProbabilityDistribution
|
+--sdsu.algorithms.data.DiscreteProbability
|
+--sdsu.algorithms.data.NoInverseDistribution
- Direct Known Subclasses:
- GeneralizedEightyTwenty, Zipf
- 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)
Method Summary |
double |
nextElement()
Return the next element in a random selection of
items in the sample space, using distribution of concrete
subclass. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NoInverseDistribution
public NoInverseDistribution()
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