|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucla.stat.SOCR.core.SOCRValueSettable edu.ucla.stat.SOCR.core.Distribution edu.ucla.stat.SOCR.distributions.MultiNomialDistribution
public class MultiNomialDistribution
The Multinomial distribution with parameter-vector (k,p), where n=number of trials and event-probabilities p=(p1, p2, ..., pn), with sum(p_k)=1 and p_k>=0, 1<=k<=n. http://en.wikipedia.org/wiki/Multinomial_distribution is a generalization of the binomial distribution.
Field Summary | |
---|---|
protected int |
k
|
protected int |
n
|
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 | |
---|---|
MultiNomialDistribution()
This default constructor creates a new MultiNomialDistribution(2, {0.5, 0.5}) |
|
MultiNomialDistribution(int n,
double[] p,
int[] x)
This general constructor creates a new MultiNomialDistribution 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 |
getCDF(int[] x)
|
static double |
getCDF(int n,
double[] p,
int[] x)
http://controls.engin.umich.edu/wiki/index.php/Multinomial_distributions |
double[][] |
getCorrelation()
|
static double[][] |
getCorrelation(int n,
double[] p)
|
double[][] |
getCovariance()
This method returns the variance-covariance matrix of the Multinomail distribution, which is defined as sigma(i,j) = E[(Xi - mu(i))(Xj - mu(j))]. |
static double[][] |
getCovariance(int n,
double[] p)
|
double |
getDensity(double x)
Define the Multinomial getDensity function |
double |
getDensity(int[] x)
This method computes the density function of the Multinomail distribution |
static double[] |
getMean(int n,
double[] p)
|
static double[] |
getMLE(int[][] x,
int m,
int d,
int n)
This method returns the array of MLE estimates for the Mulinomial Probabilities. |
java.lang.String |
getMultiNomialTestResults()
This method returns a Text Array with All cumulative Multinomial results |
int |
getN()
|
java.lang.String |
getOnlineDescription()
This method returns an online description of this distribution. |
double[] |
getP()
|
double[] |
getProbabilities()
This method gets the array of Multinomail parameters (probabilities[]). |
double |
getProbability(int[] x)
|
static double |
getProbability(int n,
double[] p,
int[] x)
This method computes the density function of the Multinomail distribution |
int[] |
getXvalues()
This method gets the array of 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 n,
double[] p,
int[] x)
|
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 |
---|
protected int k
protected int n
protected double[] p
protected int[] x
public int type
Constructor Detail |
---|
public MultiNomialDistribution(int n, double[] p, int[] x)
n
- Total Sum of X-values (Frequencies)p
- array of Probabilities/likelihoods of all outcomespublic MultiNomialDistribution()
Method Detail |
---|
public void initialize()
Distribution
initialize
in class Distribution
public void valueChanged()
valueChanged
in class Distribution
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the action eventpublic double[] getProbabilities()
probabilities
- the array of the probailities of the Multinomial Distributionspublic int[] getXvalues()
public int getXvaluesSum()
public double getProbability(int[] x)
public double getDensity(double x)
getDensity
in class Distribution
public int getN()
public double[] getP()
public double getCDF(int[] x)
public double[][] getCovariance()
public double[][] getCorrelation()
public double getDensity(int[] x)
x
- a vector of outcomes i
public static double getProbability(int n, double[] p, int[] x)
n
- Total sum ov x-values vector (total frequenciesp
- multinomial probabilitiesx
- X-values (frequency) vector
public static double getCDF(int n, double[] p, int[] x)
n
- total sum of the x-value (frequency) vectorp
- Multinomial Probabilitiesx
- X-values (frequencies)
public static double[] getMean(int n, double[] p)
public static double[][] getCovariance(int n, double[] p)
public static double[][] getCorrelation(int n, double[] p)
public java.lang.String getMultiNomialTestResults()
public static double[] getMLE(int[][] x, int m, int d, int n)
x
- double array of X-values -- list of observations used to evaluate prob-parametersm
- the number of observations used to evaluate parametersd
- the dimension of each observationn
- the number of independent trials for each series
public void setParameters(int n, double[] p, int[] x)
public java.lang.String getOnlineDescription()
getOnlineDescription
in class Distribution
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |