View source: R/hawkes_em_functions.R
EM | R Documentation |
The only required argument is pp_obj
. Repeated calls are made to optim
with method = "Nelder-Mead"
and its default arguments. Nelder-Mead may attempt non-admissilbe parameter values for the kernel densities of the Hawkes process (e.g., a negative scale/shape parameter for the gamma distribution), in which optim
case will throw a warning message – but this is still faster than optim's method = "L-BFGS-B"
. To Do: 1) catch optim
warnings and build box constraints into kernels. 2) Implement constraints over response kernels. While the source code has many (too many) lines of code directed at parameter constraints over response functions, this is currently not implemented robustly so the constraints
argument is currently omitted from the function call. Also need to improve Trace = T
output.
EM(pp_obj, kernel_type, starts, nstarts, conv, maxit, Trace)
pp_obj |
a |
kernel_type |
currently only implemented for |
starts |
starting values for parameters of the Hawkes process formatted as described for |
nstarts |
How many times to run the EM algorithm (to address non-convex likelihood). Default = 1. Note that if |
conv |
convergenve criterion of EM algorithm (absolute change in complete data log likelihood on successive steps M steps). Default = 1e-4. |
maxit |
maximum number of iterations of the EM algorithm. Default = 500. |
Trace |
(logical) if |
A named list with components c("Solutions", "History")
. "Solutions"
is a matrix with nstarts
rows, the first columns of which cotains convergence value of the incomplete data loglikelihood for those starting values, with the remaining rows containing the parameters estimates. "History"
is an nstarts
-by-maxit
matrix that contains the convergence history for each set of starting values. Both matrices are ordered from the best to worst solutions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.