Source-linked AI summary

Tutorial on kernel estimation of continuous spatial and spatiotemporal relative risk with accompanying instruction in R

Tilman M. Davies, Jonathan C. Marshall, Martin L. Hazelton

arXiv:1707.06888v1stat.ME

TL;DR

Kernel estimation of spatial and spatiotemporal relative risk involves practical challenges such as bandwidth selection, edge correction, and computational complexity. This tutorial reviews current methods and their implementation in the R package sparr, then illustrates the methodology with two epidemiological examples.

  • Problem

    Kernel estimation of relative risk raises practical issues including bandwidth selection, edge correction, and computational complexity, motivating an instructional overview of current spatial and spatiotemporal methods.

    Source: §1 · p. 1
  • Method

    The tutorial reviews current methods for kernel estimation of spatial and spatiotemporal density and relative-risk functions, emphasizing practical implementation through the R package sparr.

    Source: §1 · p. 1, §9 · p. 27
  • Results

    A pair of epidemiological examples illustrates the types of problems that benefit from the methodology.

    Source: §1.1 · p. 2
  • Takeaways & Limitations

    The review identifies smoothing choices, edge correction, and bandwidth selection as considerations for analyses of spatial and spatiotemporal density and relative-risk functions.

    Source: §9 · p. 27

    Purely data-driven, jointly optimal bandwidth selection for spatiotemporal log relative-risk estimates has not yet received substantial attention in the literature.

    Source: §6.3 · p. 18

Abstract

from arXiv · show

Kernel smoothing is a highly flexible and popular approach for estimation of probability density and intensity functions of continuous spatial data. In this role it also forms an integral part of estimation of functionals such as the density-ratio or "relative risk" surface. Originally developed with the epidemiological motivation of examining fluctuations in disease risk based on samples of cases and controls collected over a given geographical region, such functions have also been successfully employed across a diverse range of disciplines where a relative comparison of spatial density functions has been of interest. This versatility has demanded ongoing developments and improvements to the relevant methodology, including use spatially adaptive smoothers; tests of significantly elevated risk based on asymptotic theory; extension to the spatiotemporal domain; and novel computational methods for their evaluation. In this tutorial paper we review the current methodology, including the most recent developments in estimation, computation and inference. All techniques are implemented in the new software package sparr, publicly available for the R language, and we illustrate its use with a pair of epidemiological examples.

1 Introduction

The introduction frames kernel relative-risk estimation as a flexible tool for spatial and spatiotemporal analysis and presents a tutorial that reviews its methods and demonstrates them with the R package sparr.

1 Introduction

  • Kernel smoothing handles heterogeneous spatial data flexibly, while relative-risk estimation supports comparisons of disease incidence and other spatial distributions and has prompted adaptive, spatiotemporal, and significance-testing methods.The tutorial reviews current estimation, computation, inference, bandwidth selection, and edge-correction issues, with practical demonstrations using sparr.Source: §1 · p. 1

1.1 Motivating Examples

  • The motivating examples examine whether 761 primary biliary cirrhosis cases differ from 3,020 controls in northeast England and how risk changed across 410 foot-and-mouth disease cases and 1,866 uninfected farms during Cumbria’s 2001 outbreak.The examples pose questions about significant spatial differences and emerging space-time hotspots.Source: §1.1 · p. 2

1.2 R Package “sparr”

  • The redesigned sparr package provides fixed- and adaptive-bandwidth density and relative-risk estimation in spatial and spatiotemporal settings, including edge correction and bandwidth selectors.Its selectors include rule-of-thumb, cross-validation, and bootstrap methods; joint relative-risk bandwidth selection remains an active research area.Source: §1.2 · p. 3
  • sparr also offers multi-scale adaptive estimates, computation-time improvements, spatstat compatibility, and practical code demonstrations with the complete analysis script supplied as supplementary material.Compatibility uses spatstat classes including ppp, owin, and im.Source: §1.2 · p. 3

1.3 Article Structure

  • The article progresses from spatial and spatiotemporal density estimation and bandwidth selection to relative-risk estimation, testing, code examples, computation, visualization, and future research.An appendix indexes sparr functions and links them to the paper’s methodology and equations.Source: §1.3 · p. 3

2 Kernel Density Estimation

Kernel density estimation seeks to recover the density generating spatial observations within a bounded study region, whose boundaries affect estimation and inference.

