Description Usage Arguments Value References Examples
The studentised envelope test, which takes into account the unequal variances of the test function T(r) for different distances r.
1 | st_envelope(curve_set, alpha = 0.05, savedevs = FALSE, ...)
|
curve_set |
A curve_set (see |
alpha |
The significance level. The 100(1-alpha)% global envelope will be calculated. |
savedevs |
Logical. Should the deviation values u_i, i=1,...,nsim+1 be returned? Default: FALSE. |
... |
Additional parameters passed to |
An "envelope_test" object containing the following fields:
r = Distances for which the test was made.
method = The name of the envelope test.
p = A point estimate for the p-value (default is the mid-rank p-value).
u_alpha = The value of u corresponding to the 100(1-alpha)% global envelope.
u = Deviation values (u[1] is the value for the data pattern). Returned only if savedevs = TRUE.
central_curve = If the curve_set (or envelope object) contains a component 'theo', then this function is used as the central curve and returned in this component. Otherwise, the central_curve is the mean of the test functions T_i(r), i=2, ..., s+1.
data_curve = The test function for the data.
lower = The lower envelope.
upper = The upper envelope.
call = The call of the function.
Myllymäki, M., Grabarnik, P., Seijo, H. and Stoyan. D. (2013). Deviation test construction and power comparison for marked spatial point patterns. arXiv:1306.1028 [stat.ME]
Myllymäki, M., Mrkvička, T., Seijo, H. and Grabarnik, P. (2013). Global envelope tests for spatial point patterns. arXiv:1307.0239 [stat.ME]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Testing complete spatial randomness (CSR)
#-------------------------------------------
require(spatstat)
pp <- spruces
## Test for complete spatial randomness (CSR)
# Generate nsim simulations under CSR, calculate L-function for the data and simulations
env <- envelope(pp, fun="Lest", nsim=999, savefuns=TRUE, correction="translate")
# The studentised envelope test
res <- st_envelope(env)
plot(res)
# or (requires R library ggplot2)
plot(res, use_ggplot2=TRUE)
## Advanced use:
# Create a curve set, choosing the interval of distances [r_min, r_max]
curve_set <- crop_curves(env, r_min = 1, r_max = 8)
# For better visualisation, take the L(r)-r function
curve_set <- residual(curve_set, use_theo = TRUE)
# The studentised envelope test
res <- st_envelope(curve_set); plot(res, use_ggplot2=TRUE)
## Random labeling test
#----------------------
# requires library 'marksummary'
mpp <- spruces
# Use the test function T(r) = \hat{L}_m(r), an estimator of the L_m(r) function
curve_set <- random_labelling(mpp, mtf_name = 'm', nsim=2499, r_min=1.5, r_max=9.5)
res <- st_envelope(curve_set)
plot(res, use_ggplot2=TRUE, ylab=expression(italic(L[m](r)-L(r))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.