gamma_coin: Gamma coin flipper (Algorithm 26 in ST329)

View source: R/RcppExports.R

gamma_coinR Documentation

Gamma coin flipper (Algorithm 26 in ST329)

Description

Flips 'Gamma coin'; uses the Cauchy sequence S^gamma_k to determine whether or not the Brownian bridge starting at x, ending at y, between [s,t] remains in interval [l,v]

Usage

gamma_coin(u, k, x, y, s, t, l, v)

Arguments

u

simulated value from random U[0,1]

k

integer value starting index for calculating the intervals

x

start value of Brownian bridge

y

end value of Brownian bridge

s

start value of Brownian bridge

t

end value of Brownian bridge

l

lower bound of Brownian bridge

v

upper bound of Brownian bridge

Value

boolean value: if T, accept probability that Brownian bridge remains in [l,v], otherwise reject

Examples

gamma_coin(u = runif(1, 0, 1),
           k = 0,
           x = 0,
           y = 0,
           s = 0,
           t = 1,
           l = -0.5,
           v = 0.5)


rchan26/layeredBB documentation built on March 25, 2022, 3:44 a.m.