compute_I: Compute the intensity functions for a Hawkes process.

View source: R/hawkes_em_functions.R

compute_IR Documentation

Compute the intensity functions for a Hawkes process.

Description

For each event in an output process, compute its intensity under each event in an input process. This is the main workhorse of both the E and M step. Note that the return fromat would more intuitively be represented as n_output_events by n_input_events matrix, but this gets very large and sparse for longer time series. So instead of a matrix, the output is fromated two lists, each being itself a list of length n_output_events – one list contains intensities, the other the indices, for input events that have non-negligible intensity. This is less intuitive in terms of storage but substantially faster (linear versus quadratic computational complexity; see Halpin 2013).

Usage

compute_I(out, inp, pp_obj, parms, k, Log = F)

Arguments

out

index for which component of pp object is the output process.

inp

index for which component of pp object is the input process.

pp_obj

a pp object.

parms

parameters of the Hawkes process formatted as described for set_parms.

k

optional: output from set_kernel(kernel_type). Currently only implemented for kernel_type = "dgamma".

Log

logical: return alpha*kernel or log(alpha) + log(kernel) ?

Value

A named list with components c("Intensity", "Compensator", "Parents"), each of which are lists with length(pp_obj[[out]]) components. "Intensity" contains the non-zero intensities for each output event, and "Parents" contains the parent index (i.e., from pp_obj[[inp]]) for each value in "Intensity". Similarly for "Compensator".


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