| run_fmd_example | R Documentation |
This function tests first-order separability for the foot-and-mouth disease (FMD) outbreak data observed at the North Cumbria study region provided by the stpp package.
run_fmd_example()
The example includes kernel-based estimates of the spatio-temporal intensity and related separability diagnostics on a regular spatio-temporal grid for fmd data as well as the dHSIC test.
The datasets fmd and northcumbria are loaded from the
stpp package and are used purely for illustration.
They do not contain confidential information and have no scientific value.
An object of class "test" returned by
dHS.test.
Diggle, P., Rowlingson, B. and Su, T. (2005). Point process methodology for on-line spatio-temporal disease surveillance. Environmetrics, 16, 423–434.
fmd,
northcumbria,
S.based.functions,
dHS.test
if (requireNamespace("stpp", quietly = TRUE) ) {
library(stpp)
# Load data
data("fmd", "northcumbria", package = "stpp")
# Define spatial and temporal region
s.region <- northcumbria / 1000
t.region <- c(0, 200)
# Create a spatio-temporal point pattern
X <- as.3dpoints(
fmd[, 1] / 1000,
fmd[, 2] / 1000,
fmd[, 3]
)
# Define observation window
ObsW <- spatstat.geom::owin(
poly = list(
x = s.region[, 1],
y = s.region[, 2]
)
)
# Run Hilbert-Schmidt independence test
oldpar <- par(no.readonly = TRUE) # save current graphics settings
on.exit(par(oldpar), add = TRUE) # restore after example
dHS.test(
X,
sim.procedure = "block_per",
nblocks = 5L,
nperm = 1999L,
nsim = 199L,
bandwidth = NULL
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.