Lcross.inhom(X, i, j, ...)
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)
.Kcross.inhom
."fv"
(see fv.object
).Essentially a data frame containing numeric columns
r
"border"
, "bord.modif"
,
"iso"
and/or "trans"
,
according to the selected edge corrections. These columns contain
estimates of the function $L_{ij}(r)$
obtained by the edge corrections named.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.Lcross
to include an adjustment for spatially inhomogeneous intensity,
in a manner similar to the function Linhom
. All the arguments are passed to Kcross.inhom
, which
estimates the inhomogeneous multitype K function
$K_{ij}(r)$ for the point pattern.
The resulting values are then
transformed by taking $L(r) = \sqrt{K(r)/\pi}$.
Lcross
,
Linhom
,
Kcross.inhom
# Lansing Woods data
data(lansing)
lansing <- lansing[seq(1,lansing$n, by=10)]
ma <- split(lansing)$maple
wh <- split(lansing)$whiteoak
# 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")
L <- Lcross.inhom(lansing, "whiteoak", "maple", lambdaW, lambdaM)
# method (2): 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)
L <- Lcross.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))
L <- Lcross.inhom(X, "A", "B",
lambdaI=as.im(50, X$window), lambdaJ=lamB)
Run the code above in your browser using DataLab