Description Usage Arguments Details Value Note Author(s) References Examples
Main function, return 0-n binomial distributed random numbers according to the coupling from the past algorithm
1 | bin_ps(x, n, p)
|
x |
sample_size:number of random numbers desired |
n |
n= binomial parameter |
p |
p= binomial parameter |
As usual,p should be between 0 and 1 and n should be any positive integer
values |
Random numbers |
iteration_needed |
Number of iterations needed until coalescence |
rand_used |
Number of random numbers used |
Running time is different as n and p change
Francisco Juretig <fjuretig@yahoo.com>
James G. Propp and David B. Wilson. Exact sampling with coupled Markov chains and applications to statistical mechanics. Random Structures and Algorithms, 9(1&2):223–252, 1996.
1 | bin_ps(1000, 20, 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.