Last chance! 50% off unlimited learning
Sale ends in
effectfun(model, covname, ...)
"ppm"
).name=value
) if required. If the covariate named covname
is numeric (rather than a factor
or logical variable), the return value is
also of class "fv"
so that it can be plotted immediately.
model
should be an object of class
"ppm"
representing a point process model fitted to
point pattern data. The model's trend formula should involve a spatial covariate
named covname
. This could be "x"
or "y"
representing one of the Cartesian coordinates.
More commonly the covariate
is another, external variable that was supplied when fitting the model.
The command effectfun
computes the fitted intensity
of the point process model
as a function of the covariate
named covname
.
The return value can be plotted immediately, giving a
plot of the fitted intensity against the value of the covariate.
If the model also involves covariates other than covname
,
then these covariates will be held fixed. Values for
these other covariates must be provided as arguments
to effectfun
in the form name=value
.
This command is just a wrapper for the prediction method
predict.ppm
. For more complicated computations
about the fitted intensity, use predict.ppm
.
ppm
,
predict.ppm
,
fv.object
data(copper)
X <- copper$SouthPoints
D <- distmap(copper$SouthLines)
fit <- ppm(X, ~polynom(Z, 7), covariates=list(Z=D))
plot(effectfun(fit, "Z"))
fit <- ppm(X, ~x + polynom(Z, 7), covariates=list(Z=D))
plot(effectfun(fit, "Z", x=20))
Run the code above in your browser using DataLab