EM: Runs EM algorithm for Multivariate Hawkes process.

View source: R/hawkes_em_functions.R

EMR Documentation

Runs EM algorithm for Multivariate Hawkes process.

Description

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.

Usage

EM(pp_obj, kernel_type, starts, nstarts, conv, maxit, Trace)

Arguments

pp_obj

a pp object.

kernel_type

currently only implemented for kernel_type "dgamma" (optional).

starts

starting values for parameters of the Hawkes process formatted as described for set_parms. If omitted randomly generated starting values are used.

nstarts

How many times to run the EM algorithm (to address non-convex likelihood). Default = 1. Note that if nstarts > 1 then starts should be omitted, or else each different run of the algorithm will converge to the same value.

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 True, some graphical convergence diagnostics are displayed during optimization.

Value

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.


peterhalpin/hawkes documentation built on July 2, 2023, 1:04 p.m.