Description Usage Arguments Value References Examples
This function performs a two-dimensional Kolmogorov-Smirnov goodness-of-fit test of two point patterns.
1 | kstest2d(x1, x2)
|
x1, x2 |
Objects of class |
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 |
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.