|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission
de.jstacs.models.hmm.states.emissions.discrete.DiscreteEmission
de.jstacs.models.hmm.states.emissions.discrete.PhyloDiscreteEmission
public class PhyloDiscreteEmission
Phylogenetic discrete emission This class uses a phylogenetic tree to describe multidimensional data It implements Felsensteins model for nucleotide substitution (F81)
| Field Summary |
|---|
| Fields inherited from class de.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission |
|---|
con, counter, ess, grad, hyperParams, logNorm, offset, params, paramsFile, probs, reader, samplingIndex, statistic, writer |
| Constructor Summary | |
|---|---|
PhyloDiscreteEmission(AlphabetContainer con,
double[] hyperParams,
PhyloTree t)
This is a simple constructor for a DiscreteEmission defining the individual hyper parameters. |
|
PhyloDiscreteEmission(AlphabetContainer con,
double ess,
PhyloTree t)
This is a simple constructor for a PhyloDiscreteEmission based on the equivalent sample size. |
|
| Method Summary | |
|---|---|
void |
addGradientOfLogPriorTerm(double[] gradient,
int offset)
This method computes the gradient of Emission.getLogPriorTerm() for each
parameter of this model. |
void |
addToStatistic(boolean forward,
int startPos,
int endPos,
double weight,
Sequence seq)
This method adds the weight to the internal sufficient statistic. |
protected void |
appendFurtherInformation(StringBuffer xml)
This method appends further information to the XML representation. |
PhyloDiscreteEmission |
clone()
|
void |
estimateFromStatistic()
This method estimates the parameters from the internal sufficient statistic. |
protected void |
extractFurtherInformation(StringBuffer xml)
This method extracts further information from the XML representation. |
double |
getLogGammaScoreFromStatistic()
This method calculates a score for the current statistics, which is independent from the current parameters In general the gamma-score is a product of gamma-functions parameterized with the current statistics |
double |
getLogPosteriorFromStatistic()
This method calculates the a-posteriori probability for the current statistics |
double |
getLogProbAndPartialDerivationFor(boolean forward,
int startPos,
int endPos,
IntList indices,
DoubleList partDer,
Sequence seq)
Returns the logarithmic score for a Sequence beginning at
position start in the Sequence and fills lists with
the indices and the partial derivations. |
double |
getLogProbFor(boolean forward,
int startPos,
int endPos,
Sequence seq)
This method computes the logarithm of the likelihood. |
double |
getLogProposalPosteriorFromStatistic()
Returns the log posterior of the proposal distribution for the current statistic |
void |
resetStatistic()
This method resets the internal sufficient statistic. |
| Methods inherited from class de.jstacs.models.hmm.states.emissions.discrete.DiscreteEmission |
|---|
getConditionIndex, toString |
| Methods inherited from class de.jstacs.models.hmm.states.emissions.discrete.AbstractConditionalDiscreteEmission |
|---|
acceptParameters, drawParametersFromStatistic, extendSampling, fillCurrentParameter, fillSamplingGroups, finalize, fromXML, getAlphabetContainer, getHyperParams, getLogPriorTerm, getNodeLabel, getNodeShape, getNumberOfParameters, getSizeOfEventSpace, initForSampling, initializeFunctionRandomly, isInSamplingMode, parseNextParameterSet, parseParameterSet, precompute, samplingStopped, setLinear, setParameter, setParameterOffset, setShape, toXML |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.jstacs.sampling.SamplingFromStatistic |
|---|
drawParametersFromStatistic |
| Methods inherited from interface de.jstacs.sampling.SamplingComponent |
|---|
acceptParameters, extendSampling, initForSampling, isInSamplingMode, parseNextParameterSet, parseParameterSet, samplingStopped |
| Methods inherited from interface de.jstacs.models.hmm.states.emissions.Emission |
|---|
getAlphabetContainer, getLogPriorTerm, getNodeLabel, getNodeShape, initializeFunctionRandomly |
| Methods inherited from interface de.jstacs.Storable |
|---|
toXML |
| Constructor Detail |
|---|
public PhyloDiscreteEmission(AlphabetContainer con,
double ess,
PhyloTree t)
PhyloDiscreteEmission based on the equivalent sample size.
con - the AlphabetContainer of this emissioness - the equivalent sample size (ess) of this emission that is equally distributed over all parameterst - the phylogenetic tree PhyloTree
public PhyloDiscreteEmission(AlphabetContainer con,
double[] hyperParams,
PhyloTree t)
DiscreteEmission defining the individual hyper parameters.
con - the AlphabetContainer of this emissionhyperParams - the individual hyper parameters for each parametert - the phylogenetic tree PhyloTree| Method Detail |
|---|
public PhyloDiscreteEmission clone()
throws CloneNotSupportedException
clone in class AbstractConditionalDiscreteEmissionCloneNotSupportedException
public double getLogProbFor(boolean forward,
int startPos,
int endPos,
Sequence seq)
throws OperationNotSupportedException
Emission
getLogProbFor in interface EmissiongetLogProbFor in class AbstractConditionalDiscreteEmissionforward - whether to use the forward or the reverse strandstartPos - the start positionendPos - the end positionseq - the sequence
OperationNotSupportedException - if forward=false and the reverse complement of the sequence seq is not defined
public double getLogProbAndPartialDerivationFor(boolean forward,
int startPos,
int endPos,
IntList indices,
DoubleList partDer,
Sequence seq)
throws OperationNotSupportedException
DifferentiableEmissionSequence beginning at
position start in the Sequence and fills lists with
the indices and the partial derivations.
getLogProbAndPartialDerivationFor in interface DifferentiableEmissiongetLogProbAndPartialDerivationFor in class AbstractConditionalDiscreteEmissionforward - a switch whether to use the forward or the reverse complementary strand of the sequencestartPos - the start position in the SequenceendPos - the end position in the Sequenceindices - an IntList of indices, after method invocation the
list should contain the indices i where
is not zeropartDer - a DoubleList of partial derivations, after method
invocation the list should contain the corresponding
that are not zeroseq - the Sequence
Sequence
OperationNotSupportedException - if forward==false and the reverse complement of the sequence can not be computed
public void addGradientOfLogPriorTerm(double[] gradient,
int offset)
DifferentiableEmissionEmission.getLogPriorTerm() for each
parameter of this model. The results are added to the array
grad beginning at index (offset + internal offset).
addGradientOfLogPriorTerm in interface DifferentiableEmissionaddGradientOfLogPriorTerm in class AbstractConditionalDiscreteEmissiongradient - the array of gradientsoffset - the start index of the HMM in the grad array, where the
partial derivations for the parameters of the HMM shall be
enteredEmission.getLogPriorTerm(),
DifferentiableEmission.setParameterOffset(int)public void estimateFromStatistic()
Emission
estimateFromStatistic in interface EmissionestimateFromStatistic in class AbstractConditionalDiscreteEmissionprotected void appendFurtherInformation(StringBuffer xml)
AbstractConditionalDiscreteEmission
appendFurtherInformation in class AbstractConditionalDiscreteEmissionxml - the XML representation
protected void extractFurtherInformation(StringBuffer xml)
throws NonParsableException
AbstractConditionalDiscreteEmission
extractFurtherInformation in class AbstractConditionalDiscreteEmissionxml - the XML representation
NonParsableException - if the information could not be reconstructed out of the StringBuffer xmlpublic double getLogProposalPosteriorFromStatistic()
public double getLogPosteriorFromStatistic()
SamplingFromStatistic
getLogPosteriorFromStatistic in interface SamplingFromStatisticgetLogPosteriorFromStatistic in class AbstractConditionalDiscreteEmissionpublic void resetStatistic()
Emission
resetStatistic in interface EmissionresetStatistic in class AbstractConditionalDiscreteEmission
public void addToStatistic(boolean forward,
int startPos,
int endPos,
double weight,
Sequence seq)
throws OperationNotSupportedException
Emissionweight to the internal sufficient statistic.
addToStatistic in interface EmissionaddToStatistic in class AbstractConditionalDiscreteEmissionforward - whether to use the forward or the reverse strandstartPos - the start positionendPos - the end positionweight - the weight of the sequenceseq - the sequence
OperationNotSupportedException - if forward=false and the reverse complement of the sequence seq is not definedpublic double getLogGammaScoreFromStatistic()
SamplingEmission
getLogGammaScoreFromStatistic in interface SamplingEmissiongetLogGammaScoreFromStatistic in class AbstractConditionalDiscreteEmission
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||