multi_brownian_motion: Multi-dimensional Brownian Motion path sampler

View source: R/RcppExports.R

multi_brownian_motionR Documentation

Multi-dimensional Brownian Motion path sampler

Description

Simulation of a multi-dimensional Brownian Motion, at given times

Usage

multi_brownian_motion(dim, x, times)

Arguments

dim

dimension of Brownian motion

x

start value of Brownian motion

times

vector of real numbers to simulate Brownian motion (must be a vector of at least length two, where times[1] is the start time of the Brownian motion, and times[2:length(times)] are the times you wish to further simulate)

Value

Matrix of the simulated Brownian motion path at all included time points. The times are sorted. The first dim rows are the points of the Brownian motion dim+1 row are corresponding times

Examples

# simulate two-dimensional Brownian bridge starting and ending 
# at (0,0) in time [0,1]
multi_brownian_motion(dim = 2,
                      x = c(0,0),
                      times = c(0.1, 0.2, 0.4, 0.6, 0.8))
                      
# note that the times are sorted and duplicates are removed
multi_brownian_motion(dim = 2,
                      x = c(0.5,1),
                      times = c(0.1, 0.2, 0.4, 0.6, 0.6, 0.8, 0.1))

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