if (FALSE) {
set.seed(123)
# One-dimensional case
## Model: dXt=t*dWt+t*dzt,
## where zt is a compound Poisson process with intensity 5 and jump sizes distribution N(0,1).
model <- setModel(drift=0,diffusion="t",jump.coeff="t",measure.type="CP",
measure=list(intensity=5,df=list("dnorm(z,0,sqrt(0.1))")),
time.variable="t")
yuima.samp <- setSampling(Terminal = 1, n = 390)
yuima <- setYuima(model = model, sampling = yuima.samp)
yuima <- simulate(yuima)
plot(yuima) # The path seems to involve some jumps
#lm.jumptest(yuima) # p-value is very small, so the path would have a jump
#lm.jumptest(yuima, K = floor(sqrt(390))) # different value of K
pz.test(yuima) # p-value is very small, so the path would have a jump
pz.test(yuima, p = 2) # different value of p
pz.test(yuima, tau = 0.1) # different value of tau
# Multi-dimensional case
## Model: Bivariate standard BM + CP
## Only the first component has jumps
mod <- setModel(drift = c(0, 0), diffusion = diag(2),
jump.coeff = diag(c(1, 0)),
measure = list(intensity = 5,
df = "dmvnorm(z,c(0,0),diag(2))"),
jump.variable = c("z"), measure.type=c("CP"),
solve.variable=c("x1","x2"))
samp <- setSampling(Terminal = 1, n = 390)
yuima <- setYuima(model = model, sampling = yuima.samp)
yuima <- simulate(object = mod, sampling = samp)
plot(yuima)
pz.test(yuima) # test is performed component-wise
}
Run the code above in your browser using DataLab