edu.ucla.stat.SOCR.distributions
Class NegativeMultiNomialDistribution

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.NegativeMultiNomialDistribution
All Implemented Interfaces:
IValueSettable, Pluginable, java.awt.event.ActionListener, java.util.EventListener, java.util.Observer

public class NegativeMultiNomialDistribution
extends Distribution
implements java.awt.event.ActionListener

The Negative-Multinomial distribution with parameter-vector (x_o,p), where gamma = x_o>=0, and p=(p_1,0, p_r). k=(k_0, k_1, k_2, ..., k_r), with sum(k_i)=n and p_k>=0, 1<=k<=n. http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6V1D-4H7T8P0-1&_user=4423&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_searchStrId=1066378625&_rerunOrigin=google&_acct=C000059605&_version=1&_urlVersion=0&_userid=4423&md5=c09a50a9f4651d5f493f5190f48bc1da is a generalization of Negative-Binomial Distribution. http://dx.doi.org/10.1016/j.spl.2005.09.009


Field Summary
protected  int dimension
           
protected  int gamma
           
protected  int k
           
protected  double[] p
           
 int type
           
protected  int[] x
           
 
Fields inherited from class edu.ucla.stat.SOCR.core.Distribution
applet, CONTINUOUS, DISCRETE, MAXMGFXVAL, MAXMGFYVAL, MINMGFXVAL, MIXED, name
 
Constructor Summary
NegativeMultiNomialDistribution()
          This default constructor creates a new MultiNomialDistribution(2, {0.5, 0.5})
NegativeMultiNomialDistribution(int gamma, double[] p)
          Creates a NegativeMultinomial Distribution object with parameters
NegativeMultiNomialDistribution(int gamma, double[] p, int[] x)
          This general constructor creates a new NegativeMultiNomialDistribution with specified parameters:
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method handles the events associated with the changing the Multinomial probabilities or x-values.
 double[][] getCorrelation()
           
 double[][] getCovariance()
           
 double getDensity(double x)
          Define the Multinomial getDensity function
 double getDensity(int[] x)
          This method computes the density function of the Negative Multinomail distribution
 int getGamma()
          Returns the parameter gamma of this object.
 double[] getMLE(int[][] x, int n, int d)
          MLE estimates of the NMD parameters P_hat
 java.lang.String getNegativeMultiNomialTestResults()
          This method returns a Text Array with All cumulative Negative-Multinomial results
 java.lang.String getOnlineDescription()
          This method returns an online description of this distribution.
 double[] getP()
          Returns the parameter vector p of this object.
 double[] getProbabilities()
          Returns the parameter gamma of this object.
 int[] getXvalues()
          This method gets the array of Negative Multinomail parameters (x-Values[]).
 int getXvaluesSum()
          This method gets the array of Multinomail parameters (x-Values[]).
 void initialize()
          used for some subclass to initialize before being used
 void setParameters(int gamma, double[] p, int[] x)
          Sets the parameters gamma and p of this object.
 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, getMean, getMedian, getMGF, getMgfDomain, getName, 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
 

Field Detail

gamma

protected int gamma

dimension

protected int dimension

k

protected int k

p

protected double[] p

x

protected int[] x

type

public int type
Constructor Detail

NegativeMultiNomialDistribution

public NegativeMultiNomialDistribution()
This default constructor creates a new MultiNomialDistribution(2, {0.5, 0.5})


NegativeMultiNomialDistribution

public NegativeMultiNomialDistribution(int gamma,
                                       double[] p,
                                       int[] x)
This general constructor creates a new NegativeMultiNomialDistribution with specified parameters:

Parameters:
n - Total Sum of X-values (Frequencies)
p - array of Probabilities/likelihoods of all outcomes
x - x-vector

NegativeMultiNomialDistribution

public NegativeMultiNomialDistribution(int gamma,
                                       double[] p)
Creates a NegativeMultinomial Distribution object with parameters

Parameters:
gamma -
p - outcome probabilities
Method Detail

getDensity

public double getDensity(int[] x)
This method computes the density function of the Negative Multinomail distribution

Parameters:
x - a vector of outcomes i
Returns:
the probability density of the vector x

getCovariance

public double[][] getCovariance()

getCorrelation

public double[][] getCorrelation()

getMLE

public double[] getMLE(int[][] x,
                       int n,
                       int d)
MLE estimates of the NMD parameters P_hat

Parameters:
x - the list of observations used to evaluate parameters
n - the number of observations used to evaluate parameters
d - the dimension of each vector
Returns:
returns the parameters This getMLE() method needs to become static, after we fix this problem with the MLE estiamte of parameter[0] !!! See below.

getGamma

public int getGamma()
Returns the parameter gamma of this object.

Returns:
gamma

getProbabilities

public double[] getProbabilities()
Returns the parameter gamma of this object.

Returns:
gamma

getP

public double[] getP()
Returns the parameter vector p of this object.

Returns:
double[] p (probabilities vector)

setParameters

public void setParameters(int gamma,
                          double[] p,
                          int[] x)
Sets the parameters gamma and p of this object.

Parameters:
gamma - gamma = x[0]
double[] - p probability vector
double[] - x frequencies vector

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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This method handles the events associated with the changing the Multinomial probabilities or x-values.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the action event

getXvalues

public int[] getXvalues()
This method gets the array of Negative Multinomail parameters (x-Values[]).

Returns:
xValues the array of the X-values of the Multinomial Distributions

getXvaluesSum

public int getXvaluesSum()
This method gets the array of Multinomail parameters (x-Values[]).

Returns:
xValuesSum the Sum of the array of the X-values of the Multinomial Distributions

getDensity

public double getDensity(double x)
Define the Multinomial getDensity function

Specified by:
getDensity in class Distribution

getNegativeMultiNomialTestResults

public java.lang.String getNegativeMultiNomialTestResults()
This method returns a Text Array with All cumulative Negative-Multinomial results


getOnlineDescription

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

Overrides:
getOnlineDescription in class Distribution