Tolga Uzuner
2006-Nov-05 11:13 UTC
[R] Generating a double-exponential jump diffusion process
Dear R Users, Does anyone know of a package which can generate random realisations of a double-exponential jump diffusion process with a drift ? Something where I can specify the likelihoods of an up or a down jump, the drift rate, and the mean size, and get back a vector of realisation of the process (for purposes of a Monte-Carlo). Kind regards, Tolga
Ben Bolker
2006-Nov-05 23:51 UTC
[R] Generating a double-exponential jump diffusion process
Tolga Uzuner <tolga <at> coubros.com> writes:> > Dear R Users, > > Does anyone know of a package which can generate random realisations of > a double-exponential jump diffusion process with a drift ? Something > where I can specify the likelihoods of an up or a down jump, the drift > rate, and the mean size, and get back a vector of realisation of the > process (for purposes of a Monte-Carlo). >Hmmm. I'm not exactly sure what you mean (this is one of the things to remember about the R list -- there is a vast variety of readers, most of whom aren't in your field, so the only things you can assume we all know are basic statistics and stuff about R). By "drift" do you mean that likelihood of up is not equal to likelihood of down? I can imagine that it would be easy to generate such a realisation (without a particular package), if you could give us the precise definition. As a starting example: jumpdiff <- function(start=0,nt=100,up=0.5,scale=1) { res <- numeric(nt) res[1] <- start for (i in 2:nt) { dir <- if (runif(1)<up) 1 else -1 res[i+1] <- res[i]+dir*rexp(1,scale=scale) } } I wrote this out as a for loop to make it clearer: a much more efficient way would be dir <- ifelse(runif(nt)<up,1,-1) jump <- rexp(nt,scale=scale) cumsum(start+dir*jump) hope that helps Ben Bolker
Tamas K Papp
2006-Nov-06 00:41 UTC
[R] Generating a double-exponential jump diffusion process
On Sun, Nov 05, 2006 at 11:13:28AM +0000, Tolga Uzuner wrote:> Dear R Users, > > Does anyone know of a package which can generate random realisations of > a double-exponential jump diffusion process with a drift ? Something > where I can specify the likelihoods of an up or a down jump, the drift > rate, and the mean size, and get back a vector of realisation of the > process (for purposes of a Monte-Carlo).Tolga, I am not really an expert in this field, but AFAIK the likelihood of Ito/Levy processes does not have closed form solutions apart from a few well-known exceptions. People use simulation (Euler method and variants) to obtain simulated values and likelihoods. For the latter, a method called High Frequency Augmentation is used. Some references are Jones, C S (1998, 1999), Elerian (1998), Elerian, Chib and Shephard (1998), Eraker (1997), most of them are about diffusions, but I guess that they can be adapted to Levy processes too. HTH, Tamas