| Kdot.inhom {spatstat} | R Documentation | 
For a multitype point pattern, estimate the inhomogeneous version of the dot K function, which counts the expected number of points of any type within a given distance of a point of type i, adjusted for spatially varying intensity.
Kdot.inhom(X, i=1, lambdaI, lambdadot, ..., r=NULL, breaks=NULL,
         correction = c("border", "isotropic", "Ripley", "translate") ,
         lambdaIdot=NULL)
X | 
The observed point pattern, from which an estimate of the inhomogeneous cross type K function Ki.(r) will be computed. It must be a multitype point pattern (a marked point pattern whose marks are a factor). See under Details. | 
i | 
Number or character string identifying the type (mark value)
of the points in X from which distances are measured.
 | 
lambdaI | 
Values of the the estimated intensity of the sub-process of
points of type i.
Either a pixel image (object of class "im"),
or a numeric vector containing the type i intensity values
at each of the type i points in X. 
 | 
lambdadot | 
Values of the the estimated intensity of the entire point process,
Either a pixel image (object of class "im"),
or a numeric vector containing the intensity values
at each point in X. 
 | 
... | 
Ignored. | 
r | 
Optional. Numeric vector giving the values of the argument r at which the cross K function Kij(r) should be evaluated. There is a sensible default. First-time users are strongly advised not to specify this argument. See below for important conditions on r. | 
breaks | 
Optional. An alternative to the argument r.
Not normally invoked by the user. See the Details section.
 | 
correction | 
A character vector containing any selection of the
options "border", "bord.modif",
"isotropic", "Ripley" or "translate".
It specifies the edge correction(s) to be applied.
 | 
lambdaIdot | 
Optional. A matrix containing estimates of the
product of the intensities lambdaI and lambdadot
for each pair of points, the first point of type i and
the second of any type.
 | 
This is a generalisation of the function 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(z) at each point z of the process. Then the expected total mass per unit area is 1. The inhomogeneous ``dot-type'' K function K[i.]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.]inhom(r) would equal pi * r^2. Deviations between the empirical Ki. curve and the theoretical curve pi * r^2 suggest dependence between the points of types i and j for j != 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 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 3rd smallest level,
not the number 3). 
The argument lambdaI supplies the values
of the intensity of the sub-process of points of type i.
It may be either
"im") which
gives the values of the type i intensity
at all locations in the window containing X;
i intensity evaluated only
at the data points of type i. The length of this vector
must equal the number of type i points in X.
The argument lambdadot should contain
estimated values of the intensity of the entire point process.
It may be either a pixel image, or a numeric vector of length equal
to the number of points in X.
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 Ki.(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.
An object of class "fv" (see fv.object).
Essentially a data frame containing numeric columns 
r | 
the values of the argument r at which the function Ki.(r) has been estimated | 
theo | 
the theoretical value of Ki.(r) for a marked Poisson process, namely pi * r^2 | 
together 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 Ki.(r)
obtained by the edge corrections named.
The argument i is interpreted as a
level of the factor X$marks. Beware of the usual
trap with factors: numerical values are not
interpreted in the same way as character values.
Adrian Baddeley adrian@maths.uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner rolf@math.unb.ca http://www.math.unb.ca/~rolf
Moller, J. and Waagepetersen, R. Statistical Inference and Simulation for Spatial Point Processes Chapman and Hall/CRC Boca Raton, 2003.
Kdot,
Kinhom,
Kcross.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)
    lambdadot <- density.ppp(lg, sigma=0.15)
    K <- Kdot.inhom(lansing, "maple", lambdaI=lambdaM[ma],
                                      lambdadot=lambdadot[lg])
    K <- Kdot.inhom(lansing, "maple", lambdaI=lambdaM,
                                      lambdadot=lambdadot)
    # 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))
    XB <- split(X)$B
    K <- Kdot.inhom(X, "B",  lambdaI=lamB[XB], lambdadot=lamdot[X])
    K <- Kdot.inhom(X, "B",  lambdaI=lamB,     lambdadot=lamdot)