stppm {stopp}R Documentation

Fit a Poisson process model to a spatio-temporal point pattern

Description

This function fits a Poisson process model to an observed spatio-temporal point pattern stored in a stp object.

Usage

stppm(
  X,
  formula,
  covs = NULL,
  marked = FALSE,
  spatial.cov = FALSE,
  verbose = FALSE,
  mult = 4,
  interp = TRUE,
  parallel = FALSE,
  sites = 1,
  seed = NULL,
  ncube = NULL,
  grid = FALSE,
  ncores = 2,
  lsr = FALSE
)

Arguments

X

A stp object

formula

An object of class "formula": a symbolic description of the model to be fitted. The current version only supports formulas depending on the spatial and temporal coordinates: x, y, t.

covs

A list containing stcov objects of possible spatio-temporal covariates. It is advisable to construct the stcov objects with stcov. Each stcov object should contain the spatio-temporal coordinates and the covariate values as the fourth column, named as the covariate called in the formula.

marked

Logical value indicating whether the point process model to be fit is multitype. Default to FALSE.

spatial.cov

Logical value indicating whether the point process model to be fit depends on spatio-temporal covariates. Default to FALSE.

verbose

Default to FALSE.

mult

The multiplicand of the number of data points, for setting the number of dummy points to generate for the quadrature scheme.

interp

Logical value indicating whether to interpolate covariate values to dummy points or to use the covariates locations as dummies. Default to TRUE.

parallel

Logical values indicating whether to use parallelization to interpolate covariates. Default to FALSE.

sites

.....

seed

The seed used for the simulation of the dummy points. Default to NULL.

ncube

Number of cubes used for the cubature scheme.

grid

Logical value indicating whether to generate dummy points on a regular grid or randomly. Default to FALSE.

ncores

Number of cores to use, if parallelizing. Default to 2.

lsr

Logical value indicating whether to use Logistic Spatio-Temporal Regression or Poisson regression. Default to FALSE.

Details

We assume that the template model is a Poisson process, with a parametric intensity or rate function \lambda(\textbf{u}, t; \theta) with space and time locations \textbf{u} \in W, t \in T and parameters \theta \in \Theta.

Estimation is performed through the fitting of a glm using a spatio-temporal version of the quadrature scheme by Berman and Turner (1992).

Value

An object of class stppm. A list of

IntCoefs

The fitted coefficients

X

The stp object provided as input

nX

The number of points in X

I

Vector indicating which points are dummy or data

y_resp

The response variable of the model fitted to the quadrature scheme

formula

The formula provided as input

l

Fitted intensity

mod_global

The glm object of the model fitted to the quadrature scheme

newdata

The data used to fit the model, without the dummy points

time

Time elapsed to fit the model, in minutes

Author(s)

Nicoletta D'Angelo and Marco Tarantino

References

Baddeley, A. J., Møller, J., and Waagepetersen, R. (2000). Non-and semi-parametric estimation of interaction in inhomogeneous point patterns. Statistica Neerlandica, 54(3):329–350

Berman, M. and Turner, T. R. (1992). Approximating point process likelihoods with glim. Journal of the Royal Statistical Society: Series C (Applied Statistics), 41(1):31–38

D'Angelo, N., Adelfio, G., and Mateu, J. (2023). Locally weighted minimum contrast estimation for spatio-temporal log-Gaussian Cox processes. Computational Statistics & Data Analysis, 180, 107679.

See Also

plot.stppm, print.stppm, summary.stppm

locstppm

Examples


set.seed(2)
ph <- rstpp(lambda = 200)
hom1 <- stppm(ph, formula = ~ 1)

## Inhomogeneous
set.seed(2)
pin <- rstpp(lambda = function(x, y, t, a) {exp(a[1] + a[2]*x)}, par = c(2, 6))
inh1 <- stppm(pin, formula = ~ x)

## Inhomogeneous depending on external covariates

set.seed(2)
df1 <- data.frame(runif(100), runif(100), runif(100), rpois(100, 15))
df2 <- data.frame(runif(100), runif(100), runif(100), rpois(100, 15))

obj1 <- stcov(df1, names = "cov1")
obj2 <- stcov(df2, names = "cov2")

covariates <- list(cov1 = obj1, cov2 = obj2)

inh2 <- stppm(pin, formula = ~ x + cov2, covs = covariates, spatial.cov = TRUE)

## Inhomogeneous semiparametric

inh3 <- stppm(pin, formula = ~ s(x, k = 30))

## Multitype

set.seed(2)
dfA <- data.frame(x = runif(100), y = runif(100), t = runif(100), 
                  m1 = rep(c("A"), times = 100))
dfB <- data.frame(x = runif(50), y = runif(50), t = runif(50), 
                  m1 = rep(c("B"), each = 50))

stpm1 <- stpm(rbind(dfA, dfB))

inh4 <- stppm(stpm1, formula = ~ x + s(m1, bs = "re"), marked = TRUE)




[Package stopp version 0.2.3 Index]