| plot_stpp | R Documentation |
Provides flexible visualization tools for spatio-temporal point patterns. Depending on the chosen display type, the function produces one of three plots:
A 3D scatterplot showing event locations in space–time ("3D");
A 2D spatial projection of points in the spatial plane ("space");
A temporal histogram with an overlaid kernel density curve ("time").
The input dataset must contain three columns corresponding to the spatial (x, y)
and temporal (t) coordinates of events.
plot_stpp(data, type = c("3D", "space", "time"), time_bins = 30, title = NULL)
data |
A numeric matrix or data frame with at least three columns representing event coordinates.
If |
type |
Character string specifying the type of visualization to produce:
|
time_bins |
Integer specifying the number of bins in the histogram when |
title |
Optional character string giving a plot title. If |
The function serves as an exploratory tool for investigating the spatial, temporal, or joint space–time structure of point pattern data. Such visualization is often a first step before conducting statistical analyses of separability or intensity modeling (see Ghorbani et al., 2021).
Displays events in a 3D coordinate system using the scatterplot3d package, allowing a quick assessment of clustering and temporal trends in space–time.
Projects points onto the spatial plane (x–y),
showing spatial structure independent of time.
Displays the marginal temporal distribution of events as a histogram with a kernel density overlay, facilitating the visual detection of temporal nonstationarity.
Visualization is particularly useful for validating the realism of simulated
data (e.g. from rstpoispp or Gauss.st.F)
and for preliminary inspection prior to applying tests such as
chi2.test, global.envelope.test, or
dHS.test.
Produces a plot as a side effect. Nothing is returned.
The 3D visualization requires the scatterplot3d package.
Nafiseh Vafaei nafiseh.vafaei@slu.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.
rstpoispp,
estimate.st.intensity,
plot_stlgcp,
chi2.test,
dHS.test
set.seed(123)
X <- cbind(runif(100), runif(100), runif(100, 0, 10))
# Visualize point pattern in 3D space–time
plot_stpp(X, type = "3D")
# View spatial projection
plot_stpp(X, type = "space")
# Inspect temporal distribution
plot_stpp(X, type = "time", time_bins = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.