Kdot.inhom(X, i, lambdaI=NULL, lambdadot=NULL, ..., r=NULL, breaks=NULL,
correction = c("border", "isotropic", "Ripley", "translate"),
sigma=NULL, varcov=NULL, lambdaIdot=NULL)
X
from which distances are measured.
A character string (or something that will be converted to a
character string).
Defaults to the first level of marks(X)
.i
.
Either a pixel image (object of class "im"
),
a numeric vector containing the intensity values
at each of the type i
"im"
),
a numeric vector containing the intensity values at each of the
points in X
, or a functi
r
.
Not normally invoked by the user. See the Details section."border"
, "bord.modif"
,
"isotropic"
, "Ripley"
, "translate"
,
"translation"
,
"none"
or lambdaI
, lambdadot
if they are omitted.lambdaI
, lambdadot
if they are omitted.
Incompatible with sigma
.lambdaI
and lambdadot
for each pair of points, the first point of type i
and
the second of any type."fv"
(see fv.object
).Essentially a data frame containing numeric columns
"border"
, "bord.modif"
,
"iso"
and/or "trans"
,
according to the selected edge corrections. These columns contain
estimates of the function $K_{i\bullet}(r)$
obtained by the edge corrections named.i
is interpreted as
a level of the factor X$marks
. It is converted to a character
string if it is not already a character string.
The value i=1
does not
refer to the first level of the factor.Kdot
to include an adjustment for spatially inhomogeneous intensity,
in a manner similar to the function Kinhom
.Briefly, given a multitype point process, consider the points without their types, and suppose this unmarked point process has intensity function $\lambda(u)$ at spatial locations $u$. Suppose we place a mass of $1/\lambda(\zeta)$ at each point $\zeta$ of the process. Then the expected total mass per unit area is 1. The inhomogeneous ``dot-type'' $K$ function $K_{i\bullet}^{\mbox{inhom}}(r)$ equals the expected total mass within a radius $r$ of a point of the process of type $i$, discounting this point itself. If the process of type $i$ points were independent of the points of other types, then $K_{i\bullet}^{\mbox{inhom}}(r)$ would equal $\pi r^2$. Deviations between the empirical $K_{i\bullet}$ curve and the theoretical curve $\pi r^2$ suggest dependence between the points of types $i$ and $j$ for $j\neq i$.
The argument X
must be a point pattern (object of class
"ppp"
) or any data that are acceptable to as.ppp
.
It must be a marked point pattern, and the mark vector
X$marks
must be a factor.
The argument i
will be interpreted as a
level of the factor X$marks
. (Warning: this means that
an integer value i=3
will be interpreted as the number 3,
not the 3rd smallest level).
If i
is missing, it defaults to the first
level of the marks factor, i = levels(X$marks)[1]
.
The argument lambdaI
supplies the values
of the intensity of the sub-process of points of type i
.
It may be either
[object Object],[object Object],[object Object],[object Object]
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 the argument lambdadot
should contain
estimated values of the intensity of the entire point process.
It may be either a pixel image, a numeric vector of length equal
to the number of points in X
, a function, or omitted.
For advanced use only, the optional argument lambdaIdot
is a matrix containing estimated
values of the products of these two intensities for each pair of
points, the first point of type i
and the second of any type.
The argument r
is the vector of values for the
distance $r$ at which $K_{i\bullet}(r)$ should be evaluated.
The values of $r$ must be increasing nonnegative numbers
and the maximum $r$ value must exceed the radius of the
largest disc contained in the window.
The argument correction
chooses the edge correction
as explained e.g. in Kest
.
The pair correlation function can also be applied to the
result of Kcross.inhom
; see pcf
.
Kdot
,
Kinhom
,
Kcross.inhom
,
Kmulti.inhom
,
pcf
# Lansing Woods data
data(lansing)
lansing <- lansing[seq(1,lansing$n, by=10)]
ma <- split(lansing)$maple
lg <- unmark(lansing)
# Estimate intensities by nonparametric smoothing
lambdaM <- density.ppp(ma, sigma=0.15, at="points")
lambdadot <- density.ppp(lg, sigma=0.15, at="points")
K <- Kdot.inhom(lansing, "maple", lambdaI=lambdaM,
lambdadot=lambdadot)
# Equivalent
K <- Kdot.inhom(lansing, "maple", sigma=0.15)
# synthetic example: type A points have intensity 50,
# type B points have intensity 50 + 100 * x
lamB <- as.im(function(x,y){50 + 100 * x}, owin())
lamdot <- as.im(function(x,y) { 100 + 100 * x}, owin())
X <- superimpose(A=runifpoispp(50), B=rpoispp(lamB))
K <- Kdot.inhom(X, "B", lambdaI=lamB, lambdadot=lamdot)
Run the code above in your browser using DataLab