Description Usage Arguments Author(s) See Also Examples
This function performs a two-dimensional Kolmogorov-Smirnov goodness-of-fit test for a point pattern against a given intensity surface.
For examples see
http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#kstest2dsurf
1 | kstest2dsurf(pp, intsurf, truncate = FALSE, iters = 500)
|
pp |
Object of class |
intsurf |
Object of class |
truncate |
Requests to truncate the generated point patterns to be within the window of the intensity object intsurf. Default is FALSE. |
iters |
Number of point patterns to generate and
compare against |
Sakis Micheas
rmixsurf
,
kstest2d
,
rsppmix
,
plotmix_2d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # generate two intensity surfaces; assume the same window [-3,3]x[-3,3]
mixsurf1 <- rmixsurf(m = 3, lambda=100,xlim=c(-3,3),ylim=c(-3,3))
plot(mixsurf1)
mixsurf2 <- rmixsurf(m = 5, lambda=200,xlim=c(-3,3),ylim=c(-3,3))
plot(mixsurf2)
#generate point patterns from the two different models
pp1 <- rsppmix(mixsurf1, truncate=FALSE)
plotmix_2d(mixsurf1,pp1,colors=TRUE)
pp2 <- rsppmix(mixsurf2, truncate=FALSE)
plotmix_2d(mixsurf2,pp2,colors=TRUE)
# Test for goodness of fit, p-value should be small
kstest2d(pp1, pp2)
# Test each pattern for gof against both Poisson models
kstest2dsurf(pp1, mixsurf1)#correct model for pp1
kstest2dsurf(pp1, mixsurf2)#wrong model for pp1
kstest2dsurf(pp2, mixsurf2)#correct model for pp2
kstest2dsurf(pp2, mixsurf1)#wrong model for pp2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.