Skip to content

How to code Geometric Brownian Motion Process with Jumps

3 messages · John-Paul Taylor, Thomas Steiner, stefano iacus

#
I was just wondering if anyone knows if there is a canned package that included a coding for a GBMP with Jump Diffusion process or had any suggestion on how to code the log-likelihood function.

I have try to look the jumps which i am cutting of at 10 with the vector I think i need to add another look but I am not sure if this is correct. 

I have asked around my department at school but know idea so any suggestion greatly appreciated.

I have attached a file with the code and a vector of data.

Your truly

JP

Here is my code for the MLE: 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Code GBMPJ.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090405/068d72c1/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TP-Combined-Phase1-Spot.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090405/068d72c1/attachment-0001.txt>
#
Hi John-Paul,
on http://commons.wikimedia.org/wiki/Image:Gamma-OU.png you find a
Ornstein-Uhlenbeck process which is driven by a Levy process (Gamma
process). It should be easy to adapt the code for GBM.
This is a very simplistic approach (Euler approximation), for a
special process there should be more sophisticated (faster, more
accurate) methods.
Let me know if you need help.
Thomas
#
If it is diffusion + jumps, than Thomas's code looks not appropriate  
at first glance (apologizes to Thomas in advance if I'm wrong). That  
code does indeed correctly simulate an OU driven only by levy jumps,  
i.e. pure jump process + drift.

One approach is the following: simulate, between times t and, say, t 
+dt, the number k of jumps (for example via Poisson in (0,lambda*dt)).  
Then simulate the k random increments of the levy part (using you  
favorite law: gamma, whatever) and sum them into J

i.e.

k = rpois(1, lambda*dt)
J <- sum(rWHATEVER(k)) # according to levy density of your choice

and finally do something like (assuming mu, sigma are the parameters  
of the GBM process)

  X[t+dt] = X[t] + mu*X[t]*dt + sigma*X[t]*rnorm(1)*sqrt(dt) + J


this is VERY imprecise, but just to give you an idea, and of course,  
as Thomas says, if you specify better the model  you want to simulate,  
you may find some ad hoc solutions. There are many flavors of Levy's  
(compound, infinite activity, stable, etc)

Also, if dt is not very small, simulation of GBM by Euler scheme is  
really bad.
So take dt <- 1/100000 and then resample the trajectory X at, say  
1/100 or so

stefano
On 06/apr/09, at 09:19, Thomas Steiner wrote: