Learn R Programming

Sim.DiffProc (version 2.5)

SRW: Creating Random Walk

Description

Simulation random walk.

Usage

SRW(N, t0, T, p, output = FALSE)

Arguments

N
size of process.
t0
initial time.
T
final time.
p
probability of choosing X = -1 or +1.
output
if output = TRUE write a output to an Excel (.csv).

Value

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

See Also

Stgamma Stochastic Process The Gamma Distribution, Stst Stochastic Process The Student Distribution, WNG White Noise Gaussian.

Examples

Run this code
## Random Walk
SRW(N=1000,t0=0,T=1,p=0.5)
 SRW(N=1000,t0=0,T=1,p=0.25)
 SRW(N=1000,t0=0,T=1,p=0.75)

Run the code above in your browser using DataLab