|
Hi fellow splus users:
I have a script for the Brownian motion with a drift
(given below). As you can see, I assume delta (dt=1) being one. I would
like to make a change in this script and make delta (dt) as an extra
argument in this script. What changes should I make in
the script below? Please help! I appreciate your help.
# Script for Brownian motion with a drift;
bmd
bmd <-
function(initial,periods,miu,sig) { rnorm1<-NULL rnorm1<-c(rnorm(periods,0,1)) bmdft1<-NULL bmdft1[1]<-initial for(i
in
1:periods) { bmdft1[i+1]<-bmdft1[i]+miu+sig*rnorm1[i] i<-i+1 } bmdft1 }
Sincerely,
Moto
|