min_sampler: Brownian Bridge minimum point sampler (Algorithm 14 in ST329)

View source: R/RcppExports.R

min_samplerR Documentation

Brownian Bridge minimum point sampler (Algorithm 14 in ST329)

Description

Simulation of a minimum point of a Brownian bridge

Usage

min_sampler(x, y, s, t, low_bound, up_bound, checks = TRUE)

Arguments

x

start value of Brownian bridge

y

end value of Brownian bridge

s

start time of Brownian bridge

t

end time of Brownian bridge

low_bound

Lower bound of minimum point (low_bound < up_bound <= min(x,y))

up_bound

Upper bound of minimum point (low_bound < up_bound <= min(x,y))

checks

logical value to determine if arguments that are passed into the function are checked. Things that are checked include that low_bound < up_bound <= min(x,y) and that s < t

Value

vector: the simulated minimum, 'min', and time where minimum occurs, 'tau'

Examples

# simulate a minimum between 0 and 1 of a Brownian bridge starting 
# at 0 and ending at 0 in time [0,1]
min_sampler(x = 0, y = 0, s = 0, t = 1, low_bound = -1, up_bound = 0)

# plotting multiple simulated minimums and their times
minimums <- sapply(1:5000, function(i) {
  min_sampler(x = 0, y = 0, s = 0, t = 1, low_bound = -10, up_bound = 0)
})
plot(x = minimums[2,], y = minimums[1,], pch = 20, lwd = 0.1,
     xlab = 'Time', ylab = 'X')

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