edu.ucla.stat.SOCR.distributions
Class BetaBinomialDistribution

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

public class BetaBinomialDistribution
extends Distribution

The binomial distribution with specified parameters: the number of trials (n) and the probability of success (p) http://mathworld.wolfram.com/BetaBinomialDistribution.html .


Field Summary
 
Fields inherited from class edu.ucla.stat.SOCR.core.Distribution
applet, CONTINUOUS, DISCRETE, MAXMGFXVAL, MAXMGFYVAL, MINMGFXVAL, MIXED, name
 
Constructor Summary
BetaBinomialDistribution()
          Default constructor: creates the Beta-Binomial distribution with 10 trials, a=1, b=2
BetaBinomialDistribution(int n, double a, double b)
          General constructor: creates the beta-binomial distribution with specified parameters
 
Method Summary
 double getAlpha()
          Get alpha parameter
 double getBeta()
          Get beta parameter
 double getDensity(double x)
          Define the Beta-Binomial getDensity function
 double getMean()
          Give the mean in closed form
 java.lang.String getOnlineDescription()
          This method returns an online description of this distribution.
 double getSD()
          Specify the SD in close form
 int getTrials()
          Get the number of trials
 double getVariance()
          Specify the variance in close form
 void initialize()
          used for some subclass to initialize before being used
 void setAlpha(double a)
          Set alpha parameter
 void setBeta(double b)
          Set beta parameter
 void setParameters(int n, double a, double b)
          Set the parameters
 void setTrials(int n)
          Set the number of trails
 void valueChanged()
           
 
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, getPGF, getPGFDomain, getQuantile, getSampleMoment, getSOCRDistributionFunctors, getSOCRDistributions, getType, 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

BetaBinomialDistribution

public BetaBinomialDistribution()
Default constructor: creates the Beta-Binomial distribution with 10 trials, a=1, b=2


BetaBinomialDistribution

public BetaBinomialDistribution(int n,
                                double a,
                                double b)
General constructor: creates the beta-binomial distribution with specified parameters

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()
Overrides:
valueChanged in class Distribution

setParameters

public void setParameters(int n,
                          double a,
                          double b)
Set the parameters


setTrials

public void setTrials(int n)
Set the number of trails


getTrials

public int getTrials()
Get the number of trials


setAlpha

public void setAlpha(double a)
Set alpha parameter


getAlpha

public double getAlpha()
Get alpha parameter


setBeta

public void setBeta(double b)
Set beta parameter


getBeta

public double getBeta()
Get beta parameter


getDensity

public double getDensity(double x)
Define the Beta-Binomial getDensity function

Specified by:
getDensity in class Distribution

getMean

public double getMean()
Give the mean in closed form

Overrides:
getMean in class Distribution

getVariance

public double getVariance()
Specify the variance in close form

Overrides:
getVariance in class Distribution

getSD

public double getSD()
Specify the SD in close form

Overrides:
getSD in class Distribution

getOnlineDescription

public java.lang.String getOnlineDescription()
This method returns an online description of this distribution.

Overrides:
getOnlineDescription in class Distribution