public class MixtureDistribution extends Object implements ProbabilityDensityFunction, LogProbabilityDensityFunction
Modifier and Type | Field and Description |
---|---|
protected ProbabilityDensityFunction[] |
pdfs |
double[] |
weights |
Constructor and Description |
---|
MixtureDistribution(ProbabilityDensityFunction[] pdfs) |
MixtureDistribution(ProbabilityDensityFunction[] pdfs,
double[] weights)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getNumOfComponents() |
ProbabilityDensityFunction |
getPdf(int idx) |
double |
getWeight(int idx) |
double[] |
getWeights() |
double |
log_p(Jama.Matrix x)
Evaluate natural logarithm of p(X) at location x. log(P(X=x))
|
void |
normalizeWeights()
Normalize weights
|
double |
p(Jama.Matrix x)
Evaluate p(X) at location x.
|
void |
setPdf(int idx,
ProbabilityDensityFunction pdf) |
void |
setWeight(int idx,
double weight) |
void |
setWeights(double[] weights) |
protected ProbabilityDensityFunction[] pdfs
public double[] weights
public MixtureDistribution(ProbabilityDensityFunction[] pdfs)
public MixtureDistribution(ProbabilityDensityFunction[] pdfs, double[] weights) throws IllegalArgumentException
pdfs
- individual distributions in the mixtureweights
- weights of the individual distributionsIllegalArgumentException
- if pdf- and weight-array have different lengthpublic double p(Jama.Matrix x)
EvaluatableDistribution
p
in interface EvaluatableDistribution<Jama.Matrix>
x
- realization of random variable Xpublic double log_p(Jama.Matrix x)
LogEvaluatableDistribution
log_p
in interface LogEvaluatableDistribution<Jama.Matrix>
x
- realization of random variable Xpublic void normalizeWeights()
public int getNumOfComponents()
public double getWeight(int idx)
public void setWeight(int idx, double weight)
public double[] getWeights()
public void setWeights(double[] weights)
public ProbabilityDensityFunction getPdf(int idx)
public void setPdf(int idx, ProbabilityDensityFunction pdf)
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.