Fit a point process model to a point pattern dataset on a linear network
lppm(X, ...)# S3 method for formula
lppm(X, interaction=NULL, ..., data=NULL)
# S3 method for lpp
lppm(X, ..., eps=NULL, nd=1000, random=FALSE)
An object of class "lppm" representing the fitted model.
There are methods for print, predict,
coef and similar functions.
Either an object of class "lpp" specifying a point pattern
on a linear network, or a formula specifying the
point process model.
Arguments passed to ppm.
An object of class "interact"
describing the point process interaction
structure, or NULL indicating that a Poisson process (stationary
or nonstationary) should be fitted.
Optional. The values of spatial covariates (other than the Cartesian coordinates) required by the model. A list whose entries are images, functions, windows, tessellations or single numbers.
Optional. Spacing between dummy points along each segment of the network.
Optional. Total number of dummy points placed on
the network. Ignored if eps is given.
Logical value indicating whether the grid of dummy points should be placed at a randomised starting position.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Greg McSwiggan.
This function fits a point process model to data that specify
a point pattern on a linear network. It is a counterpart of
the model-fitting function ppm designed
to work with objects of class "lpp" instead of "ppp".
The function lppm is generic, with methods for
the classes formula and lppp.
In lppm.lpp
the first argument X should be an object of class "lpp"
(created by the command lpp) specifying a point pattern
on a linear network.
In lppm.formula,
the first argument is a formula in the R language
describing the spatial trend model to be fitted. It has the general form
pattern ~ trend where the left hand side pattern is usually
the name of a point pattern on a linear network
(object of class "lpp")
to which the model should be fitted, or an expression which evaluates
to such a point pattern;
and the right hand side trend is an expression specifying the
spatial trend of the model.
Variable names which appear in the trend can be
the name of an object in the current environment
the name of an entry in the list covariates
one of the reserved names x, y, seg,
tp representing respectively the spatial coordinates \(x\)
and \(y\), and the local coordinates seg (line segment
index) and tp (relative position along the segment).
Covariates which are objects in the environment or entries in the
list covariates may have any of the following formats:
giving the values of a spatial covariate at
a fine grid of locations. It should be an object of
class "im", see im.object,
or class "linim", see linim.
which can be evaluated
at any location on the network to obtain the value of the spatial
covariate.
This may be a function of class "linfun" (function on a
network) or "funxy" (function in two dimensional space).
Alternatively it may be any function in the R language:
the first two arguments of the function should be the
Cartesian coordinates \(x\) and \(y\). The function may have
additional arguments include seg, tp and
marks and other arguments.
interpreted as a logical variable
which is TRUE inside the window and FALSE outside
it. This should be an object of class "owin".
interpreted as a factor covariate.
For each spatial location, the factor value indicates
which tile of the tessellation it belongs to.
This should be an object of class "tess" or "lintess".
indicating a covariate that is constant in this dataset.
Other arguments ... are passed from lppm.formula
to lppm.lpp and from lppm.lpp to ppm.
McSwiggan, G. (2019) Spatial point process methods for linear networks with applications to road accident analysis. PhD thesis, University of Western Australia.
methods.lppm,
predict.lppm,
ppm,
lpp.
X <- runiflpp(15, simplenet)
lppm(X ~1)
lppm(X ~x)
marks(X) <- factor(rep(letters[1:3], 5))
lppm(X ~ marks)
lppm(X ~ marks * x)
Run the code above in your browser using DataLab