de.jstacs.sequenceScores.statisticalModels.differentiable.mixture
Class VariableLengthMixtureDiffSM
java.lang.Object
de.jstacs.sequenceScores.differentiable.AbstractDifferentiableSequenceScore
de.jstacs.sequenceScores.statisticalModels.differentiable.AbstractDifferentiableStatisticalModel
de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.AbstractMixtureDiffSM
de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.MixtureDiffSM
de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.VariableLengthMixtureDiffSM
- All Implemented Interfaces:
- MotifDiscoverer, MutableMotifDiscoverer, DifferentiableSequenceScore, SequenceScore, DifferentiableStatisticalModel, SamplingDifferentiableStatisticalModel, VariableLengthDiffSM, StatisticalModel, Storable, Cloneable
public class VariableLengthMixtureDiffSM
- extends MixtureDiffSM
- implements VariableLengthDiffSM
This class implements a mixture of VariableLengthDiffSM
by extending MixtureDiffSM
and implementing the methods of VariableLengthDiffSM
.
- Author:
- Jens Keilwagen
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.AbstractMixtureDiffSM |
componentScore, dList, freeParams, function, hiddenParameter, hiddenPotential, iList, logGammaSum, logHiddenNorm, logHiddenPotential, norm, optimizeHidden, paramRef, partNorm |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.MixtureDiffSM |
adjustHiddenParameters, clone, fillComponentScores, getESS, getGlobalIndexOfMotifInComponent, getHyperparameterForHiddenParameter, getIndexOfMaximalComponentFor, getInstanceName, getLogNormalizationConstantForComponent, getLogPartialNormalizationConstant, getLogScoreAndPartialDerivation, getMotifLength, getNumberOfMotifs, getNumberOfMotifsInComponent, getProfileOfScoresFor, getStrandProbabilitiesFor, initializeMotif, initializeMotifRandomly, initializeUsingPlugIn, modifyMotif, toString |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.mixture.AbstractMixtureDiffSM |
addGradientOfLogPriorTerm, cloneFunctions, computeHiddenParameter, computeLogGammaSum, determineIsNormalized, extractFurtherInformation, fromXML, getCurrentParameterValues, getDifferentiableStatisticalModels, getFunction, getFunctions, getFurtherInformation, getIndexOfMaximalComponentFor, getIndices, getLogNormalizationConstant, getLogPriorTerm, getLogScoreFor, getNumberOfComponents, getNumberOfParameters, getNumberOfRecommendedStarts, getProbsForComponent, getSamplingGroups, getSizeOfEventSpaceForRandomVariablesOfParameter, getXMLTag, init, initializeFunction, initializeFunctionRandomly, initializeHiddenPotentialRandomly, initializeHiddenUniformly, initWithLength, isInitialized, isNormalized, precomputeNorm, setHiddenParameters, setParameters, setParametersForFunction, toXML |
Methods inherited from interface de.jstacs.sequenceScores.SequenceScore |
getAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized, toString |
VariableLengthMixtureDiffSM
public VariableLengthMixtureDiffSM(int starts,
boolean plugIn,
VariableLengthDiffSM... component)
throws CloneNotSupportedException
- This constructor creates a new
VariableLengthMixtureDiffSM
.
- Parameters:
starts
- the number of starts that should be done in an optimizationplugIn
- indicates whether the initial parameters for an optimization
should be related to the data or randomly drawncomponent
- the VariableLengthDiffSM
s
- Throws:
CloneNotSupportedException
- if an element of component
could not be cloned
VariableLengthMixtureDiffSM
public VariableLengthMixtureDiffSM(StringBuffer xml)
throws NonParsableException
- This is the constructor for the interface
Storable
.
Creates a new VariableLengthMixtureDiffSM
out of a
StringBuffer
.
- Parameters:
xml
- the XML representation as StringBuffer
- Throws:
NonParsableException
- if the XML representation could not be parsed
getLogScoreFor
public double getLogScoreFor(Sequence seq,
int start,
int end)
- Description copied from interface:
SequenceScore
- Returns the logarithmic score for the
Sequence
seq
beginning at position start
in the Sequence
.
- Specified by:
getLogScoreFor
in interface SequenceScore
- Specified by:
getLogScoreFor
in interface VariableLengthDiffSM
- Overrides:
getLogScoreFor
in class AbstractDifferentiableSequenceScore
- Parameters:
seq
- the Sequence
start
- the start position in the Sequence
end
- the end position (inclusive) in the Sequence
- Returns:
- the logarithmic score for the
Sequence
getLogScoreAndPartialDerivation
public double getLogScoreAndPartialDerivation(Sequence seq,
int start,
int end,
IntList indices,
DoubleList partialDer)
- Description copied from interface:
DifferentiableSequenceScore
- Returns the logarithmic score for a
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.
- Specified by:
getLogScoreAndPartialDerivation
in interface DifferentiableSequenceScore
- Specified by:
getLogScoreAndPartialDerivation
in interface VariableLengthDiffSM
- Overrides:
getLogScoreAndPartialDerivation
in class AbstractDifferentiableSequenceScore
- Parameters:
seq
- the Sequence
start
- the start position in the Sequence
end
- the end position (inclusive) in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
is not zeropartialDer
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
that are not zero
- Returns:
- the logarithmic score for the
Sequence
getLogNormalizationConstant
public double getLogNormalizationConstant(int length)
- Description copied from interface:
VariableLengthDiffSM
- This method returns the logarithm of the normalization constant for a given sequence
length.
- Specified by:
getLogNormalizationConstant
in interface VariableLengthDiffSM
- Parameters:
length
- the sequence length
- Returns:
- the logarithm of the normalization constant
- See Also:
DifferentiableStatisticalModel.getLogNormalizationConstant()
getLogPartialNormalizationConstant
public double getLogPartialNormalizationConstant(int parameterIndex,
int length)
throws Exception
- Description copied from interface:
VariableLengthDiffSM
- This method returns the logarithm of the partial normalization constant for a given
parameter index and a sequence length.
- Specified by:
getLogPartialNormalizationConstant
in interface VariableLengthDiffSM
- Parameters:
parameterIndex
- the index of the parameterlength
- the sequence length
- Returns:
- the logarithm of the partial normalization constant
- Throws:
Exception
- if something went wrong- See Also:
DifferentiableStatisticalModel.getLogPartialNormalizationConstant(int)
setStatisticForHyperparameters
public void setStatisticForHyperparameters(int[] length,
double[] weight)
throws Exception
- Description copied from interface:
VariableLengthDiffSM
- This method sets the hyperparameters for the model parameters by
evaluating the given statistic. The statistic can be interpreted as
follows: The model has seen a number of sequences. From these sequences
it is only known how long (
length
) and how often (
weight
) they have been seen.
- Specified by:
setStatisticForHyperparameters
in interface VariableLengthDiffSM
- Parameters:
length
- the non-negative lengths of the sequencesweight
- the non-negative weight for the corresponding sequence
- Throws:
Exception
- if something went wrong- See Also:
Mutable