Simulate a sample path of Brownian motion

rBM(times, sigma = 1, B0 = 0, u = 0)

Arguments

times

numeric vector of time points where the Brownian motion should be simulated

sigma

numeric scalar, noise level in the Brownian motion, defaults to 1

B0

numeric scalar, initial condition (at time=0) for the Brownian motion

u

numeric scalar, drift

Value

numeric vector, of same length as times, containing the simulated value of the Brownian motion

See also

rvBM for a vectorized version

Examples

times <- 0:10
plot(times,rBM(times),type="b",xlab="Time",ylab="Brownian motion")