|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.sequenceScores.differentiable.AbstractDifferentiableSequenceScore
de.jstacs.sequenceScores.statisticalModels.differentiable.AbstractDifferentiableStatisticalModel
de.jstacs.sequenceScores.statisticalModels.differentiable.AbstractVariableLengthDiffSM
public abstract class AbstractVariableLengthDiffSM
This abstract class implements some methods declared in 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.
Field Summary |
---|
Fields inherited from class de.jstacs.sequenceScores.differentiable.AbstractDifferentiableSequenceScore |
---|
alphabets, length, r |
Fields inherited from interface de.jstacs.sequenceScores.differentiable.DifferentiableSequenceScore |
---|
UNKNOWN |
Constructor Summary | |
---|---|
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 . |
Method Summary | |
---|---|
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)
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 |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList dList)
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 |
getLogScoreFor(Sequence seq,
int start)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence . |
abstract double |
getLogScoreFor(Sequence seq,
int startpos,
int endpos)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence . |
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.AbstractDifferentiableStatisticalModel |
---|
clone, emitDataSet, getInitialClassParam, getLogProbFor, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, isNormalized, isNormalized |
Methods inherited from class de.jstacs.sequenceScores.differentiable.AbstractDifferentiableSequenceScore |
---|
fromXML, getAlphabetContainer, getCharacteristics, getLength, getLogScoreAndPartialDerivation, getLogScoreFor, getNumberOfRecommendedStarts, getNumberOfStarts, getNumericalCharacteristics |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.differentiable.VariableLengthDiffSM |
---|
getLogNormalizationConstant, getLogPartialNormalizationConstant, setStatisticForHyperparameters |
Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.differentiable.DifferentiableStatisticalModel |
---|
addGradientOfLogPriorTerm, getESS, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter, isNormalized |
Methods inherited from interface de.jstacs.sequenceScores.differentiable.DifferentiableSequenceScore |
---|
clone, getCurrentParameterValues, getInitialClassParam, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, setParameters |
Methods inherited from interface de.jstacs.sequenceScores.statisticalModels.StatisticalModel |
---|
emitDataSet, getLogProbFor, getLogProbFor, getLogProbFor, getMaximalMarkovOrder |
Methods inherited from interface de.jstacs.sequenceScores.SequenceScore |
---|
getAlphabetContainer, getCharacteristics, getInstanceName, getLength, getLogScoreFor, getLogScoreFor, getLogScoreFor, getNumericalCharacteristics, isInitialized |
Methods inherited from interface de.jstacs.Storable |
---|
toXML |
Constructor Detail |
---|
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.Method Detail |
---|
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 parameter
Exception
- if something went wrong with the normalizationDifferentiableStatisticalModel.getLogNormalizationConstant()
public double getLogScoreFor(Sequence seq, int start)
SequenceScore
Sequence
seq
beginning at position start
in the Sequence
.
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
Sequence
seq
beginning at position start
in the Sequence
.
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |