varcount {spatstat.model} | R Documentation |
Predicted Variance of the Number of Points
Description
Given a fitted point process model, calculate the predicted variance
of the number of points in a nominated set B
.
Usage
varcount(model, B=Window(model), ..., dimyx = NULL, relative=FALSE)
Arguments
model |
A fitted point process model
(object of class |
B |
A window (object of class |
... |
Additional arguments passed to |
dimyx |
Spatial resolution for the calculations.
Argument passed to |
relative |
Logical value specifying whether to divide the variance by the mean value. |
Details
The function varcount
calculates the variance of the number of points
falling in a specified window B
according to the model
.
It can also calculate the variance of a sum of weights attached
to each random point.
If relative=FALSE
(the default), the result is the variance.
If relative=TRUE
, the result is the variance divided by the
mean, which is the overdispersion index (equal to 1 if the number of
points has a Poisson distribution).
The model
should be a fitted point process model
(object of class "ppm"
, "kppm"
or "dppm"
).
-
If
B
is a window,varcount
calculates the variance of the number of points falling inB
, according to the fittedmodel
.If the
model
depends on spatial covariates other than the Cartesian coordinates, thenB
should be a subset of the domain in which these covariates are defined. -
If
B
is a pixel image,varcount
calculates the variance ofT = \sum_i B(x_i)
, the sum of the values ofB
over all random points falling in the domain of the image.If the
model
depends on spatial covariates other than the Cartesian coordinates, then the domain of the pixel image,as.owin(B)
, should be a subset of the domain in which these covariates are defined. -
If
B
is afunction(x,y)
orfunction(x,y,...)
thenvarcount
calculates the variance ofT = \sum_i B(x_i)
, the sum of the values ofB
over all random points falling inside the windowW=as.owin(model)
, the window in which the original data were observed.
The variance calculation involves the intensity and the
pair correlation function of the model.
The calculation is exact (up to discretisation error)
for models of class "kppm"
and "dppm"
,
and for Poisson point process models of class "ppm"
.
For Gibbs point process models of class "ppm"
the
calculation depends on the Poisson-saddlepoint approximations
to the intensity and pair correlation function, which are rough
approximations. The approximation is not yet implemented
for some Gibbs models.
Value
A single number.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk
See Also
predict.ppm
,
predict.kppm
,
predict.dppm
Examples
fitT <- kppm(redwood ~ 1, "Thomas")
B <- owin(c(0, 0.5), c(-0.5, 0))
varcount(fitT, B)
fitS <- ppm(swedishpines ~ 1, Strauss(9))
BS <- square(50)
varcount(fitS, BS)