|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.scoringFunctions.AbstractNormalizableScoringFunction
de.jstacs.scoringFunctions.VariableLengthScoringFunction
public abstract class VariableLengthScoringFunction
This is the main class for all ScoringFunction
s that allow to score
subsequences of arbitrary length. This ScoringFunction
should be the
super class for non-motif ScoringFunction
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 |
VariableLengthScoringFunction(AlphabetContainer alphabets)
This is the main constructor that creates an instance of a VariableLengthScoringFunction that models sequences of arbitrary
length. |
protected |
VariableLengthScoringFunction(AlphabetContainer alphabets,
int length)
This is the main constructor that creates an instance of a VariableLengthScoringFunction that models sequences of a given
length. |
protected |
VariableLengthScoringFunction(StringBuffer source)
This is the constructor for the interface Storable . |
Method Summary | |
---|---|
abstract double[][][] |
getAllConditionalStationaryDistributions()
This method returns the stationary conditional distributions. |
double |
getLogScore(Sequence seq,
int start)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence . |
abstract double |
getLogScore(Sequence seq,
int start,
int length)
This method computes the logarithm of the score for a given subsequence. |
abstract double |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
int length,
IntList indices,
DoubleList dList)
This method computes the logarithm of the score and the partial derivations for a given subsequence. |
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 |
getNormalizationConstant()
Returns the sum of the scores over all sequences of the event space. |
abstract double |
getNormalizationConstant(int length)
This method returns the normalization constant for a given sequence length. |
double |
getPartialNormalizationConstant(int parameterIndex)
Returns the partial normalization constant for the parameter with index parameterIndex . |
abstract double |
getPartialNormalizationConstant(int parameterIndex,
int length)
This method returns the partial normalization constant for a given parameter index and a sequence length. |
abstract void |
setStatisticForHyperparameters(int[] length,
double[] weight)
This method sets the hyperparameters for the model parameters by evaluating the given statistic. |
Methods inherited from class de.jstacs.scoringFunctions.AbstractNormalizableScoringFunction |
---|
clone, fromXML, getAlphabetContainer, getInitialClassParam, getLength, getLogScore, getLogScoreAndPartialDerivation, getNumberOfRecommendedStarts, 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.NormalizableScoringFunction |
---|
addGradientOfLogPriorTerm, getEss, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter |
Methods inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
---|
getCurrentParameterValues, getInstanceName, getNumberOfParameters, initializeFunction, initializeFunctionRandomly, isInitialized, setParameters |
Methods inherited from interface de.jstacs.Storable |
---|
toXML |
Constructor Detail |
---|
protected VariableLengthScoringFunction(AlphabetContainer alphabets)
VariableLengthScoringFunction
that models sequences of arbitrary
length.
alphabets
- the AlphabetContainer
of this
VariableLengthScoringFunction
VariableLengthScoringFunction(AlphabetContainer,
int)
protected VariableLengthScoringFunction(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 VariableLengthScoringFunction(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 getNormalizationConstant()
NormalizableScoringFunction
public abstract double getNormalizationConstant(int length)
length
- the sequence length
NormalizableScoringFunction.getNormalizationConstant()
public double getPartialNormalizationConstant(int parameterIndex) throws Exception
NormalizableScoringFunction
parameterIndex
. This is the partial derivation of the
normalization constant for the parameter with index
parameterIndex
, in LaTex notation:
\frac{\partial Z(\lambda)}{\partial \lambda_{index}}
.
parameterIndex
- the index of the parameter
Exception
- if something went wrong with the normalizationNormalizableScoringFunction.getNormalizationConstant()
public abstract double getPartialNormalizationConstant(int parameterIndex, int length) throws Exception
parameterIndex
- the index of the parameterlength
- the sequence length
Exception
- if something went wrongNormalizableScoringFunction.getPartialNormalizationConstant(int)
public double getLogScore(Sequence seq, int start)
ScoringFunction
Sequence
seq
beginning at position start
in the Sequence
.
seq
- the Sequence
start
- the start position in the Sequence
Sequence
public abstract double getLogScore(Sequence seq, int start, int length)
seq
- the Sequence
start
- the start index in the Sequence
length
- the end index in the Sequence
ScoringFunction.getLogScore(Sequence,
int)
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.
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
\frac{\partial \log
score(seq)}{\partial \lambda_i}
is not zerodList
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
\frac{\partial \log
score(seq)}{\partial \lambda_i}
Sequence
public abstract double getLogScoreAndPartialDerivation(Sequence seq, int start, int length, IntList indices, DoubleList dList)
seq
- the Sequence
start
- the start index in the Sequence
length
- the end index in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
\frac{\partial \log
score(seq,start,length)}{\partial \lambda_i}
is not zerodList
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
\frac{\partial \log
score(seq,start,length)}{\partial \lambda_i}
ScoringFunction.getLogScoreAndPartialDerivation(Sequence, int,
IntList, DoubleList)
public abstract double[][][] getAllConditionalStationaryDistributions()
Mutable.determineNotSignificantPositions(double, double[], double[],
double[][][][], double[][][][], double)
.
Mutable
public abstract void setStatisticForHyperparameters(int[] length, double[] weight) throws Exception
length
) and how often (
weight
) they have been seen.
length
- the non-negative lengths of the sequencesweight
- the non-negative weight for the corresponding sequence
Exception
- if something went wrongMutable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |