Skip to contents

Run a 3-d (lat, lon, time) Kulldorff scan with MC inference

Usage

mrm_tps_kulldorff_scan(
  data,
  date_col = "OCC_DATE",
  lat_col = "LAT_WGS84",
  lon_col = "LONG_WGS84",
  radii_km = c(1, 2, 3, 5, 8),
  window_years = 4,
  n_centers = 60L,
  n_permutations = 199L,
  n_top_clusters = 1L,
  seed = 42L
)

Arguments

data

data.frame with date_col, lat_col, lon_col.

date_col

Column name of the event date (default "OCC_DATE").

lat_col, lon_col

WGS84 lat/long column names.

radii_km

Candidate cylinder radii in km.

window_years

Time-cylinder length in years.

n_centers

Number of random candidate centres sub-sampled.

n_permutations

Monte-Carlo permutations.

n_top_clusters

Integer; number of top clusters to return. Accepted for Python signature parity. The current implementation returns a single primary cluster (the secondary-cluster loop in morie.mrm_kulldorff.py breaks out pending a proper mask-and-rescan rewrite); values >1 are reserved for that future TRUE multi-cluster mode.

seed

Random seed.

Value

A one-row data.frame describing the top cluster, with columns center_lat, center_lon, radius_km, t_start, t_end, n_observed, n_expected, relative_risk, log_lrt, p_value.

Examples

if (FALSE) {
  tps <- morie_sample("tps_assault")
  mrm_tps_kulldorff_scan(tps, n_permutations = 49)
}