localScore (version 1.0.6)

exact_mc: Exact method for p-value [Markov chains]

Description

Calculates the exact p-value for short numerical Markov chains. Time computation can be too large for a sequence length of several thousands, specially for a data set.

Usage

exact_mc(m, localScore, sequence_length, sequence_min, sequence_max)

Arguments

m

Transition matrix [matrix object]

localScore

score for which the p-value should be calculated

sequence_length

length of the sequence

sequence_min

minimum score

sequence_max

maximum score

Value

A double representing the probability of a localScore as high as the one given as argument

Examples

Run this code
# NOT RUN {
matrix = t(matrix(c(0.2, 0.3, 0.5, 0.3, 0.4, 0.3, 0.2, 0.4, 0.4), nrow = 3))
exact_mc(localScore = 12, m = matrix, sequence_length = 100, sequence_min = -1, sequence_max = 1)
exact_mc(localScore = 150, m = matrix, sequence_length = 1000, sequence_min = -1, sequence_max = 1)
# }

Run the code above in your browser using DataLab