public abstract class AbstractVariableLengthDiffSM extends AbstractDifferentiableStatisticalModel implements VariableLengthDiffSM
DifferentiableStatisticalModel
based on the declaration
of methods in VariableLengthDiffSM
.
It allows to score subsequences of arbitrary length. This DifferentiableStatisticalModel
should be the
super class for non-motif DifferentiableStatisticalModel
s like homogeneous Markov
models, cyclic Markov models, ... etc.alphabets, length, r
UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
AbstractVariableLengthDiffSM(AlphabetContainer alphabets)
This is the main constructor that creates an instance of a
VariableLengthDiffSM that models sequences of arbitrary
length. |
protected |
AbstractVariableLengthDiffSM(AlphabetContainer alphabets,
int length)
This is the main constructor that creates an instance of a
VariableLengthDiffSM that models sequences of a given
length. |
protected |
AbstractVariableLengthDiffSM(StringBuffer source)
This is the constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
double |
getLogNormalizationConstant()
Returns the logarithm of the sum of the scores over all sequences of the event space.
|
double |
getLogPartialNormalizationConstant(int parameterIndex)
Returns the logarithm of the partial normalization constant for the parameter with index
parameterIndex . |
abstract double |
getLogScoreAndPartialDerivation(Sequence seq,
int startpos,
int endpos,
IntList indices,
DoubleList partialDer)
|
double |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList dList)
|
double |
getLogScoreFor(Sequence seq,
int start)
|
abstract double |
getLogScoreFor(Sequence seq,
int startpos,
int endpos)
|
clone, emitDataSet, getInitialClassParam, getLogProbFor, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, isNormalized, isNormalized
fromXML, getAlphabetContainer, getCharacteristics, getLength, getLogScoreAndPartialDerivation, getLogScoreFor, getNumberOfRecommendedStarts, getNumberOfStarts, getNumericalCharacteristics, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLogNormalizationConstant, getLogPartialNormalizationConstant, setStatisticForHyperparameters
addGradientOfLogPriorTerm, getESS, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter, isNormalized
clone, getCurrentParameterValues, getInitialClassParam, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, setParameters
emitDataSet, getLogProbFor, getLogProbFor, getLogProbFor, getMaximalMarkovOrder
getAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized, toString
protected AbstractVariableLengthDiffSM(AlphabetContainer alphabets)
VariableLengthDiffSM
that models sequences of arbitrary
length.alphabets
- the AlphabetContainer
of this
VariableLengthDiffSM
AbstractVariableLengthDiffSM(AlphabetContainer,
int)
protected AbstractVariableLengthDiffSM(AlphabetContainer alphabets, int length)
VariableLengthDiffSM
that models sequences of a given
length.alphabets
- the AlphabetContainer
of this
VariableLengthDiffSM
length
- the length of the modeled sequencesprotected AbstractVariableLengthDiffSM(StringBuffer source) throws NonParsableException
Storable
.
Creates a new VariableLengthDiffSM
out of its XML
representation.source
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsed.public double getLogNormalizationConstant()
DifferentiableStatisticalModel
getLogNormalizationConstant
in interface DifferentiableStatisticalModel
public double getLogPartialNormalizationConstant(int parameterIndex) throws Exception
DifferentiableStatisticalModel
parameterIndex
. This is the logarithm of the partial derivation of the
normalization constant for the parameter with index
parameterIndex
,
getLogPartialNormalizationConstant
in interface DifferentiableStatisticalModel
parameterIndex
- the index of the parameterException
- if something went wrong with the normalizationDifferentiableStatisticalModel.getLogNormalizationConstant()
public double getLogScoreFor(Sequence seq, int start)
SequenceScore
getLogScoreFor
in interface SequenceScore
seq
- the Sequence
start
- the start position in the Sequence
Sequence
public double getLogScoreAndPartialDerivation(Sequence seq, int start, IntList indices, DoubleList dList)
DifferentiableSequenceScore
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.getLogScoreAndPartialDerivation
in interface DifferentiableSequenceScore
seq
- the Sequence
start
- the start position in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
dList
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
Sequence
public abstract double getLogScoreFor(Sequence seq, int startpos, int endpos)
SequenceScore
getLogScoreFor
in interface SequenceScore
getLogScoreFor
in interface VariableLengthDiffSM
getLogScoreFor
in class AbstractDifferentiableSequenceScore
seq
- the Sequence
startpos
- the start position in the Sequence
endpos
- the end position (inclusive) in the Sequence
Sequence
public abstract double getLogScoreAndPartialDerivation(Sequence seq, int startpos, int endpos, IntList indices, DoubleList partialDer)
DifferentiableSequenceScore
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.getLogScoreAndPartialDerivation
in interface DifferentiableSequenceScore
getLogScoreAndPartialDerivation
in interface VariableLengthDiffSM
getLogScoreAndPartialDerivation
in class AbstractDifferentiableSequenceScore
seq
- the Sequence
startpos
- the start position in the Sequence
endpos
- the end position (inclusive) in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
partialDer
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
Sequence