Learn R Programming

fdars (version 0.3.3)

r.brownian: Generate Brownian Motion

Description

Simulate sample paths from standard Brownian motion (Wiener process).

Usage

r.brownian(n, t, sigma = 1, x0 = 0, seed = NULL)

Value

An fdata object containing the simulated paths.

Arguments

n

Number of sample paths.

t

Evaluation points.

sigma

Volatility (standard deviation per unit time, default 1).

x0

Initial value (default 0).

seed

Optional random seed.

Examples

Run this code
t <- seq(0, 1, length.out = 100)
bm_data <- r.brownian(n = 20, t = t)
plot(bm_data)

Run the code above in your browser using DataLab