bin_ps: CFTP Binomial Random Numbers

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/bin_ps.R

Description

Main function, return 0-n binomial distributed random numbers according to the coupling from the past algorithm

Usage

1
bin_ps(x, n, p)

Arguments

x

sample_size:number of random numbers desired

n

n= binomial parameter

p

p= binomial parameter

Details

As usual,p should be between 0 and 1 and n should be any positive integer

Value

values

Random numbers

iteration_needed

Number of iterations needed until coalescence

rand_used

Number of random numbers used

Note

Running time is different as n and p change

Author(s)

Francisco Juretig <fjuretig@yahoo.com>

References

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.

Examples

1
bin_ps(1000, 20, 0.5)

binomialcftp documentation built on May 2, 2019, 2:46 a.m.