simclbin: Simulation of Independent Bernoulli Observations
Description
Simulation of a sequence of independent Bernoulli
Observations. To reduce the amount of random draws, each
simulation is based on a sequence of standard normal
variables, and whether each observation is above a shift
defined by the binomial probabilities assumed.
a data frame with the number of crossings and
longest run for each probability. For instance
the variables nc0.5 and lr0.5 are the number of
crossings and the longest run for success probability
0.5. One row for each simulation.
# NOT RUN {cl30simbin <- simclbin(nser=30, nsim=100)
mean(cl30simbin$nc0.5) # mean number of crossings, p=0.5mean(cl30simbin$lr0.9) # mean longest run, p=0.9# }