Learn R Programming

Sim.DiffProc (version 2.5)

ABMF: Creating Flow of The Arithmetic Brownian Motion Model

Description

Simulation flow of the arithmetic brownian motion model.

Usage

ABMF(N, M, t0, T, x0, theta, sigma, output = FALSE)

Arguments

N
size of process.
M
number of trajectories.
t0
initial time.
T
final time.
x0
initial value of the process at time t0.
theta
constant (Coefficient of drift).
sigma
constant positive (Coefficient of diffusion).
output
if output = TRUE write a output to an Excel (.csv).

Value

  • data.frame(time,x) and plot of process.

Details

The function ABMF returns a flow of the Arithmetic Brownian motion starting at x0 at time t0, than the discretization dt = (T-t0)/N. The stochastic differential equation of the Arithmetic Brownian motion is : $$dX(t) = theta * dt + sigma * dW(t)$$ With theta :drift coefficient and sigma :diffusion coefficient, W(t) is Wiener process.

See Also

ABM creating the arithmetic brownian motion model.

Examples

Run this code
## Flow of Arithmetic Brownian Motion Model
## dX(t) = 3 * dt + 2 * dW(t) ; x0 = 0 and t0 = 0
ABMF(N=1000,M=5,t0=0,T=1,x0=0,theta=3,sigma=2)

Run the code above in your browser using DataLab