All Packages Class Hierarchy This Package Previous Next Index
Class sdsu.algorithms.data.ProbabilityDistribution
java.lang.Object
|
+----sdsu.algorithms.data.ProbabilityDistribution
- public abstract class ProbabilityDistribution
- extends Object
- implements NumberGenerator
An abstract class defining an interface for probability distributions.
A sample space is the set of events or items of interest. A
probability function on a sample space is map from the sample
space to the interval [0, 1], such that sum of the probabilities of all items
in the space is one. A random variable is a real-valued function defined
over the events in a sample space. The probability function of a random varabiel is
a probability function. The density is a function that assigns
probabilities to allowed ranges of the random variable.
This class and many of its subclasses are adapted from Smalltalk-80: The language
and Its Implementation, Goldberg & Robson, Addison-Wesley, 1983, chapter 21,
pages 417-438.
- Version:
- 1.0 10 June 1997
- Author:
- Roger Whitney (whitney@cs.sdsu.edu)
-
ProbabilityDistribution()
-
-
density(double)
- Returns the probability of an item in the sample
space will occur.
-
density(Number)
-
-
distribution(Vector)
- Computes the density of each item in the vector.
-
mean()
- Returns the mean of the probability distribution
-
nextElement()
- Returns a ramdon element in the sample space.
-
variance()
- Returns the variance of the probability distribution
ProbabilityDistribution
public ProbabilityDistribution()
density
public abstract double density(double sampleSpaceItem) throws OutOfBoundsException
- Returns the probability of an item in the sample
space will occur.
- Parameters:
- sampleSpaceItem - item in the sample space for which
the probability of occuring is computed.
- Throws: OutOfBoundsException
- if sampleSpaceItem is not in the
sample space of the distribution.
density
public double density(Number sampleSpaceItem)
mean
public abstract double mean()
- Returns the mean of the probability distribution
variance
public abstract double variance()
- Returns the variance of the probability distribution
distribution
public abstract Vector distribution(Vector sampleSpaceCollection)
- Computes the density of each item in the vector.
Returns a vector of the densities.
nextElement
public abstract double nextElement()
- Returns a ramdon element in the sample space. The probability of
a given item being returned is determined by the probability
distribution on the sample space.
All Packages Class Hierarchy This Package Previous Next Index