Skip to contents

This class defines a marked Hawkes model with an exponential kernel. The intensity of the ground process is expressed as: $$\lambda(t) = \mu + \int_{(-\infty,t)\times E} ( \alpha + g(u, z) ) e^{-\beta (t-u)} M(du \times dz).$$ For more details, refer to the vignettes.

Details

\(\mu\) is the baseline intensity, typically a constant vector or a function.

\(\alpha\) is a constant matrix representing the impact on intensities after events, stored in the alpha slot.

\(\beta\) is a constant matrix for exponential decay rates, stored in the beta slot.

\(z\) represents the mark and can be generated by the rmark slot.

\(g\) is represented by eta when it is a linear function of \(z\), and by impact for a general function.

mu, alpha and beta are required slots for every exponential Hawkes model. rmark and impact are additional slots.

For D event types and K kernel columns, numeric mu has shape D by 1, and alpha, beta, and optional eta have shape D by K. Baselines are finite and nonnegative; decay rates are finite and positive. Use type_col_map when K differs from D. Its D entries contain nonempty vectors of distinct, one-based kernel column indices. Intensity rows identify event types; the mapping selects columns updated after each event. Supply lambda_component0 to specify initial intensity components explicitly; automatic mean or zero initialization also supports mapped kernels.

Functions whose sole argument is param can reparameterize numeric components. A state-dependent mu or impact function declares the event context it needs. For estimation, param has a default finite numeric vector with unique names; numeric(0) is allowed for fixed components. hfit() shares matching function parameter names and, by default, equal values within each numeric matrix.

rmark and rresidual generate simulation draws. Their parameters alone do not add coefficients to a fit. Supply dmark or residual likelihood functions to estimate distribution parameters. fitted_hspec() retains the generators and updates named defaults that match estimated coefficient names.

Pass stability_check = TRUE to new("hspec", ...) to check the spectral radius for constant, nonnegative Hawkes kernels without state-dependent, mark-dependent, or residual-distribution effects. For other specifications, the constructor reports that this stability check is unavailable. The initialize method converts numeric components to matrices, infers dimensions and validates the specification. The show method displays the model dimension and its components.

Slots

mu

A numeric value, matrix, or function. If numeric, it is automatically converted to a matrix.

alpha

A numeric value, matrix, or function. If numeric, it is automatically converted to a matrix, representing the exciting term.

beta

A numeric value, matrix, or function. If numeric, it is automatically converted to a matrix, representing the exponential decay.

eta

An optional numeric value, matrix, or function specifying the linear additional effect eta * (mark - 1). Numeric values are converted to a matrix.

impact

A function defining the change in kernel components after an event. Declare the state arguments needed by the function. For estimation, an optional param argument supplies a default named numeric parameter vector.

dimens

The number of event types, distinct from the number of kernel columns.

rmark

A function that generates marks for the counting process, used in simulations.

dmark

A density function for the mark, used in estimation.

type_col_map

A list whose element i selects the kernel columns updated after an event of type i. Intensity rows identify event types.

rresidual

A function for generating residuals in simulations with a specified residual distribution.

dresidual

A density function for the residual.

presidual

A distribution function for the residual.

qresidual

A quantile function for the residual.

Examples

MU <- matrix(c(0.2), nrow = 2)
ALPHA <- matrix(c(0.75, 0.92, 0.92, 0.75), nrow = 2, byrow=TRUE)
BETA <- matrix(c(2.25, 2.25, 2.25, 2.25), nrow = 2, byrow=TRUE)
mhspec2 <- new("hspec", mu=MU, alpha=ALPHA, beta=BETA)
mhspec2
#> An object of class "hspec" of 2-dimensional Hawkes process
#> 
#> Slot mu: 
#>      [,1]
#> [1,]  0.2
#> [2,]  0.2
#> 
#> Slot alpha: 
#>      [,1] [,2]
#> [1,] 0.75 0.92
#> [2,] 0.92 0.75
#> 
#> Slot beta: 
#>      [,1] [,2]
#> [1,] 2.25 2.25
#> [2,] 2.25 2.25
#>