Generate a time series of Brownian motion.

Description

This function generatea a time series of one dimension Brownian motion, adapted from http://cos.name/wp-content/uploads/2008/12/stochastic-differential-equation-with-r.pdf .

Usage

1
  bm(x0 = 0, t0 = 0, t = 1, n = 100)

Arguments

x0

the start value, with the default value 0

t0

the start time point, with the default value 0

t

the end time point, with the default value 1

n

the number of points between t0 and t that will be generated, with the default value 100

Examples

1
2
3
4
bm()
plot(bm())
a <- bm(x0=1, t0=1, t=2, n=1000)
plot(a)