unscaled_envelope: Unscaled envelope test

Description Usage Arguments Details Value References Examples

Description

The unscaled envelope test, which leads to envelopes with constant width over the distances r. It corresponds to the classical maximum deviation test without scaling.

Usage

1
unscaled_envelope(curve_set, alpha = 0.05, savedevs = FALSE, ...)

Arguments

curve_set

A curve_set (see create_curve_set) or an envelope object. If an envelope object is given, it must contain the summary functions from the simulated patterns which can be achieved by setting savefuns = TRUE when calling envelope().

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 estimate_p_value to obtain a point estimate for the p-value. The default point estimate is the mid-rank p-value. The choice should not affect the result, since no ties are expected to occur.

Details

This test suffers from unequal variance of T(r) over the distances r and from the asymmetry of distribution of T(r). We recommend to use the rank_envelope (if number of simulations close to 5000 can be afforded) or st_envelope/qdir_envelope (if large number of simulations cannot be afforded) instead.

Value

An "envelope_test" object containing the following fields:

References

Ripley, B.D. (1981). Spatial statistics. Wiley, New Jersey.

Examples

 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 <- unscaled_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 <- unscaled_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 <- unscaled_envelope(curve_set)
plot(res, use_ggplot2=TRUE, ylab=expression(italic(L[m](r)-L(r))))

myllym/spptest documentation built on May 23, 2019, noon