data.gen.gbm: Generate a time series of geometric Brownian motion.

Description Usage Arguments References Examples

View source: R/data_gen_BM.R

Description

This function generates a a time series of one dimension geometric Brownian motion.

Usage

1
2
3
4
5
6
7
8
data.gen.gbm(
  x0 = 10,
  w0 = 0,
  mu = 1,
  sigma = 0.5,
  time = seq(0, by = 0.01, length.out = 101),
  do.plot = TRUE
)

Arguments

x0

the start value of x, with the default value 10

w0

the start value of w, with the default value 0

mu

the interest/drifting rate, with the default value 1.

sigma

the diffusion coefficient, with the default value 0.5.

time

the temporal interval at which the system will be generated. Default seq(0,by=0.01,len=101).

do.plot

a logical value. If TRUE (default value), a plot of the generated system is shown.

References

Yanping Chen, http://cos.name/wp-content/uploads/2008/12/stochastic-differential-equation-with-r.pdf

Examples

1
2
set.seed(123)
x <- data.gen.gbm()

synthesis documentation built on May 3, 2021, 9:07 a.m.