s-news
[Top] [All Lists]

query on how to incorporate delta

To: "splus" <s-news@lists.biostat.wustl.edu>
Subject: query on how to incorporate delta
From: "motohasegawa" <2116242101@jcom.home.ne.jp>
Date: Thu, 29 Aug 2002 06:22:55 +0900
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
<Prev in Thread] Current Thread [Next in Thread>
  • query on how to incorporate delta, motohasegawa <=