I would like to plot multiple random walks onto the same graph. My p
variable dictates how may random walks there will be.
par(mfrow=c(1,1))
p - 100
N - 1000
S0 - 10
mu - 0.03
sigma - 0.2
nu - mu-sigma^2/2
x - matrix(rep(0,(N+1)*p),nrow=(N+1))
y - matrix(rep(0,(N+1)*p),nrow=(N+1))
t-
On 19/11/2010 1:09 PM, newbster wrote:
I would like to plot multiple random walks onto the same graph. My p
variable dictates how may random walks there will be.
par(mfrow=c(1,1))
p- 100
N- 1000
S0- 10
mu- 0.03
sigma- 0.2
nu- mu-sigma^2/2
x- matrix(rep(0,(N+1)*p),nrow=(N+1))
y-
Maybe you can consider the brownian.motion() function in the animation
package, e.g.
library(animation)
ani.options(interval = 0.05, nmax = 150)
brownian.motion(pch = 21, cex = 5, col = red, bg = yellow, main =
Demonstration of Brownian Motion)
Or here is another (awkward) example of several
3 matches
Mail list logo