try_many_vectors.RdCompute probability of observations across many potential vectors This will try (1/stepsize)^nflips possible vectors, computing the probability of the observation for each
try_many_vectors( nheads, nflips, number_samples = 1000, stopval = 1e-05, log = FALSE, possibilities = get_possibilities(nheads, nflips) )
| nheads | Number of heads |
|---|---|
| nflips | Total number of flips (heads and tails) |
| number_samples | How many vectors to sample |
| stopval | How large a difference in probability is considered close enough between the flat model and others |
| log | If TRUE return log transformed probabilities. |
| possibilities | All possible sequences of flips that lead to the observed number of heads |
The likelihood of the data (or log likelihood if log=TRUE)