gamma_coin_intervals: Gamma coin flipper for intervals

View source: R/RcppExports.R

gamma_coin_intervalsR Documentation

Gamma coin flipper for intervals

Description

Flips 'Gamma coin' for intervals; takes the product of the Cauchy sequence S^gamma_k to determine whether or not the Brownian bridge remains in the interval [l,v]

Usage

gamma_coin_intervals(u, k, X, times, l, v)

Arguments

u

simulated value from random U[0,1]

k

integer value starting index for calculating the intervals

X

vector of values of Brownian bridge

times

vector of times

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

# setting up Brownian bridge variable
brownian_bridge <- matrix(c(0, 0, -0.2, 0.4, 0.3, 0.5, 1, 1),
                          ncol = 4, nrow = 2)

# flip delta coin whether or not Brownian bridge remains in [-0.5, 1.5]
gamma_coin_intervals(u = runif(1, 0, 1),
                     k = 1,
                     X = brownian_bridge[1,],
                     times = brownian_bridge[2,],
                     l = -0.5,
                     v = 1.5)


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