Skip to contents

Reproduces the MORIE gallery's per-category stochastic figures in base R: the Hawkes fit panel (monthly counts, dashed background-rate line, time-rescaling residual histogram with its KS p-value), and optionally the SARIMA hold-out forecast panel. Data are fetched live from the public TPS ArcGIS portal, so results reproduce anywhere without access to any private mirror.

Usage

morie_tps_figures(
  out_dir,
  categories = "Homicides",
  which = c("hawkes", "sarima", "langevin", "fokker_planck"),
  cache_dir = file.path(tempdir(), "morie", "tps")
)

Arguments

out_dir

Directory to write PNG files into (created if missing). Required; nothing is written anywhere else.

categories

TPS categories (see morie_tps_layer_urls()). Default "Homicides".

which

Figure families to render: any of "hawkes", "sarima", "langevin", "fokker_planck".

cache_dir

Passed to morie_fetch_tps(); defaults to a session temporary directory.

Value

Invisibly, a character vector of the PNG paths written.

Examples

# \donttest{
# Live fetch from the public TPS portal; writes only under tempdir().
try(morie_tps_figures(file.path(tempdir(), "tps-figs"),
                      categories = "Homicides", which = "hawkes"))
# }