saplings: Saplings data set

Description Usage Format Details References Examples

Description

Saplings data set

Usage

1

Format

An object of class ppp.object representing the point pattern of tree locations.

Details

A pattern of small trees (height <= 15 m) originating from an uneven aged multi-species broadleaf nonmanaged forest in Kaluzhskie Zaseki, Russia.

The pattern is a sample part of data collected over 10 ha plot as a part of a research program headed by project leader Prof. O.V. Smirnova.

References

Grabarnik, P. and Chiu, S. N. (2002) Goodness-of-fit test for complete spatial randomness against mixtures of regular and clustered spatial point processes. Biometrika, 89, 411–421.

van Lieshout, M.-C. (2010) Spatial point process theory. In Handbook of Spatial Statistics (eds. A. E. Gelfand, P. J. Diggle, M. Fuentes and P. Guttorp), Handbooks of Modern Statistical Methods. Boca Raton: CRC Press.

Myllymäki, M., Mrkvička, T., Grabarnik, P., Seijo, H. and Hahn, U. (2017). Global envelope tests for spatial point patterns. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79: 381-404. doi: 10.1111/rssb.12172

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This is an example analysis of the saplings data set in Myllymäki et al. (2017).
require(spatstat)
data(saplings)

# First choose the r-distances for L (r) and J (rJ) functions, respectively.
nr <- 500
rmin <- 0.3; rminJ <- 0.3
rmax <- 10; rmaxJ <- 6;
rstep <- (rmax-rmin)/nr; rstepJ <- (rmaxJ-rminJ)/nr;
r <- seq(0, rmax, by=rstep)
rJ <- seq(0, rmaxJ, by=rstepJ)

#-- CSR test --# (a simple hypothesis)
#--------------#
# First, a CSR test using the L(r)-r function:
# Note: CSR is simulated by fixing the number of points and generating nsim simulations
# from the binomial process, i.e. we deal with a simple hypothesis.
env <- envelope(saplings, nsim=2499,
 simulate=expression(runifpoint(saplings$n, win=saplings$window)), # Simulate CSR
 fun="Lest", correction="translate", # T(r) = estimator of L with translational edge correction
 transform = expression(.-r),        # Take the L(r)-r function instead of L(r)
 r=r,                                # Specify the distance vector
 savefuns=TRUE)                      # Save the estimated functions
# Crop the curves to the interval of distances [rmin, rmax]
# (at the same time create a curve_set from 'env')
curve_set <- crop_curves(env, r_min = rmin, r_max = rmax)
# Perform the rank envelope test
res <- rank_envelope(curve_set)
# Plot the result.
plot(res, plot_style="ggplot2", ylab=expression(italic(hat(L)(r)-r)))

# -> The CSR hypothesis is clearly rejected and the rank envelope indicates clear
# clustering of saplings. Next we explore the Matern cluster process as a null model.


#-- Testing the Matern cluster process --# (a composite hypothesis)
#----------------------------------------#
# Fit the Matern cluster process to the pattern (using minimum contrast estimation with the pair
# correction function)
fitted_model <- kppm(saplings~1, clusters = "MatClust", statistic="pcf")
summary(fitted_model)

nsim <- 19 # 19 just for experimenting with the code!!
#nsim <- 499 # 499 is ok for type = 'qdir' (takes about 1,6 h)

# Make the adjusted directional quantile global envelope test using the L(r)-r function
# (For the rank envelope test, choose type = "rank" instead and increase nsim.)
system.time( # timing; takes a lot of time,
             # if nsim is reasonably large (for 'qdir' & nsim=499, about 1,6 h)
  adjenvL <- dg.global_envelope(X = fitted_model,
                               fun="Lest", correction="translate",
                               transform = expression(.-r), r=r,
                               type = "qdir", nsim = nsim, nsimsub = nsim,
                               r_min=rmin, r_max=rmax,
                               save.cons.envelope=TRUE)
)
# Plot the test result
# As save.cons.envelope was set above to TRUE, the unadjusted global envelope can be plotted
# together with the adjusted envelope.
plot(adjenvL, plot_style="ggplot2", ylab=expression(italic(L(r)-r)), plot_unadjusted=TRUE)
# Setting plot_unadjusted=FALSE only the adjusted envelope is plotted.

# From the test with the L(r)-r function, it appears that the Matern cluster model would be
# a reasonable model for the saplings pattern.
# To further explore the goodness-of-fit of the Matern cluster process, test the
# model with the J function:
system.time( # timing; takes a lot of time if nsim is reasonably large
  adjenvJ <- dg.global_envelope(X = fitted_model,
                                fun="Jest", correction="none", r=rJ,
                                type = "qdir", nsim = nsim, nsimsub = nsim,
                                r_min=rminJ, r_max=rmaxJ,
                                save.cons.envelope=TRUE)
)
# Plot the test result
plot(adjenvJ, ylab=expression(italic(J(r))), plot_unadjusted=FALSE)
# -> the Matern cluster process not adequate for the saplings data

myllym/GET documentation built on Sept. 30, 2018, 5:49 a.m.