somebm (version 0.1)

bm: 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

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

Run this code
bm()
plot(bm())
a <- bm(x0=1, t0=1, t=2, n=1000)
plot(a)

Run the code above in your browser using DataLab