maxPartialSumd | R Documentation |
Calculates the distribution of the maximum of the partial sum process for a given value in the identically and independently distributed model
maxPartialSumd(
k,
score_probabilities,
sequence_min = NULL,
sequence_max = NULL,
score_values = NULL
)
k |
value at which calculates the probability |
score_probabilities |
the probabilities for each score from lowest to greatest (Optionnaly with scores as names) |
sequence_min |
minimum score (optional if |
sequence_max |
maximum score (optional if |
score_values |
vector of integer score values, associated to score_probabilities (optional if
|
Implement the formula (4) of the article Mercier, S., Cellier, D., & Charlot, D. (2003). An improved approximation for assessing the statistical significance of molecular sequence features. Journal of Applied Probability, 40(2), 427-441. doi:10.1239/jap/1053003554
Important note : the calculus of the parameter of the distribution uses
the resolution of a polynome which is a function of the score distribution, of order max(score)-min(score). There exists only empirical methods to solve a polynome of order greater that 5
with no warranty of reliable solution.
The found roots are checked internally to the function and an error message is throw in case of inconsistency.
A double representing the probability of the maximum of the partial sum process equal to k
maxPartialSumd(10, c(0.08, 0.32, 0.08, 0.00, 0.08, 0.00, 0.00, 0.08, 0.02, 0.32, 0.02), -6, 4)
prob <- c(0.08, 0.32, 0.08, 0.00, 0.08, 0.00, 0.00, 0.08, 0.02, 0.32, 0.02)
score_values <- which(prob != 0) - 7 # keep only non null probability scores
prob0 <- prob[prob != 0] # and associated probability
p <- maxPartialSumd(10, prob, sequence_min = -6, sequence_max = 4)
p0 <- maxPartialSumd(10,prob0, score_values = score_values)
p == p0 # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.