I,
adjusted for spatially varying intensity.
Kmulti.inhom(X, I, J, lambdaI=NULL, lambdaJ=NULL, ..., r=NULL, breaks=NULL, correction=c("border", "isotropic", "Ripley", "translate"), lambdaIJ=NULL, sigma=NULL, varcov=NULL, lambdaX=NULL, update=TRUE, leaveoneout=TRUE)X
from which distances are measured. See Details.
X to which
distances are measured. See Details.
X[I].
Either a pixel image (object of class "im"),
a numeric vector containing the intensity values
at each of the points in X[I],
a fitted point process model
(object of class "ppm" or "kppm" or "dppm"),
or a function(x,y) which
can be evaluated to give the intensity value at any location,
X[J].
Either a pixel image (object of class "im"),
a numeric vector containing the intensity values
at each of the points in X[J],
a fitted point process model
(object of class "ppm" or "kppm" or "dppm"),
or a function(x,y) which
can be evaluated to give the intensity value at any location.
"border", "bord.modif",
"isotropic", "Ripley", "translate",
"none" or "best".
It specifies the edge correction(s) to be applied.
Alternatively correction="all" selects all options.
lambdaI and lambdaJ
for each pair of points, the first point belonging to subset
I and the second point to subset J.
density.ppp
to control the smoothing bandwidth, when lambda is
estimated by kernel smoothing.
X.
Either a pixel image (object of class "im"),
a numeric vector containing the intensity values
at each of the points in X,
a fitted point process model
(object of class "ppm" or "kppm" or "dppm"),
or a function(x,y) which
can be evaluated to give the intensity value at any location.
If present, this argument overrides both lambdaI and
lambdaJ.
lambdaI, lambdaJ or lambdaX
is a fitted point process model
(class "ppm", "kppm" or "dppm").
If update=TRUE (the default),
the model will first be refitted to the data X
(using update.ppm or update.kppm)
before the fitted intensity is computed.
If update=FALSE, the fitted intensity of the
model will be computed without re-fitting it to X.
density.ppp or
fitted.ppm) specifying whether to use a
leave-one-out rule when calculating the intensity.
"fv" (see fv.object).Essentially a data frame containing numeric columns
Essentially a data frame containing numeric columnstogether with a column or columns named
"border", "bord.modif",
"iso" and/or "trans",
according to the selected edge corrections. These columns contain
estimates of the function $KIJ(r)$
obtained by the edge corrections named.
Kmulti.inhom
is the counterpart, for spatially-inhomogeneous marked point patterns,
of the multitype $K$ function Kmulti.Suppose $X$ is a marked point process, with marks of any kind. Suppose $X[I]$, $X[J]$ are two sub-processes, possibly overlapping. Typically $X[I]$ would consist of those points of $X$ whose marks lie in a specified range of mark values, and similarly for $X[J]$. Suppose that $lambdaI(u)$, $lambdaJ(u)$ are the spatially-varying intensity functions of $X[I]$ and $X[J]$ respectively. Consider all the pairs of points $(u,v)$ in the point process $X$ such that the first point $u$ belongs to $X[I]$, the second point $v$ belongs to $X[J]$, and the distance between $u$ and $v$ is less than a specified distance $r$. Give this pair $(u,v)$ the numerical weight $1/(lambdaI(u) lambdaJ(u))$. Calculate the sum of these weights over all pairs of points as described. This sum (after appropriate edge-correction and normalisation) is the estimated inhomogeneous multitype $K$ function.
The argument X must be a point pattern (object of class
"ppp") or any data that are acceptable to as.ppp.
The arguments I and J specify two subsets of the
point pattern. They may be any type of subset indices, for example,
logical vectors of length equal to npoints(X),
or integer vectors with entries in the range 1 to
npoints(X), or negative integer vectors.
Alternatively, I and J may be functions
that will be applied to the point pattern X to obtain
index vectors. If I is a function, then evaluating
I(X) should yield a valid subset index. This option
is useful when generating simulation envelopes using
envelope.
The argument lambdaI supplies the values
of the intensity of the sub-process identified by index I.
It may be either
If lambdaI is omitted, then it will be estimated using
a `leave-one-out' kernel smoother, as described in Baddeley,
\Moller
and Waagepetersen (2000). The estimate of lambdaI for a given
point is computed by removing the point from the
point pattern, applying kernel smoothing to the remaining points using
density.ppp, and evaluating the smoothed intensity
at the point in question. The smoothing kernel bandwidth is controlled
by the arguments sigma and varcov, which are passed to
density.ppp along with any extra arguments.
Similarly lambdaJ supplies the values
of the intensity of the sub-process identified by index J.
Alternatively if the argument lambdaX is given, then it specifies
the intensity values for all points of X, and the
arguments lambdaI, lambdaJ will be ignored.
The argument r is the vector of values for the
distance $r$ at which $KIJ(r)$ should be evaluated.
It is also used to determine the breakpoints
(in the sense of hist)
for the computation of histograms of distances.
First-time users would be strongly advised not to specify r.
However, if it is specified, r must satisfy r[1] = 0,
and max(r) must be larger than the radius of the largest disc
contained in the window.
Biases due to edge effects are
treated in the same manner as in Kinhom.
The edge corrections implemented here are
The pair correlation function pcf can also be applied to the
result of Kmulti.inhom.
Kmulti,
Kdot.inhom,
Kcross.inhom,
pcf
# Finnish Pines data: marked by diameter and height
plot(finpines, which.marks="height")
II <- (marks(finpines)$height <= 2)
JJ <- (marks(finpines)$height > 3)
K <- Kmulti.inhom(finpines, II, JJ)
plot(K)
# functions determining subsets
f1 <- function(X) { marks(X)$height <= 2 }
f2 <- function(X) { marks(X)$height > 3 }
K <- Kmulti.inhom(finpines, f1, f2)
Run the code above in your browser using DataLab