I am trying to simulate the following process:
h(t)=B(t)+e[P1(t)-P2(t)]
in which B(t) is a Brownian motion and P1, P2 are Poisson process with lambda=5000
and t<-1:10000
and I choose e=0.5
. I am able to simulate B(t)
wiht the following code:
x <- rnorm(n = length(t) - 1, sd = sqrt(0.01))
B <- c(0, cumsum(x))
and one Poisson process
P1<-cumsum(rpois(10000,5000/10000))
P2 is also poisson process with the same rate so that the difference between P1
and P2
will be a process that jumps around 0
as follow:
...0,lambda,-2*lambda,lambda,0...
. I created P2
the same way I did for P1
and plot the difference P1-P2
but the result is not as I expected
I wonder if my algorithm to create P1
and P2
is correct? Can someone please tell me the step that I went wrong?
Many thanks in advance
P1 - P2
will behave like that? Your sample looks deterministic, butP1 - P2
will be random. $\endgroup$P1-P2
behave: since the jump of Poisson process is 1, the difference of 2 Poisson processes should evolve around 0 with the jump of either 1 or -1. Therefore,h(t)
will have the jump of 0.5 or -0.5 when the difference is not 0 $\endgroup$