|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uah.math.distributions.Distribution
edu.uah.math.distributions.MixtureDistribution
public class MixtureDistribution
This class models a distributions which is the mixture of a given set of distributions using a given set of probabilities as the mixing parameters
| Field Summary |
|---|
| Fields inherited from class edu.uah.math.distributions.Distribution |
|---|
CONTINUOUS, DISCRETE, MIXED |
| 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 distribuitons 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 | |
|---|---|
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[] |
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 |
setDistributions(Distribution[] d)
This method sets the distributions. |
void |
setDistributions(int i,
Distribution d)
This method sets a particular distribution. |
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. |
| Methods inherited from class edu.uah.math.distributions.Distribution |
|---|
getDomain, getFailureRate, getMaxDensity, getMedian, getMGF, getMoment, getMoment, getPGF, getQuantile, getSD, getType, setDomain, setDomain, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MixtureDistribution(Distribution[] d,
double[] p)
d - the array of distributions to be mixedp - the array of mixing probabilities
public 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 setParameters(Distribution[] d,
double[] p)
d - the array of distributions being mixedp - the array of mixing probabilities
public 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 Distributionx - a number in the domain of the distributions
public double getCDF(double x)
getCDF in class Distributionx - a number in the domain of the distribution
public double getMean()
getMean in class Distributionpublic double getVariance()
getVariance in class Distributionpublic double simulate()
simulate in class Distributionpublic void setDistributions(Distribution[] d)
d - the array of distributions
public 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 probabilities
public void setProbabilities(int i,
double p)
i - the indexp - the probabilitypublic double[] getProbabilities()
public double getProbability(int i)
i - the index
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||