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)

Constructor Index

 o ProbabilityDistribution()

Method Index

 o density(double)
Returns the probability of an item in the sample space will occur.
 o density(Number)
 o distribution(Vector)
Computes the density of each item in the vector.
 o mean()
Returns the mean of the probability distribution
 o nextElement()
Returns a ramdon element in the sample space.
 o variance()
Returns the variance of the probability distribution

Constructors

 o ProbabilityDistribution
 public ProbabilityDistribution()

Methods

 o 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.
 o density
 public double density(Number sampleSpaceItem)
 o mean
 public abstract double mean()
Returns the mean of the probability distribution

 o variance
 public abstract double variance()
Returns the variance of the probability distribution

 o distribution
 public abstract Vector distribution(Vector sampleSpaceCollection)
Computes the density of each item in the vector. Returns a vector of the densities.

 o 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