update.ppm {spatstat} | R Documentation |
update
method for class "ppm"
.
## S3 method for class 'ppm': update(object, ..., fixdummy=TRUE)
object |
An existing fitted point process model,
typically produced by ppm .
|
... |
Arguments to be updated in the new call to ppm .
|
fixdummy |
Logical flag indicating whether the quadrature scheme for the
call to ppm should use the same set of dummy points
as that in the original call.
|
This is a method for the generic function update
for the class "ppm"
. An object of class "ppm"
describes a fitted point process model. See ppm.object
)
for details of this class.
update.ppm
will modify the point process model
specified by object
according to the new arguments given,
then re-fit it.
The actual re-fitting is performed by the model-fitting
function ppm
.
If you are comparing several model fits to the same data,
or fits of the same model to different data, it is
strongly advisable to use update.ppm
rather than trying to fit them by hand.
This is because update.ppm
re-fits the model
in a way which is comparable to the original fit.
The arguments ...
are matched to the formal arguments
of ppm
as follows.
First, all the named arguments in ...
are matched
with the formal arguments of ppm
.
Use name=NULL
to remove the argument name
from the
call.
Second, any unnamed arguments in ...
are
matched with formal arguments of ppm
if the matching
is obvious from the class of the object. Thus ...
may contain
"ppp"
or "quad"
,
which will be interpreted as the named argument Q
;
"formula"
, which will be
interpreted as the named argument trend
;
"interact"
, which will be
interpreted as the named argument interaction
;
"data.frame"
, which will be
interpreted as the named argument covariates
.
When fixdummy=FALSE
, calling update.ppm
is exactly the same as calling ppm
with the updated
arguments. However, the original and updated models
are not strictly comparable (for example, their pseudolikelihoods
are not strictly comparable) unless they used the same set of dummy
points for the quadrature scheme. Setting fixdummy=TRUE
ensures that the re-fitting will be performed using the same set
of dummy points. This is highly recommended.
Another fitted point process model (object of class "ppm"
).
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
data(nztrees) data(cells) # fit the stationary Poisson process fit <- ppm(nztrees, ~ 1) # fit a nonstationary Poisson process fitP <- update(fit, trend=~x) fitP <- update(fit, ~x) # fit a stationary Strauss process fitS <- update(fit, interaction=Strauss(13)) fitS <- update(fit, Strauss(13)) # oops, forgot the edge correction fitS <- update(fitS, rbord=13) # re-fit the model to a subset # of the original point pattern nzw <- owin(c(0,148),c(0,95)) nzsub <- nztrees[,nzw] fut <- update(fitS, Q=nzsub) fut <- update(fitS, nzsub) # WARNING: the point pattern argument is called 'Q'