|
||||||||||
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.MixtureDistribution
public class MixtureDistribution
The Mixture distribution with parameter-vector p=(p1, p2, ..., pn) http://wiki.stat.ucla.edu/socr/index.php/SOCR_EduMaterials_Activities_2D_PointSegmentation_EM_Mixture is the (linear) mixure of an array of distributions according to the mixing parameters.
Field Summary |
---|
Fields inherited from class edu.ucla.stat.SOCR.core.Distribution |
---|
applet, CONTINUOUS, DISCRETE, MAXMGFXVAL, MAXMGFYVAL, MINMGFXVAL, MIXED, name |
Constructor Summary | |
---|---|
MixtureDistribution()
This default constructor creates the mixture of two standard normal distributions with equal mixing parameters. |
|
MixtureDistribution(Distribution[] d,
double[] p)
This general constructor creates the mixture of a given array of distributitons using a given array of probabilities as the mixing parameters. |
|
MixtureDistribution(Distribution d0,
Distribution d1)
This special constructor creates the mixture of two distributions with equal mixing probabilities |
|
MixtureDistribution(Distribution d0,
Distribution d1,
double a)
This special constructor creates the mixture of two distributions using a specified number and its complement as the mixing probabilities. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
This method handles the events associated with the die probabilities button and with the step timer. |
double |
getCDF(double x)
This method computes the cumulative distributions function of the mixture distributions as a linear combination of the CDFs of the given distributions, using the mixing probabilities. |
double |
getDensity(double x)
This method computes the density function of the mixture distributions as a linear combination of the densities of the given distributions using the mixing probabilities. |
Distribution[] |
getDistributions()
This method returns the array of distributions. |
Distribution |
getDistributions(int i)
This method returns a particular distribution. |
double |
getMean()
This method computes the mean of the mixture distributions as a linear combination of the means of the given distributions, using the mixing probabilities. |
double[][] |
getMeansSDsWeights()
This method gets up the 3 arrays of mixture parameters (Means[], SDs[] and Weights[]). |
java.lang.String |
getOnlineDescription()
This method returns an online description of this distribution. |
double[] |
getProbabilities()
This method returns the array of probabilities. |
double |
getProbability(int i)
This method returns a particular probability . |
double |
getVariance()
This method computes the variance of the mixture distributions in terms of the variances and means of the given distributions and the mixing parameters. |
void |
initialize()
used for some subclass to initialize before being used |
void |
setDistributions(Distribution[] d)
This method sets the distributions. |
void |
setDistributions(int i,
Distribution d)
This method sets a particular distribution. |
void |
setMeansSDsWeights(double[] _means,
double[] _SDs,
double[] _weights)
This method sets up the 3 arrays of mixture parameters (Means[], SDs[] and Weights[]). |
void |
setParameters(Distribution[] d,
double[] p)
This method sets up the domain of the general mixture distributions in terms of the distributions being mixed. |
void |
setParameters(Distribution d0,
Distribution d1,
double a)
This method sets up the domain of for the mixture of two distributions. |
void |
setProbabilities(double[] p)
This method sets the probabilities. |
void |
setProbabilities(int i,
double p)
This method sets a particular probability. |
double |
simulate()
This method simulates a value from the mixture distributions. |
void |
valueChanged()
|
Methods inherited from class edu.ucla.stat.SOCR.core.Distribution |
---|
addObserver, betaCDF, comb, factorial, findGFRoot, findRoot, gamma, gammaCDF, getDisplayPane, getDomain, getFailureRate, getGFDerivative, getGFSecondDerivative, getInstance, getLocalHelp, getMaxDensity, getMean, getMedian, getMGF, getMgfDomain, getName, getPGF, getPGFDomain, getQuantile, getSampleMoment, getSD, 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, 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 |
---|
public MixtureDistribution(Distribution[] d, double[] p)
d
- the array of distributions to be mixedp
- the array of mixing probabilitiespublic MixtureDistribution(Distribution d0, Distribution d1, double a)
d0
- the index 0 distributionsd1
- the index 1 distributionsa
- the index 1 mixing parameter (the index 0 parameter is 1 −
a)public MixtureDistribution(Distribution d0, Distribution d1)
d0
- the index 0 distributiond1
- the index 1 distributionpublic MixtureDistribution()
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 void setParameters(Distribution[] d, double[] p)
d
- the array of distributions being mixedp
- the array of mixing probabilitiespublic double[][] getMeansSDsWeights()
means
- the arrays of the means of the Normal Distributions in the mixtureSDs
- the arrays of the Standard-Deviations of the Normal Distributions in the mixtureweights
- the arrays of the weights of the Normal Distributions in the mixturepublic void setMeansSDsWeights(double[] _means, double[] _SDs, double[] _weights)
means
- the arrays of the means of the Normal Distributions in the mixtureSDs
- the arrays of the Standard-Deviations of the Normal Distributions in the mixtureweights
- the arrays of the weights of the Normal Distributions in the mixturepublic void setParameters(Distribution d0, Distribution d1, double a)
d0
- the index 0 distributionsd1
- the index 1 distributionsa
- the index 1 mixing parameter (the index 0 parameter is 1 −
a)public double getDensity(double x)
getDensity
in class Distribution
x
- a number in the domain of the distributions
public double getCDF(double x)
getCDF
in class Distribution
public double getMean()
getMean
in class Distribution
public double getVariance()
getVariance
in class Distribution
public double simulate()
simulate
in class Distribution
public void setDistributions(Distribution[] d)
d
- the array of distributionspublic void setDistributions(int i, Distribution d)
i
- the indexd
- the distributionpublic Distribution[] getDistributions()
public Distribution getDistributions(int i)
i
- the index
public void setProbabilities(double[] p)
p
- the array of probabilitiespublic void setProbabilities(int i, double p)
i
- the indexp
- the probabilitypublic double[] getProbabilities()
public double getProbability(int i)
i
- the index
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 |