Learn R Programming

localScore (version 2.0.1)

maxPartialSumd: Maximum of the partial sum [probability] [iid]

Description

Calculates the distribution of the maximum of the partial sum process for a given value in the identically and independently distributed model

Usage

maxPartialSumd(k, score_probabilities, sequence_min, sequence_max)

Value

A double representing the probability of the maximum of the partial sum process equal to k

Arguments

k

value at which calculates the probability

score_probabilities

the probabilities for each unique score from lowest to greatest

sequence_min

minimum score

sequence_max

maximum score

Details

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab