Example: Brownian Motion – CARMA

Here  you can find an example showing how to set, simulate and estimate a Browniam Motion CARMA with the yuima R package.

Reference: Iacus, Stefano M., and Lorenzo Mercuri. “Implementation of Lévy CARMA model in Yuima package.” Computational Statistics 30.4 (2015): 1111-1141.

# CARMA(p,q) model

library(yuima)
# ?setCarma

# Construction of a gaussian CARMA(3,2)
carma <- setCarma(p = 3, q = 2, loc.par = "c0", Carma.var = "y", Latent.var = "X")

param <- list(a1 = 4, a2 = 4.75, a3 = 1.5, b0 = 1, b1 = 0.23, b2 = 0.35, c0 = 0)

# simulation
samp <- setSampling(Terminal = 400, n = 16000)

set.seed(123)
simCarma <- simulate(carma, true.parameter = param, sampling = samp)

x11()
 plot(simCarma)
dev.off()

# Estimation
est <- qmle(sim, start = param, Est.Incr="Incr")

summary(est)