if (FALSE) {
## MLE For A CARMA(2,1)-Hawkes ##
# Inputs:
a <- c(3,2)
b <- c(1,0.3)
mu<-0.30
true.par<-c(mu,a,b)
# step 1) Model Definition => Constructor 'setCarmaHawkes'
p <- 2
q <- 1
mod1 <- setCarmaHawkes(p = p,q = q)
# step 2) Grid Construction => Constructor 'setSampling'
FinalTime <- 5000
t0 <- 0
samp <- setSampling(t0, FinalTime, n = FinalTime)
# step 3) Simulation => method 'simulate'
# We use method 'simulate' to generate our dataset.
# For the estimation from real data,
# we use the constructors 'setData' and
#'setYuima' (input 'model' is an object of
# 'yuima.CarmaHawkes-class').
names(true.par) <- c(mod1@info@base.Int, mod1@info@ar.par, mod1@info@ma.par)
set.seed(1)
system.time(
sim1 <- simulate(object = mod1, true.parameter = true.par,
sampling = samp)
)
plot(sim1)
# step 4) Estimation using the likelihood function.
system.time(
res <- EstimCarmaHawkes(yuima = sim1,
start = true.par)
)
}
Run the code above in your browser using DataLab