|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.scoringFunctions.AbstractNormalizableScoringFunction
de.jstacs.scoringFunctions.AbstractVariableLengthScoringFunction
public abstract class AbstractVariableLengthScoringFunction
This abstract class implements some methods declared in NormalizableScoringFunction
based on the declaration
of methods in VariableLengthScoringFunction
.
It allows to score subsequences of arbitrary length. This NormalizableScoringFunction
should be the
super class for non-motif NormalizableScoringFunction
s like homogeneous Markov
models, cyclic Markov models, ... etc.
Field Summary |
---|
Fields inherited from class de.jstacs.scoringFunctions.AbstractNormalizableScoringFunction |
---|
alphabets, length, r |
Fields inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
---|
UNKNOWN |
Constructor Summary | |
---|---|
protected |
AbstractVariableLengthScoringFunction(AlphabetContainer alphabets)
This is the main constructor that creates an instance of a VariableLengthScoringFunction that models sequences of arbitrary
length. |
protected |
AbstractVariableLengthScoringFunction(AlphabetContainer alphabets,
int length)
This is the main constructor that creates an instance of a VariableLengthScoringFunction that models sequences of a given
length. |
protected |
AbstractVariableLengthScoringFunction(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 . |
double |
getLogScore(Sequence seq,
int start)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence . |
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. |
Methods inherited from class de.jstacs.scoringFunctions.AbstractNormalizableScoringFunction |
---|
clone, fromXML, getAlphabetContainer, getInitialClassParam, getLength, getLogScore, getLogScoreAndPartialDerivation, getNumberOfRecommendedStarts, getNumberOfStarts, isNormalized, isNormalized |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.jstacs.scoringFunctions.VariableLengthScoringFunction |
---|
getLogNormalizationConstant, getLogPartialNormalizationConstant, getLogScore, getLogScoreAndPartialDerivation, setStatisticForHyperparameters |
Methods inherited from interface de.jstacs.scoringFunctions.NormalizableScoringFunction |
---|
addGradientOfLogPriorTerm, getEss, getInitialClassParam, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter, isNormalized |
Methods inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
---|
clone, getAlphabetContainer, getCurrentParameterValues, getInstanceName, getLength, getLogScore, getLogScoreAndPartialDerivation, getNumberOfParameters, getNumberOfRecommendedStarts, initializeFunction, initializeFunctionRandomly, isInitialized, setParameters |
Methods inherited from interface de.jstacs.Storable |
---|
toXML |
Constructor Detail |
---|
protected AbstractVariableLengthScoringFunction(AlphabetContainer alphabets)
VariableLengthScoringFunction
that models sequences of arbitrary
length.
alphabets
- the AlphabetContainer
of this
VariableLengthScoringFunction
AbstractVariableLengthScoringFunction(AlphabetContainer,
int)
protected AbstractVariableLengthScoringFunction(AlphabetContainer alphabets, int length)
VariableLengthScoringFunction
that models sequences of a given
length.
alphabets
- the AlphabetContainer
of this
VariableLengthScoringFunction
length
- the length of the modeled sequencesprotected AbstractVariableLengthScoringFunction(StringBuffer source) throws NonParsableException
Storable
.
Creates a new VariableLengthScoringFunction
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()
NormalizableScoringFunction
getLogNormalizationConstant
in interface NormalizableScoringFunction
public double getLogPartialNormalizationConstant(int parameterIndex) throws Exception
NormalizableScoringFunction
parameterIndex
. This is the logarithm of the partial derivation of the
normalization constant for the parameter with index
parameterIndex
,
getLogPartialNormalizationConstant
in interface NormalizableScoringFunction
parameterIndex
- the index of the parameter
Exception
- if something went wrong with the normalizationNormalizableScoringFunction.getLogNormalizationConstant()
public double getLogScore(Sequence seq, int start)
ScoringFunction
Sequence
seq
beginning at position start
in the Sequence
.
getLogScore
in interface ScoringFunction
seq
- the Sequence
start
- the start position in the Sequence
Sequence
public double getLogScoreAndPartialDerivation(Sequence seq, int start, IntList indices, DoubleList dList)
ScoringFunction
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.
getLogScoreAndPartialDerivation
in interface ScoringFunction
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |