View source: R/Estimate_st_intensity.R
| estimate.st.intensity | R Documentation |
It returns estimates of the full spatio-temporal intensity together with its
spatial and temporal marginal components.
The output also includes the test statistic
S(u,t) and its spatial and temporal marginal profiles
S_{\mathrm{space}}(u) and S_{\mathrm{time}}(t)
(equations (11)–(13) in Ghorbani et al., 2021),
as well as several deviation tests (e.g., equation (15) in Ghorbani et al., 2021)
that quantify departures from first-order separability.
estimate.st.intensity(
X,
s.region,
t.region,
at = c("pixels", "points"),
n.grid = c(25, 25, 20)
)
X |
A numeric matrix with three columns giving the event coordinates
( |
s.region |
A numeric matrix with two columns defining the polygonal boundary of the spatial observation region. |
t.region |
A numeric vector of length 2 specifying the temporal observation window. |
at |
Character string; either |
n.grid |
A numeric vector of length 3 giving the number of grid cells in
the |
The estimation follows the kernel framework of
Ghorbani et al. (2021). A Gaussian kernel is applied in each
spatial and temporal dimension. Spatial bandwidths are estimated using
Diggle’s method, and the temporal bandwidth is obtained by the
Sheather–Jones direct plug-in (SJ-DPI) approach
(see calc.bandwidths.and.edgecorr for implementation details).
Edge corrections and bandwidths are computed using the calc.bandwidths.and.edgecorr.
The non-separable intensity estimate is
\hat{\rho}(u,t) =
\sum_{i=1}^n
\frac{K_\epsilon^2\!\left(u-u_i\right)}{C_{W,\epsilon}(u_i)}
\frac{K_\delta^1\!\left(t-t_i\right)}{C_{T,\delta}(t_i)},
where k_b(v) = k(v/b)/b^d is a d-dimensional kernel with bandwidth b > 0, and K^1 and K^2 are Gaussian kernels with spatial and temporal
bandwidths \epsilon and \delta. C_{W,\epsilon}(u_i) and C_{T,\delta}(t_i) are spatial and temporal edge corrections, respectively.
For estimate of the separable counterparts and more details see equations (3)-(5) in Ghorbani et al., 2021).
The separability test is:
S(u, t) = \frac{\hat \rho(u, t)}{\hat\rho_{\mathrm{space}}(u)\hat\rho_{\mathrm{time}}(t)/n},
where n is the number of observed points.
Several deviation statistics are provided to quantify departures from separability
deviation.t1: Integral of absolute deviations \int_{W\times T}|\hat\rho(u,t) - \hat\rho_{\mathrm{sep}}(u,t)|\mathrm{d}u\mathrm{d}t.
deviation.t2: Integral of absolute deviation of inverse intensities \int_{W\times T}|1/\hat\rho(u,t) - 1/\hat\rho_{\mathrm{sep}}(u,t)|\mathrm{d}u\mathrm{d}t.
deviation.t3: Sum of log-ratio deviations \sum_i\big(\log(\hat\rho(u_i,t_i)- \log(\hat\rho_{\mathrm{sep}}(u_i,t_i))\big).
deviation.t4: Integral of the S-function.
When at = "points", intensities and diagnostics are evaluated at
the observed event locations.
A list containing:
Grid vectors for x, y, and t (returned only when at = "pixels").
Estimated spatial bandwidth used in Gaussian kernels.
Estimated temporal bandwidth.
Estimated spatial intensity surface (pixels only).
Estimated temporal intensity profile (pixels only).
Separable spatio-temporal intensity estimate.
Non-separable spatio-temporal intensity estimate.
Test function S(u,t) as the ratio of non-separable to separable intensity estimates.
Marginal sum of S(u,t) over time (space profile).
Marginal sum of S(u,t) over space (time profile).
Deviation statistic: Integral of absolute deviations.
Deviation statistic: absolute deviation of inverse intensities.
Deviation statistic: sum of log-ratio deviations.
Total integral of the S-function.
Mohammad Ghorbani mohammad.ghorbani@slu.se
Nafiseh Vafaei nafiseh.vafaei@ltu.se
Ghorbani M., Vafaei N., Dvořák J., Myllymäki M. (2021). Testing the first-order separability hypothesis for spatio-temporal point patterns. Computational Statistics & Data Analysis, 161, 107245.
calc.bandwidths.and.edgecorr,
global.envelope.test,
chi2.test,
dHS.test
set.seed(123)
X <- cbind(runif(100), runif(100), runif(100, 0, 10))
s.region <- matrix(c(0, 0, 1, 0, 1, 1, 0, 1), ncol = 2, byrow = TRUE)
t.region <- c(0, 10)
result <- estimate.st.intensity(X, s.region, t.region, at = "pixels", n.grid = c(64, 64, 32))
str(result$S.fun)
image(result$S.fun[,,5], main = "S-function slice at t[5]",
col = topo.colors(50))
contour(result$S.fun[,,5], add=TRUE)
str(result[c("deviation.t1","deviation.t3","deviation.t4")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.