| Modifier and Type | Field and Description |
|---|---|
protected HashMap<Sequence,double[]> |
gammas
Contains the emission sequences and corresponding gammas (state-posteriors) required for the estimation of the standard deviation.
|
| Constructor and Description |
|---|
MultivariateGaussianEmission(double[] mean,
double[] sds,
double[][] correlation,
double scaleMean,
double[] aprioriMean,
double shapeSd,
double[][] scaleSd)
Creates a Multivariate Gaussian emission density.
|
MultivariateGaussianEmission(StringBuffer xml)
Creates a
MultivariateGaussianEmission from its XML representation. |
| Modifier and Type | Method and Description |
|---|---|
void |
addToStatistic(boolean forward,
int startPos,
int endPos,
double weight,
Sequence seq)
This method adds the
weight to the internal sufficient statistic. |
MultivariateGaussianEmission |
clone() |
void |
estimateFromStatistic()
This method estimates the parameters from the internal sufficient statistic.
|
protected void |
fromXML(StringBuffer xml)
Parses the XML representation.
|
AlphabetContainer |
getAlphabetContainer()
This method returns the
AlphabetContainer of this emission. |
double |
getLogPriorTerm()
Returns a value that is proportional to the log of the prior.
|
double |
getLogProbFor(boolean forward,
int startPos,
int endPos,
Sequence seq)
This method computes the logarithm of the likelihood.
|
String |
getNodeLabel(double weight,
String name,
NumberFormat nf)
Returns the graphviz label of the node containing this emission.
|
String |
getNodeShape(boolean forward)
Returns the graphviz string for the shape of the node.
|
void |
initializeFunctionRandomly()
This method initializes the emission randomly.
|
void |
joinStatistics(Emission... emissions)
This method joins the statistics of different instances and sets this joined statistic as statistic of each instance.
|
void |
resetStatistic()
This method resets the internal sufficient statistic.
|
void |
setParameters(Emission t)
Set values of parameters of the instance to the value of the parameters of the given instance.
|
String |
toString(NumberFormat nf)
This method returns a
String representation of the instance. |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public MultivariateGaussianEmission(double[] mean,
double[] sds,
double[][] correlation,
double scaleMean,
double[] aprioriMean,
double shapeSd,
double[][] scaleSd)
mean - mean vectorsds - standard deviation vectorcorrelation - correlation matrixscaleMean - scale of a priori meanaprioriMean - a priori meanshapeSd - scale for scaleSd (a covariance matrix)scaleSd - a priori covariance matrixpublic MultivariateGaussianEmission(StringBuffer xml) throws NonParsableException
MultivariateGaussianEmission from its XML representation.xml - the XML representation.NonParsableException - if the XML representation could not be parsedpublic void addToStatistic(boolean forward,
int startPos,
int endPos,
double weight,
Sequence seq)
throws OperationNotSupportedException
Emissionweight to the internal sufficient statistic.addToStatistic in interface Emissionforward - whether to use the forward or the reverse strandstartPos - the start positionendPos - the end positionweight - the weight of the sequenceseq - the sequenceOperationNotSupportedException - if forward=false and the reverse complement of the sequence seq is not definedpublic void joinStatistics(Emission... emissions)
EmissionjoinStatistics in interface Emissionemissions - the emissions to be joinedpublic void estimateFromStatistic()
EmissionestimateFromStatistic in interface Emissionpublic AlphabetContainer getAlphabetContainer()
EmissionAlphabetContainer of this emission.getAlphabetContainer in interface EmissionAlphabetContainer of this emissionpublic double getLogPriorTerm()
EmissiongetLogPriorTerm in interface EmissionStatisticalModel.getLogPriorTerm()public double getLogProbFor(boolean forward,
int startPos,
int endPos,
Sequence seq)
throws OperationNotSupportedException
EmissiongetLogProbFor in interface Emissionforward - whether to use the forward or the reverse strandstartPos - the start positionendPos - the end positionseq - the sequenceOperationNotSupportedException - if forward=false and the reverse complement of the sequence seq is not definedpublic String getNodeLabel(double weight, String name, NumberFormat nf)
EmissiongetNodeLabel in interface Emissionweight - the weight of the node which is represented by
the color of the node, or -1 for no representation, i.e.,
white backgroundname - the name of the state using this emissionnf - the NumberFormat for formatting the textual representation of this emissionpublic String getNodeShape(boolean forward)
EmissiongetNodeShape in interface Emissionforward - if this emission is used on the forward strandpublic void initializeFunctionRandomly()
EmissioninitializeFunctionRandomly in interface Emissionpublic void resetStatistic()
EmissionresetStatistic in interface Emissionpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.protected void fromXML(StringBuffer xml) throws NonParsableException
xml - the XML representationNonParsableException - if the XML could not be parsedpublic String toString(NumberFormat nf)
EmissionString representation of the instance.toString in interface Emissionnf - the NumberFormat for the String representation of parameters or probabilitiesString representation of the instancepublic MultivariateGaussianEmission clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic void setParameters(Emission t) throws IllegalArgumentException
EmissionsetParameters in interface Emissiont - the emission with the parameters to be setIllegalArgumentException - if the assumption about the same class for given and current instance is wrong