2.1 Spatial: Fixed Bandwidth

  • Fixed-bandwidth estimation sums equal-weight kernel contributions, while bandwidth controls smoothness and boundary correction addresses probability loss near the study-region edge.The Gaussian kernel is a popular choice; evaluation-coordinate (“uniform”) correction is computationally convenient, while observation-based (“Diggle”) correction is preferred for numerical precision where possible.Source: §2.1 · p. 4

2.2 Spatial: Adaptive Bandwidth

  • Abramson’s adaptive bandwidths shrink in dense regions and expand in sparse ones, reducing smoothing where detail is needed and improving asymptotic bias under certain conditions.The bandwidths are inversely proportional to the square root of a pilot density estimate.Source: §2.2 · pp. 4–5

2.3 Spatiotemporal

  • Spatiotemporal estimation smooths the joint density in space and time with separate spatial and temporal kernels, bandwidths, and edge corrections.The spatial margin uses the 2D kernel and isotropic bandwidth; the temporal margin uses a univariate kernel and bandwidth, with correction at the bounds of T.Source: §2.3 · pp. 5–6
  • For inspection at a given time, the conditional spatial density normalizes the spatial slice to integrate to 1 over W and supports analysis of changing relative risk over time.It is obtained from the joint estimate using the edge-corrected temporal density estimate.Source: §2.3 · p. 6

3 Bandwidth Selection

Spatial and spatiotemporal bandwidth selection is complicated by edge correction, adaptive smoothing, and joint bandwidth choices. Among the reviewed methods, the authors found bootstrap selection with an oversmoothed reference performed well overall.

3.1 Rules-of-Thumb

  • Normal-scale rules are exploratory outside near-normal data, while oversmoothing can suit relative-risk estimation; fixed rules provide only rough starting points for adaptive and spatiotemporal smoothing.Specific adaptive-estimator analogues of the normal-scale rule are not theoretically possible; combining 2D and 1D rules can provide rough spatial and temporal bandwidths.Source: §3.1 · p. 7

3.2 Least Squares Cross-Validation

  • LSCV accommodates edge correction and adaptive or spatiotemporal bandwidth selection, but often selects bandwidths that are too small and can be numerically unstable for heterogeneous data.It uses an unbiased estimate of MISE, with leave-one-out density estimates; spatiotemporal selection optimizes both spatial and temporal bandwidths.Source: §3.2 · p. 8

3.3 Likelihood Cross-Validation

  • Likelihood cross-validation supports edge correction and adaptive or spatiotemporal bandwidth selection, but shares practical drawbacks with LSCV and can be sensitive to outliers.It selects bandwidth by maximizing a leave-one-out average of the log estimated density.Source: §3.3 · p. 8

3.4 Bootstrapping

  • Bootstrap selection minimizes bootstrap-estimated MISE; Gaussian-kernel calculations can be analytic, edge-corrected versions retain some savings, and adaptive estimation requires manual evaluation.The method uses a reference density and repeated simulated samples; a generously smoothed reference, such as one using the oversmoothing bandwidth, is recommended.Source: §3.4 · pp. 8–9

3.5 Other Methods

  • Bootstrap selection with an oversmoothing reference performed well overall, while other selectors often do not transfer to adaptive or bounded spatial data and Bayesian methods struggled with heterogeneous data.The authors describe this performance as a finding from their applications and ongoing work, with further research needed on reference-density choice.Source: §3.5 · p. 9

4 Spatial Relative Risk

Spatial relative risk compares two kernel-estimated density functions over a common study window, typically contrasting disease cases with controls. The section reviews estimation, bandwidth selection, and inference for these risk surfaces.

4.1 Ratio

  • The log-risk surface estimates log f − log g from case and control kernel densities; adaptive estimation can outperform fixed smoothing when patterns depart strongly from uniformity.Source: §4.1 · p. 10
  • Davies et al. show the symmetric adaptive estimator can be preferable when numerator and denominator densities are similar across much of the study window.It uses common bandwidth factors, obtainable from a pooled-data pilot; separate pilots yield the asymmetric estimator.Source: §4.1 · p. 10

4.2 Jointly Optimal Bandwidths

  • Three joint bandwidth selectors are proposed; the plug-in selector avoids the undersmoothing tendency of cross-validation and can outperform it, but requires subjective choices.The weighted-MISE selector emphasizes areas with more control data and is theoretically better suited when the two samples have similar spatial patterns; selecting an adaptive global bandwidth is complicated by preset pilot bandwidths.Source: §4.2 · p. 11

4.3 Monte-Carlo Tolerance Contours

  • Monte Carlo inference repeatedly reallocates pooled case and control locations and uses simulated risks to form p-value surfaces, but can be costly and unreliable far from observed data.The latter limitation arises because randomization there reflects implementation details, including kernel-tail behavior, more than the underlying processes.Source: §4.3 · p. 12

4.4 Asymptotic Tolerance Contours

  • Asymptotic p-value surfaces are more numerically stable than Monte Carlo for fixed-bandwidth risk and save substantial computation for adaptive risk.Adaptive asymmetric contours are more sensitive to local risk fluctuations and the common bandwidth, whereas symmetric contours provide a more conservative spatial test.Source: §4.4 · pp. 12–13

5 Code Break: Spatial Relative Risk with sparr

The section demonstrates sparr workflows for estimating fixed and adaptive spatial relative risk of PBC against sampled controls, including significance contours and comparison of adaptive estimates.

5 Code Break: Spatial Relative Risk with sparr

  • PBC is supplied as a marked ppp with coordinates, case/control labels, and a study window; the walkthrough estimates its risk relative to sampled controls.Source: §5 · p. 13

5.1 Fixed Bandwidth Risk Surfaces

  • Tolerance contours identify heightened PBC risk along much of the densely populated eastern border, mirroring the original analysis in Prince et al..Source: Figure 5 · p. 14, §5.1 · p. 15

5.2 Adaptive Bandwidth Risk Surfaces

  • The asymmetric adaptive surface localizes significantly increased PBC risk with greater dense-area detail, while small southern 5% pockets near the boundary warrant caution.Source: §5.2 · p. 16, Figure 6 · p. 16
  • The symmetric adaptive estimate retains stability in sparsely populated areas while preserving dense-area detail, and shows much the same significantly elevated-risk region as the asymmetric estimate.Source: Figure 6 · p. 16, §5.2 · p. 17

6 Spatiotemporal Relative Risk

Spatiotemporal relative risk estimates compare case and control densities over space and time, with methods for conditional spatial snapshots, time-static denominators, bandwidth selection, and testing elevated risk.

6.1 Time-Varying Denominator

  • With time-varying case and control densities, spatiotemporal relative risk uses common spatial and temporal bandwidths, while conditioning on time yields a normalized spatial snapshot.The joint surface’s slice at a given time is unnormalized; the conditional estimator differs by normalization.Source: §6.1 · pp. 17–18

6.2 Time-Constant Denominator

  • When the control density is static over time, the joint estimator combines a spatiotemporal case density with a purely spatial control density.This addresses settings such as an at-risk population distribution that remains constant while infected individuals’ locations change.Source: §6.2 · p. 18

6.3 Bandwidth Specification

  • Jointly optimal data-driven bandwidth selection for spatiotemporal relative risk remains underdeveloped, and the proposed joint LSCV selector performs poorly in practice.For time-static controls, that selector is inapplicable because the case density cannot be evaluated at purely spatial control locations; standalone density selectors or oversmoothing bandwidths can provide alternatives.Source: §6.3 · p. 18

6.4 Tolerance Contours

  • Tolerance-contour tests can assess elevated joint or conditional spatiotemporal risk; permutation simulations are computationally costly, making asymptotic p-value surfaces especially convenient.The hypotheses are posed as upper-tailed tests, although lower-tailed tests are also theoretically valid.Source: §6.4 · p. 19

7 Code Break: Spatiotemporal Relative Risk with sparr

The section demonstrates sparr’s spatiotemporal relative-risk workflow on anonymised FMD case and control data, from bandwidth selection and density estimation to risk mapping over time.

7.1 Bandwidth Experimentation

  • The analysis used case-selected spatial bandwidth h=2.919 for both case and control samples, with temporal-margin λ=8.828 for cases; this may not be optimal for controls.The passage says bias cancellations where f ≅g under a common h mitigate concerns about oversmoothing the denominator density to a certain extent.Source: §7.1 · p. 20

7.2 Density Estimation

  • spattemp.density estimates case space-time density with automatic edge correction, and its spatial and temporal margins reflect heterogeneity in the observed data.The example widens the time limits to [10, 230] from the observed [20, 220].Source: §7.2 · p. 21, Figure 7 · p. 21

7.3 Relative Risk

  • spattemp.slice returns joint and conditional spatial relative-risk surfaces for user-selected times; when the original spattemp.risk call used tolerate=TRUE, it also returns corresponding p-value surfaces.Source: §7.3 · p. 22
  • Significantly heightened risk moves from the northwest early in the study period south-southeast later, as shown in conditional risk slices and the animated joint-risk estimate.The animation superimposes upper-tailed 5% contours by default.Source: §7.3 · p. 22

8 Advanced Topics

This section covers practical approaches to accelerating adaptive spatial density estimation and interactively visualizing spatial and spatiotemporal relative-risk surfaces.

8.1 Partitioned and Multi-scale Adaptive Density/Intensity Estimation

  • A partitioned adaptive estimate approximates the full estimate by summing fixed-bandwidth estimates over bandwidth-binned data subsets, enabling DFT computation and reducing computational expense.Experiments found good accuracy even with δ = 0.05, or 20 bins.Source: §8.1 · pp. 23–24
  • About half a second with δ = 0.025, versus around 5 seconds for a direct estimate, produced a partitioned pooled-PBC estimate with minimal overall discrepancy.Figure 9 compares the direct and partitioned estimates and shows their difference.Source: Figure 9 · p. 24, §8.1 · p. 24
  • Augmenting planar coordinates with log-transformed Abramson bandwidths enables a 3D DFT whose fast slice lookup yields adaptive kernel estimates across valid global bandwidths, supporting exploratory analysis and bandwidth selection.The implemented bandwidth selectors in sparr for spatially adaptive kernel density estimates rely on this computational advantage.Source: §8.1 · pp. 24–25

8.2 Interactive 3D Plotting

  • Interactive 3D plotting of the PBC spatial relative-risk surface displays the elevated-risk tolerance contour at significance level 0.01 and can include a plane marking null risk.The plane is optional; Figure 10 shows screenshots of the interactive plot.Source: §8.2 · p. 25
  • Interactive FMD spatiotemporal plots show relative-risk isosurfaces and significant-risk tolerance contours, with heightened risk moving south from an early northwest infection bout as time increases.The contours mark weak and stringent significance levels of 5% and 0.01%, respectively.Source: §8.2 · p. 25

9 Conclusion and Ongoing Research Pursuits

The tutorial reviews kernel-based estimation of spatial and spatiotemporal density and relative-risk surfaces, emphasizing practical implementation. It makes these techniques available to applied researchers through the R package sparr and identifies bandwidth selection and other methodological questions for ongoing research.

9 Conclusion and Ongoing Research Pursuits

  • Spatially adaptive smoothing and spatiotemporal relative-risk computation extended the classical fixed-bandwidth estimator to improve estimates, inference, and data scope.These developments are among the methodological and computational advances reviewed in the tutorial.Source: §9 · p. 27
  • Optimal bandwidth selection remains unresolved for spatially adaptive relative risk and spatiotemporal estimators, with adaptive methods also incurring additional computational expense.The best approach to optimal smoothing for the transdimensional time-static control estimator is presently unclear; the authors are working to improve bootstrap-based selectors, which they have found ad hoc to be more stable than leave-one-out approaches.Source: §9 · p. 27
  • Other ongoing work includes tests for changes between spatial relative-risk surfaces estimated at different times.The tutorial also aims for sparr to facilitate applied research and multidisciplinary work.Source: §9 · p. 27
  • The tutorial reviews estimation and inference techniques for spatial and spatiotemporal density and relative-risk functions, and provides them in the public R package sparr.Its practical scope includes fixed and adaptive smoothing, edge correction, bandwidth selection, and Monte Carlo and asymptotic p-value surfaces for significant risk fluctuations.Source: §9 · p. 27

Appendix A Key sparr Content

Appendix A inventories sparr’s functions for spatial and spatiotemporal density and relative-risk estimation, bandwidth selection, adaptive smoothing, visualization, and slicing.

Spatial density estimation

  • sparr includes fixed and adaptive spatial kernel density estimation and multi-scale adaptive spatial density estimation.The listed functions include multiscale.density and multiscale.slice.Source: Appendix A · p. 27

Bandwidth selection

  • Bandwidth-selection content covers bootstrap, likelihood cross-validation, least-squares cross-validation, normal-scale, and oversmoothing approaches for densities.The appendix also lists BOOT.density and BOOT.spattemp, and LIK.density and LIK.spattemp.Source: Appendix A · p. 27

Visualization and slicing

  • The appendix also lists tools for plotting sparr objects and slicing spatiotemporal density or relative-risk estimates and p-value surfaces.It names multiscale.slice and spattemp.slice.Source: Appendix A · p. 27

Risk and spatiotemporal methods

  • The package content includes spatial relative-risk estimation and spatiotemporal density and relative-risk estimation with p-value surfaces.The listed functions include spattemp.density and spattemp.slice.Source: Appendix A · p. 27
Loading 1707.06888v1…