|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object comirva.audio.util.gmm.GaussianComponent
public final class GaussianComponent
Gaussian Component
Description:
AGaussianMixture
consists of several gaussian components, which
are modeled by this class. A gaussian component is a n-dimensional gaussian
distribution.
GaussianMixture
Constructor Summary | |
---|---|
GaussianComponent(double componentWeight,
Matrix mean,
Matrix covariances)
Creates a gaussian component and checks the component settings for correctness. |
Method Summary | |
---|---|
double |
getComponentWeight()
Computes the components weight or in other words the prior probability of being generated by component i. |
int |
getDimension()
Returns the dimension of this n-dimensional gaussian distribution. |
Matrix |
getMean()
For testing purpose only. |
static double[] |
getStandardNormalVector(int dimension)
Returns a vector, whose components are n independent standard normal variates. |
double |
getWeightedSampleProbability(Matrix x)
Returns the probability of drawing the given sample from this n-dimensional gaussian distribution weighted with the prior probability of this component. |
protected void |
maximise(PointList samplePoints,
double[] p_ij)
This method performs the maximization step for this component given the sample points and the estimates p_ij = P(C=i | x_j) for sample j of being generated by this component under the assumption that this sample has been drawn from this GMM. |
double[] |
nextSample()
Returns a sample drawn from this n-dimensional gaussian distribution. |
void |
print()
Prints some information about this component. |
static GaussianComponent |
readGC(XMLStreamReader parser)
This method allows to read a gaussian component from a xml input stream as recommended by the XMLSerializable interface. |
void |
readXML(XMLStreamReader parser)
Reads the xml representation of an object form the xml input stream. |
void |
writeXML(XMLStreamWriter writer)
Writes the xml representation of this object to the xml ouput stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GaussianComponent(double componentWeight, Matrix mean, Matrix covariances) throws IllegalArgumentException
componentWeight
- double the weight of this componentmean
- Matrix the mean vector of this componentcovariances
- Matrix the covariance matrix of this component
IllegalArgumentException
- thrown if any invalid or incorrect
settings were foundMethod Detail |
---|
public double getComponentWeight()
public double getWeightedSampleProbability(Matrix x)
x
- Matrix a sample
protected void maximise(PointList samplePoints, double[] p_ij) throws CovarianceSingularityException
samplePoints
- PointList the sample pointsp_ij
- double[] the estimates
CovarianceSingularityException
- thrown if this component got
singular during the maximization steppublic double[] nextSample()
public static double[] getStandardNormalVector(int dimension)
dimension
- int the number of components (dimensionality) of the
vector
public int getDimension()
public void print()
public Matrix getMean()
public void writeXML(XMLStreamWriter writer) throws IOException, XMLStreamException
writeXML()
method
results in one xml element in the output stream.
writeXML
in interface XMLSerializable
writer
- XMLStreamWriter the xml output stream
IOException
- raised, if there are any io troubles
XMLStreamException
- raised, if there are any parsing errorspublic void readXML(XMLStreamReader parser) throws IOException, XMLStreamException
readXML()
starts parsing by
checking the start tag of this object and finishes parsing by checking the
end tag. The caller has to ensure, that at method entry the current token
is the start tag. After the method call it's the callers responsibility to
move from the end tag to the next token.
readXML
in interface XMLSerializable
parser
- XMLStreamReader the xml input stream
IOException
- raised, if there are any io troubles
XMLStreamException
- raised, if there are any parsing errorspublic static GaussianComponent readGC(XMLStreamReader parser) throws IOException, XMLStreamException
parser
- XMLStreamReader the xml input stream
IOException
- raised, if there are any io troubles
XMLStreamException
- raised, if there are any parsing errorsXMLSerializable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |