vcov.ppm {spatstat} | R Documentation |
Returns the variance-covariance matrix of the estimates of the parameters of a fitted point process model.
## S3 method for class 'ppm' vcov(object, ..., what = "vcov", verbose = TRUE, gam.action="warn", matrix.action="warn", hessian=FALSE)
object |
A fitted point process model (an object of class |
... |
Ignored. |
what |
Character string (partially-matched)
that specifies what matrix is returned.
Options are |
verbose |
Logical. If |
gam.action |
String indicating what to do if |
matrix.action |
String indicating what to do if the matrix
is ill-conditioned (so that its inverse cannot be calculated).
Options are |
hessian |
Logical. Use the negative Hessian matrix of the log pseudolikelihood instead of the Fisher information. |
This function computes the asymptotic variance-covariance
matrix of the estimates of the canonical parameters in the
point process model object
. It is a method for the
generic function vcov
.
object
should be an object of class "ppm"
, typically
produced by ppm
.
The canonical parameters of the fitted model object
are the quantities returned by coef.ppm(object)
.
The function vcov
calculates the variance-covariance matrix
for these parameters.
The argument what
provides three options:
what="vcov"
return the variance-covariance matrix of the parameter estimates
what="corr"
return the correlation matrix of the parameter estimates
what="fisher"
return the observed Fisher information matrix.
In all three cases, the result is a square matrix.
The rows and columns of the matrix correspond to the canonical
parameters given by coef.ppm(object)
. The row and column
names of the matrix are also identical to the names in
coef.ppm(object)
.
For models fitted by maximum pseudolikelihood (which is the
default in ppm
), the current implementation only works
for Poisson point processes.
The calculations are based on standard asymptotic theory for the maximum
likelihood estimator.
The observed Fisher information matrix of the fitted model
object
is first computed, by
summing over the Berman-Turner quadrature points in the fitted model.
The asymptotic variance-covariance matrix is calculated as the inverse of the
observed Fisher information. The correlation matrix is then obtained
by normalising.
For models fitted by the Huang-Ogata method (method="ho"
in
the call to ppm
), the implementation works for all
models. A Monte Carlo estimate of the Fisher information matrix is
calculated using the results of the original fit.
The argument verbose
makes it possible to suppress some
diagnostic messages.
The asymptotic theory is not correct if the model was fitted using
gam
(by calling ppm
with use.gam=TRUE
).
The argument gamaction
determines what to do in this case.
If gamaction="fatal"
, an error is generated.
If gamaction="warn"
, a warning is issued and the calculation
proceeds using the incorrect theory for the parametric case, which is
probably a reasonable approximation in many applications.
If gamaction="silent"
, the calculation proceeds without a
warning.
If hessian=TRUE
then the negative Hessian (second derivative)
matrix of the log pseudolikelihood, and its inverse,
will be computed.
For non-Poisson models, this is not a valid estimate of variance,
but is useful for other calculations.
A square matrix.
An error message that reports system is computationally singular indicates that the determinant of the Fisher information matrix was either too large or too small for reliable numerical calculation. This can occur either because of numerical overflow or because of collinearity in the covariates. Most commonly it occurs because of numerical overflow: to check this, rescale the coordinates of the data points and refit the model. See the Examples.
Adrian Baddeley Adrian.Baddeley@csiro.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
X <- rpoispp(42) fit <- ppm(X, ~ x + y) vcov(fit) vcov(fit, what="Fish") # example of singular system data(demopat) m <- ppm(demopat, ~polynom(x,y,2)) ## Not run: try(v <- vcov(m)) ## End(Not run) # rescale x, y coordinates to range [0,1] x [0,1] approximately demopat <- rescale(demopat, 10000) m <- ppm(demopat, ~polynom(x,y,2)) v <- vcov(m)