kstest2d: Nonparametric Goodness-of-fit test for two-dimesional point...

Description Usage Arguments Value References Examples

Description

This function performs a two-dimensional Kolmogorov-Smirnov goodness-of-fit test of two point patterns.

Usage

1
kstest2d(x1, x2)

Arguments

x1, x2

Objects of class ppp.

Value

A list with class "htest" containing the following components:

statistic

Value of the KS statistic

p.value

The p-value of the test

alternative

A character string describing the alternative hypothesis

References

J. A. Peacock, "Two-dimensional goodness-of-fit testing in astronomy", Monthly Notices Royal Astronomy Society 202 (1983)615-627.

Adapted from Matlab code by Dylan Muir.

Examples

1
2
3
4
5
6
7
8
# genrating two point patterns
mix1 <- rnormmix(3, sig0 = .01, df = 5, xlim = c(0, 5), ylim = c(0, 5))
mix2 <- rnormmix(8, sig0 = .01, df = 10, xlim = c(0, 5), ylim = c(0, 5))
pp1 <- rsppmix(mix1, lambda = 20, win = square(5))
pp2 <- rsppmix(mix2, lambda = 20, win = square(5))

# Test for goodness of fit
kstest2d(pp1, pp2)

wangyuchen/sppmix documentation built on May 4, 2019, 12:58 a.m.