Kcross.inhom(X, i, j, lambdaI=NULL, lambdaJ=NULL, ..., r=NULL, breaks=NULL,
correction = c("border", "isotropic", "Ripley", "translate"),
sigma=NULL, varcov=NULL,
lambdaIJ=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)
.X
to which distances are measured.
A character string (or something that will be
converted to a character string).
Defaults to the second 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
j
.
Either a pixel image (object of class "im"
),
a numeric vector containing the intensity values
at each of the type j
"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 lambdaJ
for each pair of points of types i
and j
respectively."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_{ij}(r)$
obtained by the edge corrections named.Kcross
to include an adjustment for spatially inhomogeneous intensity,
in a manner similar to the function Kinhom
. The inhomogeneous cross-type $K$ function is described by
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 arguments i
and j
will be interpreted as
levels 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
and j
are missing, they default to the first
and second level of the marks factor, respectively.
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, 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
should contain
estimated values of the intensity of the sub-process of points of
type j
. It may be either a pixel image, a function,
a numeric vector, or omitted.
The optional argument lambdaIJ
is for advanced use only.
It is a matrix containing estimated
values of the products of these two intensities for each pair of
data points of types i
and j
respectively.
The argument r
is the vector of values for the
distance $r$ at which $K_{ij}(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
.
}
i
and j
are always interpreted as
levels of the factor X$marks
. They are converted to character
strings if they are not already character strings.
The value i=1
does not
refer to the first level of the factor.
}
Kcross
,
Kinhom
,
Kdot.inhom
,
Kmulti.inhom
,
pcf
# method (1): estimate intensities by nonparametric smoothing lambdaM <- density.ppp(ma, sigma=0.15, at="points") lambdaW <- density.ppp(wh, sigma=0.15, at="points") K <- Kcross.inhom(lansing, "whiteoak", "maple", lambdaW, lambdaM)
# method (2): leave-one-out K <- Kcross.inhom(lansing, "whiteoak", "maple", sigma=0.15)
# method (3): fit parametric intensity model
fit <- ppm(lansing, ~marks * polynom(x,y,2))
# evaluate fitted intensities at data points
# (these are the intensities of the sub-processes of each type)
inten <- fitted(fit, dataonly=TRUE)
# split according to types of points
lambda <- split(inten, lansing$marks)
K <- Kcross.inhom(lansing, "whiteoak", "maple",
lambda$whiteoak, lambda$maple)
# synthetic example: type A points have intensity 50,
# type B points have intensity 100 * x
lamB <- as.im(function(x,y){50 + 100 * x}, owin())
X <- superimpose(A=runifpoispp(50), B=rpoispp(lamB))
K <- Kcross.inhom(X, "A", "B",
lambdaI=as.im(50, X$window), lambdaJ=lamB)
[object Object],[object Object],[object Object]