ripVar: The Ripley Variance of K-functions.

View source: R/ripVar.R

ripVarR Documentation

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)

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.

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.

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)).

Author(s)

Rolf Turner rolfturner@posteo.net

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

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)
    }
}

kanova documentation built on Aug. 8, 2025, 7:50 p.m.

Related to ripVar in kanova...