50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


spatstat.explore (version 3.0-6)

Kmark: Mark-Weighted K Function

Description

Estimates the mark-weighted K function of a marked point pattern.

Usage

Kmark(X, f = NULL, r = NULL,
        correction = c("isotropic", "Ripley", "translate"), ...,
        f1 = NULL, normalise = TRUE, returnL = FALSE, fargs = NULL)

markcorrint(X, f = NULL, r = NULL, correction = c("isotropic", "Ripley", "translate"), ..., f1 = NULL, normalise = TRUE, returnL = FALSE, fargs = NULL)

Value

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 mark correlation integral Kf(r) has been estimated

theo

the theoretical value of Kf(r) when the marks attached to different points are independent, namely πr2

together with a column or columns named

"iso" and/or "trans", according to the selected edge corrections. These columns contain estimates of the mark-weighted K function Kf(r)

obtained by the edge corrections named (if returnL=FALSE).

Arguments

X

The observed point pattern. An object of class "ppp" or something acceptable to as.ppp.

f

Optional. Test function f used in the definition of the mark correlation function. An R function with at least two arguments. There is a sensible default.

r

Optional. Numeric vector. The values of the argument r at which the mark correlation function kf(r) should be evaluated. There is a sensible default.

correction

A character vector containing any selection of the options "isotropic", "Ripley" or "translate". It specifies the edge correction(s) to be applied. Alternatively correction="all" selects all options.

...

Ignored.

f1

An alternative to f. If this argument is given, then f is assumed to take the form f(u,v)=f1(u)f1(v).

normalise

If normalise=FALSE, compute only the numerator of the expression for the mark correlation.

returnL

Compute the analogue of the K-function if returnL=FALSE or the analogue of the L-function if returnL=TRUE.

fargs

Optional. A list of extra arguments to be passed to the function f or f1.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

and Rolf Turner r.turner@auckland.ac.nz

Details

The functions Kmark and markcorrint are identical. (Eventually markcorrint will be deprecated.)

The mark-weighted K function Kf(r) of a marked point process (Penttinen et al, 1992) is a generalisation of Ripley's K function, in which the contribution from each pair of points is weighted by a function of their marks. If the marks of the two points are m1,m2 then the weight is proportional to f(m1,m2) where f is a specified test function.

The mark-weighted K function is defined so that λKf(r)=Cf(r)E[f(M1,M2)] where Cf(r)=E[xXf(m(u),m(x))10<||ux||r|uX] for any spatial location u taken to be a typical point of the point process X. Here ||ux|| is the euclidean distance between u and x, so that the sum is taken over all random points x that lie within a distance r of the point u. The function Cf(r) is the unnormalised mark-weighted K function. To obtain Kf(r) we standardise Cf(r) by dividing by E[f(M1,M2)], the expected value of f(M1,M2) when M1 and M2 are independent random marks with the same distribution as the marks in the point process.

Under the hypothesis of random labelling, the mark-weighted K function is equal to Ripley's K function, Kf(r)=K(r).

The mark-weighted K function is sometimes called the mark correlation integral because it is related to the mark correlation function kf(r) and the pair correlation function g(r) by Kf(r)=2π0rskf(s)g(s)ds See markcorr for a definition of the mark correlation function.

Given a marked point pattern X, this command computes edge-corrected estimates of the mark-weighted K function. If returnL=FALSE then the estimated function Kf(r) is returned; otherwise the function Lf(r)=Kf(r)/π is returned.

References

Penttinen, A., Stoyan, D. and Henttonen, H. M. (1992) Marked point processes in forest statistics. Forest Science 38 (1992) 806-824.

Illian, J., Penttinen, A., Stoyan, H. and Stoyan, D. (2008) Statistical analysis and modelling of spatial point patterns. Chichester: John Wiley.

See Also

markcorr to estimate the mark correlation function.

Examples

Run this code
    # CONTINUOUS-VALUED MARKS:
    # (1) Spruces
    # marks represent tree diameter
    # mark correlation function
    ms <- Kmark(spruces)
    plot(ms)

    # (2) simulated data with independent marks
    X <- rpoispp(100)
    X <- X %mark% runif(npoints(X))
    Xc <- Kmark(X)
    plot(Xc)
    
    # MULTITYPE DATA:
    # Hughes' amacrine data
    # Cells marked as 'on'/'off'
    M <- Kmark(amacrine, function(m1,m2) {m1==m2},
                         correction="translate")
    plot(M)

Run the code above in your browser using DataLab