|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SequenceModel
Generic interface for a sequence model. A sequence model defines a probability distribution over a set of sequences over a given alphabet.
Method Summary | |
---|---|
Alphabet |
getAlphabet()
Returns the base alphabet of the modelled sequences. |
double |
likelihood(Sequence word)
Returns the likelihod of the given word under this model. |
double |
likelihood(Sequence word,
int beginIndex,
int endIndex)
Returns the likelihod of the subword of the given word starting at beginIndex and ending at endIndex-1. |
double |
likelihoodThreshold(double significance)
Computes the likelihood threshold for the given significance with a default null model. |
double |
likelihoodThreshold(double significance,
SequenceModel nullModel)
Given p in [0,1], we define the p-value of p as the as the probability under a null model for a sequence to have a likelihood greater or equal to p. |
double |
positionProbability(int position,
Sequence neighbourhoodSeq,
int beginIndex,
int endIndex,
int letterPosition)
Computes the probability of observing a letter in a given position of the sequence. |
double |
prefixLikelihood(Sequence sequence)
returns the likelihod of the given prefix under this model, that is, the sum of the probabilities of all words starting with the given prefix. |
double |
prefixLikelihood(Sequence sequence,
int beginIndex,
int endIndex)
Returns the likelihod of the given prefix under this model, that is, the sum of the probabilities of all words starting with the subword of sequence starting at position beginIndex and ending at position endIndex-1. |
double |
pvalue(Sequence word)
Returns the p-value of the given word with a default null model (usually the uniform null model). |
double |
pvalue(Sequence word,
int beginIndex,
int endIndex)
Returns the p-value of the subword of the given word starting at beginIndex and ending at endIndex-1 with a default null model (typically the uniform model). |
double |
pvalue(Sequence word,
int beginIndex,
int endIndex,
SequenceModel nullModel)
Returns the p-value of the subword of the given word starting at beginIndex and ending at endIndex-1. |
double |
pvalue(Sequence word,
SequenceModel nullModel)
The p-value of a given sequence is defined as the probability under a null model for a sequence to have a likelihood greater or equal to the likelihood of the given sequence under this model. |
Sequence |
sample(int length)
Samples a sequence from this model. |
Sequence[] |
sampleN(int sampleSize,
int length)
Samples a set of i.i.d. |
Method Detail |
---|
Alphabet getAlphabet()
Sequence sample(int length)
length
- The length of the sequence to be sampled.Sequence[] sampleN(int sampleSize, int length)
sampleSize
- The number of sampled sequences.length
- The length of the sampled sequences.double likelihood(Sequence word)
double likelihood(Sequence word, int beginIndex, int endIndex)
double prefixLikelihood(Sequence sequence)
double prefixLikelihood(Sequence sequence, int beginIndex, int endIndex)
double positionProbability(int position, Sequence neighbourhoodSeq, int beginIndex, int endIndex, int letterPosition)
position
- the position at which the letter appears.neighbourhoodSeq
- A sequence containing the neighbourhood.beginIndex
- The start of the neighbourhood within neighbourhoodSeq.endIndex
- The end of the neighbourhood within neighbourhoodSeq.letterPosition
- The position of the target letter within neighbourhoodSeq.
double pvalue(Sequence word)
double pvalue(Sequence word, int beginIndex, int endIndex)
pvalue(Sequence, SequenceModel)
double pvalue(Sequence word, SequenceModel nullModel)
Suppose we have an observed sequence X and we want to perform the statistical test of whether 'X was sampled from the null model' (null hypothesis) against the alternative hypothesis 'X was sampled from this model'. Then the p-value of X is used reject the null hypothesis if it falls below a significance threshold established of the test.
word
- The word whose p-value is to be calculated.nullModel
- The null model.
double pvalue(Sequence word, int beginIndex, int endIndex, SequenceModel nullModel)
pvalue(Sequence, SequenceModel)
double likelihoodThreshold(double significance)
likelihoodThreshold(double, SequenceModel)
double likelihoodThreshold(double significance, SequenceModel nullModel)
significance
- The p of the description above.nullModel
- The null model m0 of the description above.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |