edu.ucla.stat.SOCR.distributions
Class FiniteDistribution

java.lang.Object
  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.Distribution
          extended by edu.ucla.stat.SOCR.distributions.FiniteDistribution
All Implemented Interfaces:
IValueSettable, Pluginable, java.util.Observer
Direct Known Subclasses:
DieDistribution

public class FiniteDistribution
extends Distribution

A basic discrete distribution on a finite set of points, with specified probabilities


Field Summary
 
Fields inherited from class edu.ucla.stat.SOCR.core.Distribution
applet, CONTINUOUS, DISCRETE, MAXMGFXVAL, MAXMGFYVAL, MINMGFXVAL, MIXED, name
 
Constructor Summary
FiniteDistribution()
          This special constructor creates a new uniform distribution on {1, 2, ..., 10}.
FiniteDistribution(double a, double b, double w)
          Constructs the uniform distribuiton on the finite set of points
FiniteDistribution(double a, double b, double w, double[] p)
          Constructs a new finite distribution on a finite set of points with a specified array of probabilities
 
Method Summary
 double getDensity(double x)
          Density function
 double[] getProbabilities()
          This method gets the probability vector.
 double getProbability(int i)
          This method gets the probability for a specified index
 void initialize()
          used for some subclass to initialize before being used
 void setParameters(double a, double b, double w, double[] p)
          This method sets the parameters: the domain and the probabilities.
 void setProbabilities(double[] p)
          Set the probabilities
 void valueChanged(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class edu.ucla.stat.SOCR.core.Distribution
addObserver, betaCDF, comb, factorial, findGFRoot, findRoot, gamma, gammaCDF, getCDF, getDisplayPane, getDomain, getFailureRate, getGFDerivative, getGFSecondDerivative, getInstance, getLocalHelp, getMaxDensity, getMean, getMean, getMedian, getMGF, getMgfDomain, getName, getOnlineDescription, getPGF, getPGFDomain, getQuantile, getSampleMoment, getSD, getSOCRDistributionFunctors, getSOCRDistributions, getType, getVariance, getVariance, inverseCDF, logGamma, paramEstimate, perm, sampleMean, sampleVar, setApplet, setDomain, setDomain, setMGFDomain, setMGFDomain, setMGFParameters, setMGFParameters, setMGFParameters, setMGFParameters, setParameters, setPGFDomain, setPGFDomain, setPGFParameters, setPGFParameters, setPGFParameters, setPGFParameters, simulate, update, valueChanged
 
Methods inherited from class edu.ucla.stat.SOCR.core.SOCRValueSettable
createComponentSetter, createValueSetter, createValueSetter, createValueSetter, createValueSetter, getComponentSetter, getComponentSetters, getValueSetter, getValueSetters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FiniteDistribution

public FiniteDistribution(double a,
                          double b,
                          double w,
                          double[] p)
Constructs a new finite distribution on a finite set of points with a specified array of probabilities


FiniteDistribution

public FiniteDistribution(double a,
                          double b,
                          double w)
Constructs the uniform distribuiton on the finite set of points


FiniteDistribution

public FiniteDistribution()
This special constructor creates a new uniform distribution on {1, 2, ..., 10}.

Method Detail

initialize

public void initialize()
Description copied from class: Distribution
used for some subclass to initialize before being used

Overrides:
initialize in class Distribution

valueChanged

public void valueChanged(java.util.Observable o,
                         java.lang.Object arg)
Overrides:
valueChanged in class Distribution

setParameters

public void setParameters(double a,
                          double b,
                          double w,
                          double[] p)
This method sets the parameters: the domain and the probabilities.


getDensity

public double getDensity(double x)
Density function

Specified by:
getDensity in class Distribution

setProbabilities

public void setProbabilities(double[] p)
Set the probabilities


getProbability

public double getProbability(int i)
This method gets the probability for a specified index


getProbabilities

public double[] getProbabilities()
This method gets the probability vector.