1
$\begingroup$

I have ploted the next following jump diffusion model using Mathematica 10

$$X_t=X_0 e^{\sigma W_t+(v-\sigma /2)t}(1+J_1)\cdots(1+J_{N_t})$$ namely, a Geometric Brownian motion with compound Poisson jumps.

For this I have used the next code:

Pp = 
  TransformedProcess[g[t] E^(j[t]), 
   {g \[Distributed] GeometricBrownianMotionProcess[v, σ, 1], 
    j \[Distributed] CompoundPoissonProcess[λ, NormalDistribution[0, 0.85]]}, 
   t];

data = RandomFunction[Pp /. {v -> 0.5, σ -> 0.5, λ -> 2.1, μ -> 0.92, δ -> 0.425, 
                             r -> 1}, {0, 3, 0.001}, 3];

ListLinePlot[data, PlotRange -> All]

The thing is that, together with the resultant graphic, I would like to plot the generating Poisson Process. Any idea? Thanks!

$\endgroup$
  • $\begingroup$ What does "plot the process" mean? $\endgroup$ – David G. Stork Jun 22 '15 at 16:04
  • $\begingroup$ Plot the Poisson Stochastic Process, the function. $\endgroup$ – Edin_91 Jun 22 '15 at 16:31
1
$\begingroup$

I'm not quite following your question, but are you possibly looking for this?

Pp = TransformedProcess[{g[t] E^(j[t]), j[t]},
      {g \[Distributed] GeometricBrownianMotionProcess[v, \[Sigma], 1], 
       j \[Distributed] CompoundPoissonProcess[\[Lambda], NormalDistribution[0, 0.85]]}, t];

data = RandomFunction[Pp /.
                       {v -> 0.5, \[Sigma] -> 0.5, \[Lambda] -> 2.1,
                        \[Mu] -> 0.92, \[Delta] -> 0.425, r -> 1},
                      {0, 3, 0.001}];

ListLinePlot[data, PlotRange -> All]

enter image description here

EDIT:

"Improved" answer. This is really a hack: it splits the TemporalData object with two sets of data into two time-value arrays, and in addition to passing both arrays as-is to ListLinePlot, counts amount of value transitions before every point on the second of these time-value arrays. Not very pretty, but works.

Pp = TransformedProcess[{g[t] E^(j[t]), j[t]},
      {g \[Distributed] GeometricBrownianMotionProcess[v, \[Sigma], 1], 
       j \[Distributed] CompoundPoissonProcess[\[Lambda], NormalDistribution[0, 0.85]]}, t];

data = RandomFunction[Pp /.
                       {v -> 0.5, \[Sigma] -> 0.5, \[Lambda] -> 2.1,
                        \[Mu] -> 0.92, \[Delta] -> 0.425, r -> 1},
                      {0, 3, 0.001}];

processeddata = {#1, #2, {#2[[1]], #1} & @@@ 
      FoldList[{#1[[1]] + Boole[#1[[2, 2]] != #2[[2]]], #2} &, {0, 
        First@#2}, Rest@#2]} & @@ 
   Table[{#1, #2[[n]]} & @@@ First@data["Paths"], {n, 2}];

ListLinePlot[processeddata, PlotRange -> All]

enter image description here

$\endgroup$
  • $\begingroup$ Hi, @kirma. It is almost this. I want to plot a function that for each jump increments one unit when the jumps in the grafic ocurr. reference.wolfram.com/language/ref/PoissonProcess.html $\endgroup$ – Edin_91 Jun 22 '15 at 18:44
  • $\begingroup$ @Edin_91 Improved the answer; sadly I don't know how to do this natively on the side of random processes. $\endgroup$ – kirma Jun 22 '15 at 19:20
  • $\begingroup$ Yes, that it is exactly what I need. Could you provide me the code to plot the Poisson Process and Compund Process together with the Geometric Brownian Motion? (I mean to combine your both answer) $\endgroup$ – Edin_91 Jun 22 '15 at 19:26
  • $\begingroup$ If you give me points in my question will be able to point you up :) $\endgroup$ – Edin_91 Jun 22 '15 at 19:27
  • $\begingroup$ If you need any explanation don´t hesitate to ask me $\endgroup$ – Edin_91 Jun 22 '15 at 19:27

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.