|
||||||||||
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 ScoringFunctions that allow to score subsequences of arbitrary length. This ScoringFunction should be the super class for non-motif ScoringFunctions like homogeneous Markov models, cyclic Markov models, ...
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 that models sequence s of arbitrary length. |
protected |
VariableLengthScoringFunction(AlphabetContainer alphabets,
int length)
This is the main constructor that creates an instance that models sequence s of a given length. |
protected |
VariableLengthScoringFunction(StringBuffer source)
This is the constructor for Storable . |
Method Summary | |
---|---|
double |
getLogScore(Sequence seq,
int start)
Returns the log score for 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 log score for the sequence and fills the list 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 sequence length. |
abstract double[] |
getStationarySymbolDistribution()
This method returns the stationary symbol distribution. |
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)
alphabets
- the AlphabetContainerprotected VariableLengthScoringFunction(AlphabetContainer alphabets, int length)
alphabets
- the AlphabetContainerlength
- the length of the modeled sequencesprotected VariableLengthScoringFunction(StringBuffer source) throws NonParsableException
Storable
.
source
- the xml representation
NonParsableException
- if the 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
\frac{\partial Z(\lambda)}{\partial \lambda_{index}}
.
parameterIndex
- the index of the parameter
Exception
- if something went wrong with the Normalizationpublic 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
seq
- the sequencestart
- the startposition in the sequence
public abstract double getLogScore(Sequence seq, int start, int length)
seq
- the sequencestart
- the start indexlength
- the end index
ScoringFunction.getLogScore(Sequence, int)
public double getLogScoreAndPartialDerivation(Sequence seq, int start, IntList indices, DoubleList dList)
ScoringFunction
seq
- the sequencestart
- the startposition in the sequenceindices
- after method invocation the list should contain the indices i where \frac{\partial \log
score(seq)}{\partial \lambda_i} is not zerodList
- after method invocation the list should contain the corresponding \frac{\partial \log
score(seq)}{\partial \lambda_i}
public abstract double getLogScoreAndPartialDerivation(Sequence seq, int start, int length, IntList indices, DoubleList dList)
seq
- the sequencestart
- the start indexlength
- the end indexindices
- the list for the indices of the parametersdList
- the list for the partial derivations
ScoringFunction.getLogScoreAndPartialDerivation(Sequence, int, IntList,
DoubleList)
public abstract double[] getStationarySymbolDistribution()
de.jstacs.motifDiscovery.Mutable#expand(int, double[], double[], double)
,
de.jstacs.motifDiscovery.Mutable#shift(double[], double[], double)
and
de.jstacs.motifDiscovery.Mutable#shrink(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 |