Learn R Programming

kanova (version 0.3-12)

ripVar: The Ripley Variance of K-functions.

Description

Calculates the variance of the K-function of a Poisson point pattern, according to Ripley's formula (as taken from equation (3) in Hahn 2012).

Usage

ripVar(X, r)

Value

A number vector, of length equal to length(r) whose entries are the variances of K(r) where $K(r)$ is equal to

as.function(Kest(X)).

Arguments

X

A point pattern (object of class "ppp"). The variance formula is valid only if X arises from a Poisson process.

r

A numeric vector of non-negative values at which the K-function for X is to be evaluated.

Author

Rolf Turner rolfturner@posteo.net

Details

The vector r would normally have entries in increasing order and would have a first entry equal to 0. It may be wise to construct r as Kest(X)$r, but this is not required.

References

Hahn, Ute (2012) A studentized permutation test for the comparison of spatial point patterns, Journal of the American Statistical Association, 107, pp. 754 -- 764, DOI: 10.1080/01621459.2012.688463.

See Also

Kest()

Examples

Run this code
if(requireNamespace("spatstat.random")) {
    X    <- spatstat.random::rpoispp(100)
    vKX1 <- ripVar(X,r=0.05*(1:5))
    if(requireNamespace("spatstat.explore")) {
        r    <- spatstat.explore::Kest(X)$r
        vKX2 <- ripVar(X,r=r)
        plot(r,vKX2,type="l")
        points(0.05*(1:5),vKX1)
    }
}

Run the code above in your browser using DataLab