Last chance! 50% off unlimited learning
Sale ends in
supresid
takes a space-time point pattern and conditional intensity model and calculates a set of superposed residuals for further analysis.
supresid(X, cifunction, theta = NULL, k = NULL, lambda = NULL)
stpp
” object.
X
. The function should take arguments X
and an optional vector of parameters theta
.
cifunction
.
X
.
supresid
”, which is a list of
stpp
”.k
- $lambda_hat$ onto the observed point process. k
should be the maximum conditional intensity over the entire space-time window. If the model for the conditional intensity is correct, the residuals should be homogeneous Poisson with rate k
. Any patterns or inter-point interaction in the residuals indicates a lack of fit of the model. To test for homogeneity, a commonly used tool is Ripley's K-function, a version of which can be found in the spatstat
package.The conditional intensity function, cifunction
, should take X
as the first argument, and an optional theta
as the second argument, and return a vector of conditional intensity estimates with length equal to the number of points in X
, i.e. the length of X$x
. cifunction
is required, while lambda
is optional. lambda
eliminates the need for supresid
to calculate the conditional intensity at each observed point in X
.
If k
is not specified, the default is the maximum $lambda_hat$ estimated at the points.
Clements, R.A., Schoenberg, F.P., and Schorlemmer, D. (2011) Residual analysis methods for space-time point processes with applications to earthquake forecast models in California. Annals of Applied Statistics, 5, Number 4, 2549--2571.
stpp
, thinresid
, superthin
#===> load simulated data <===#
data(simdata)
X <- stpp(simdata$x, simdata$y, simdata$t)
#===> define conditional intensity function <===#
ci1 <- function(X, theta){theta[1]*exp(-theta[2]*X$x -
theta[3]*X$y - theta[4]*X$t)} #correct model
sresiduals1 <- supresid(X, ci1, theta = c(3000, 2, 2, 2))
sresiduals2 <- supresid(X, ci1, theta = c(2500, 5, 5, 10))
#===> plot results <===#
par(mfrow = c(1,2))
plot(sresiduals1)
plot(sresiduals2)
summary(sresiduals1)
summary(sresiduals2)
Run the code above in your browser using DataLab