Skip to contents

Fits every supplied (kernel, baseline) combination and ranks by AIC. Mirrors Section 5 of Kwan-Chen-Dunsmuir (2024): the Markovian classical Hawkes is the (exponential, constant) row; the non-Markovian non-stationary models are everything else.

Usage

morie_tps_compare_hawkes_kernels(
  df,
  ds_name = "?",
  max_n = 4000L,
  baselines = .TPS_HAWKES_BASELINES,
  kernels = .TPS_HAWKES_KERNELS
)

Arguments

df

Data frame with OCC_DATE or REPORT_DATE.

ds_name

Dataset name used in titles.

max_n

Maximum events to fit.

baselines

Baseline kinds to sweep over.

kernels

Kernel kinds to sweep over.

Value

A morie_rich_result with a per-combination summary table, the best (lowest-AIC) combination, and the AIC gap between the classical Markovian model and the winner.

Details

Combinations that fail to converge are recorded with an error message rather than aborting the whole comparison.

References

Kwan TKJ, Chen F, Dunsmuir WTM (2024). arXiv:2408.09710.

Examples

# \donttest{
  df <- morie_tps_load_tps_dataset("Assault", nrows = 500)
#> morie_tps: no local TPS cache for 'Assault'; using the bundled sample from rmoriedata. Fetch the full export with morie_tps_fetch_category().
  # A bounded grid (300 events, constant baseline, one kernel pair)
  # keeps the example fast; the defaults sweep the full
  # baseline x kernel grid over up to 4000 events.
  rr <- morie_tps_compare_hawkes_kernels(
    df, ds_name = "Assault", max_n = 300L,
    baselines = "constant", kernels = c("exponential", "gamma")
  )
# }