1
$\begingroup$

I'm trying to simulate some BM for 500 observations.

I got correlated increments as I needed and they are not exactly N(0,1), so I standardize them (x-mean(x))/sd(x). But then the resulting Brownian motions are doing a weird elliptic shape and end up back on the x-axis. So I simulated fresh N(0,1) and used the standardizing function on them again (shouldnt do anything, should it?), but got the same result. Simulated BM after normalisation

Any idea why is that? Why do they all (100 paths) converge exactly to zero? I guess it must be the normalisation function, but I cannot figure out why would they all go to zero because of that?

My code in R:

simGBM<-function(cov=TRUE,secs=100,Tau=500,sigma=0.05,neg.cor=0.3){
if(cov==TRUE){
#  s<-apply(simSeries(simCov(secs,neg.cor),Tau),2,normalise)
m<-simCov(secs,neg.cor)
s<-simSeries(m,Tau)
}  else {
s<-matrix(rnorm(secs*Tau),ncol=secs)}


dt<-1/(Tau)
BM<-apply(s,2,function(x) cumsum(sqrt(dt)*x))
GBM<-apply(BM,2,function(x) 100*exp((-0.5*sigma*sigma*dt+sigma*x)))
 if(cov==TRUE) {return(list(GBM=matrix(GBM,ncol=secs),cov=m))}
else{return(matrix(GBM(ncol=secs)))}
  }


normalise<-function(x){
  ( (x-mean(x))/sd(x) )
}

The s is either a series that I simulated with a some covariance structure, or pure white noise. Just to clarify, if I dont use the scaling function everything is ok and looks like it works correctly - checked against 'proven correct' examples.

$\endgroup$
3
  • $\begingroup$ Do you know hitting time? $\endgroup$
    – user16651
    Jul 12 '16 at 18:21
  • $\begingroup$ Thanks for you answer. I'm not sure however if we're on the same page. I'm not after when the BM reaches a certain level (stopping time), just was wondering why they converge to zero in the last few observations if I use my normalisation function. If I dont, they make the classical conical shape, not this elipse... $\endgroup$
    – Jan Sila
    Jul 12 '16 at 18:27
  • $\begingroup$ Can you provide the code you use? $\endgroup$
    – David C
    Jul 12 '16 at 18:45
1
$\begingroup$

Seems like you are running cumsum on a normalised vector - which'll give you zero as the end value for each path.

Also, in the GBM, the drift term (-sigma^2*dT) needs to accumulate over time.

$\endgroup$
1
  • $\begingroup$ Yh, that makes sense about the normalised vector, I didnt realise. Because even though they are all white noise, if I substract the actual mean of the series, then I would get cumsum 0, which is why they tend converge to 0. Regarding the GBM, I checked it with code of the guys who made the 'pde' package and they accumulate the BM as well and then just put it in the exponential, so they dont in fact accumulate the drift term either.... $\endgroup$
    – Jan Sila
    Jul 13 '16 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.