runif.sphwin | R Documentation |
Generates the uniform distribution or a random point pattern using the (homogeneous) Poisson process, on a sphere or a subset of a sphere. Includes CSR (complete spatial randomness).
runif.sphwin(n, win = sphwin(type = "sphere"), nsim=1, drop=TRUE, as.sp=TRUE, ndim="2") rpoispp.sphwin(lambda, win = sphwin(type = "sphere"), lmax=NULL, ..., nsim=1, drop=TRUE, as.sp=TRUE, ndim="2")
n |
The number of points to be simulated. An integer. |
lambda |
The intensity of the point process to be simulated. A numeric of
length 1 or an object of class |
win |
The window, an object of type |
lmax |
A numeric of length 1 giving the maximum value of |
... |
Arguments passed to |
nsim |
Number of simulated realisations to be generated. |
drop |
Logical. If |
as.sp |
Logical. If |
ndim |
A string, taking value |
runif.sphwin
generates a realisation of n
points of the
uniform distribution inside the window win
(if win
is an
object of class sphwin
).
If lambda
is a single number, then rpoispp.sphwin
this
algorithm generates a realisation of the uniform Poisson process (also
known as Complete Spatial Randomness, CSR) inside the window
win
with intensity lambda
(points per unit area).
If lambda
is a function, then rpoispp.sphwin
uses the
adaptation to point patterns on the sphere of Lewis and Shedler's (1979)
rejection sampling algorithm. According to this algorithm, a uniform
Poisson process of intensity lmax
is generated, and a point at
location s
is retained with probability lambda(s)/lmax
.
If nsim=1
and drop=FALSE
then a single item as described below; otherwise a list containing nsim
items.
An item is determined by the values of as.sp
and ndim
:
If as.sp=FALSE
and ndim="2"
, a two column matrix giving the locations of the simulated points.
If as.sp=FALSE
and ndim="3"
, a three column matrix giving the locations of the simulated points.
If as.sp=TRUE
and ndim="2"
, an object of class sp2
giving the locations of the simulated points.
If as.sp=TRUE
and ndim="3"
, an object of class sp3
giving the locations of the simulated points.
The function rpoispp.sphwin
is the analogue for point processes on
the sphere of the function rpoispp
in
spatstat, which is the corresponding function for point
processes in R^2. Hence elements of this help page have been taken
from rpoispp
with the permission of
A. J. Baddeley. This enables the relevant information on this help
page to be consistent with that for rpoispp
.
It is hoped that this will minimise or remove any confusion for users
of both spatstat and spherstat.
Tom Lawrence <email: tjlawrence@bigpond.com>
Lewis, P.A.W. and Shedler, G.S. (1979) Simulation of non-homogeneous Poisson processes by thinning. Naval Logistics Quarterly 26, 406–413.
rpoispp
, rFisher
,
rHardcore.sphwin
, rMatClust.sphwin
,
rMaternI.sphwin
, rMaternII.sphwin
,
rStrauss.sphwin
, rThomas.sphwin
sph <- sphwin(type="sphere") rus <- runif.sphwin(n=150, win=sph, as.sp=TRUE, ndim="2") rus rps <- rpoispp.sphwin(win=sph, lambda=150, as.sp=TRUE, ndim="2") rps
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.