crossrunchange {crossrun} | R Documentation |
Joint Distribution for Crossings and Runs, Varying Success Probability.
Description
Joint probability distribution for the number of crossings
C and the longest run L in a sequence of n independent Bernoulli observations
with p ossibly varying success probability. To enhance precision, results are stored
in mpfr arrays and the probabilities are multiplied by m^{n-1}
for a multiplier m.
Usage
crossrunchange(
nmax = 100,
prob = rep(0.5, 100),
mult = 2,
prec = 120,
printn = FALSE
)
Arguments
nmax |
max sequence length. |
prob |
success probabilities. |
mult |
multiplier for joint probabilities. |
prec |
mpft precision. |
printn |
logical for progress output. |
Value
list pt of joint probabilities. Cumulative probabilities qt within each row are also included. Further, mostly for code checking, lists pat and qat conditional on starting with a success, and pbt and qbt conditional of starting with a failure, are included.
Examples
prob10 <- c(rep(.5,5),rep(.7,5))
crchange10 <- crossrunchange(nmax=10, prob=prob10,printn=TRUE)
print(crchange10$pt[[10]])
[Package crossrun version 0.1.1 Index]