edu.ucla.stat.SOCR.distributions
Class BinomialRandomNDistribution

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.BinomialRandomNDistribution
All Implemented Interfaces:
IValueSettable, Pluginable, java.util.Observer

public class BinomialRandomNDistribution
extends Distribution

The binomial distribution with a random number of trials


Field Summary
 
Fields inherited from class edu.ucla.stat.SOCR.core.Distribution
applet, CONTINUOUS, DISCRETE, MAXMGFXVAL, MAXMGFYVAL, MINMGFXVAL, MIXED, name
 
Constructor Summary
BinomialRandomNDistribution()
          This default constructor: creates a new randomized binomial distribution with probability of success 0.5 and the uniform distribution on {1, 2, 3, 4, 5, 6} for the number of trials
BinomialRandomNDistribution(Distribution d, double p)
          This general constructor creates a new randomized binomial distribution with a specified probability of success and a specified distribution for the number of trials
BinomialRandomNDistribution(double p)
          Special constructor: creates a new randomized binomial distribution with a specified probability of success and the uniform distribution on {1, 2, 3, 4, 5, 6} for the number of trials
 
Method Summary
 double getDensity(double x)
          The getDensity method is abstract and must be overridden for any specific distribuiton
 double getMean()
          This method returns a default approximate mean, based on the finite set of domain values.
 double getVariance()
          This method returns a default approximate variance.
 void setParameters(Distribution d, double p)
          Set the parameters: the distribution for the number of trials and the probability of success
 double simulate()
          This method computes a default simulation of a value from the distribution, as a random getQuantile.
 
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, getMedian, getMGF, getMgfDomain, getName, getOnlineDescription, getPGF, getPGFDomain, getQuantile, getSampleMoment, getSD, getSOCRDistributionFunctors, getSOCRDistributions, getType, getVariance, initialize, inverseCDF, logGamma, paramEstimate, perm, sampleMean, sampleVar, setApplet, setDomain, setDomain, setMGFDomain, setMGFDomain, setMGFParameters, setMGFParameters, setMGFParameters, setMGFParameters, setParameters, setPGFDomain, setPGFDomain, setPGFParameters, setPGFParameters, setPGFParameters, setPGFParameters, update, valueChanged, 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

BinomialRandomNDistribution

public BinomialRandomNDistribution(Distribution d,
                                   double p)
This general constructor creates a new randomized binomial distribution with a specified probability of success and a specified distribution for the number of trials


BinomialRandomNDistribution

public BinomialRandomNDistribution(double p)
Special constructor: creates a new randomized binomial distribution with a specified probability of success and the uniform distribution on {1, 2, 3, 4, 5, 6} for the number of trials


BinomialRandomNDistribution

public BinomialRandomNDistribution()
This default constructor: creates a new randomized binomial distribution with probability of success 0.5 and the uniform distribution on {1, 2, 3, 4, 5, 6} for the number of trials

Method Detail

setParameters

public void setParameters(Distribution d,
                          double p)
Set the parameters: the distribution for the number of trials and the probability of success


getDensity

public double getDensity(double x)
Description copied from class: Distribution
The getDensity method is abstract and must be overridden for any specific distribuiton

Specified by:
getDensity in class Distribution

getMean

public double getMean()
Description copied from class: Distribution
This method returns a default approximate mean, based on the finite set of domain values. This method should be overriden if the mean is known in closed form

Overrides:
getMean in class Distribution

getVariance

public double getVariance()
Description copied from class: Distribution
This method returns a default approximate variance. This method should be overriden if the variance is known in closed form

Overrides:
getVariance in class Distribution

simulate

public double simulate()
Description copied from class: Distribution
This method computes a default simulation of a value from the distribution, as a random getQuantile. This method should be overridden if a better method of simulation is known.

Overrides:
simulate in class Distribution