R501Final Project

advertisement
Final Project
1. Point pattern: Analyze spatial distribution of the three tree species in Vancouver Island.
Data: “victoria.dat” in your R workspace.
(1) Detect spatial distributions of Douglas-fir and Hemlock using a quadrat-based index of
your choice. Vary quadrat size from 22, 55, 1010, 1515 to 2020 m and then
examine the change of the index with the quadrat size (test whether Douglas-fir and
Hemlock are at csr).
Answer:
Quadrat based index: Standardized Morisita index of dispersion (Id)
Null hypothesis is that distributions of tress are random.
I use two different strategies to test csr: 1) randomly toss quadrats on the research
area (Figure 1, left); 2) seamlessly pave quadrats over the area (Figure 2, right).
The number of quadrat for all tests with randomly tossing is 2244, which is the
number of 22 quadrat can seamlessly cover this area.
Indexes are calculated by R function dispindmorisita() from package vegan.
Quadrats are generated by quadrat.count.main and quadratcount from package
spatstat.
tree.ppp
13
12
1
3
36
29
27
24
0
10
11
5
1
12
7
17
23
22
1
4
5
3
6
3
0
0
20
12
15
0
2
17
21
14
10
4
6
9
47
1
7
16
4
9
7
0
0
1
10
3
5
9
5
11
16
7
5
0
4
0
1
3
8
25
22
9
25
4
5
0
1
6
15
38
19
39
30
5
9
0
4
9
11
47
27
18
5
1
2
0
20
40
y
60
80
22
0
20
40
60
80
100
x
Figure 1. distribution of Douglas-fir(left) and hemlock(right)
Standardized index ranges from -1 to 1, with 95% confidence limited at (-0.5,
0.5). Negative values indicate regularity, positive indicate aggregation, while
around 0 is for randomness.
Tab. 1 Standardized Morisita index of dispersion for Douglas-fir and Hemlock
Quadrat
Radom
(size)
22
55
1010
1515
2020
Regular
(number)
5144
2118
109
76
54
Random selection
Douglas-fir
Hemlock
-0.40726
-0.52998
0.45016
0.50000
0.50000
0.50043
0.50026
0.50018
0.50013
0.50009
Regular selection
Douglas-fir
Hemlock
-0.57113
-0.50163
0.07365
0.34249
0.50063
0.50039
0.50186
0.50495
0.50837
0.51310
The results show that distribution of hemlock is aggregation under all
conditions. Distribution of douglas-fir varies according to quadrat sizes. Types of
distribution change at size 1010 (Tab. 1). Quadrat number affect results. Small
number of quadrat sometime shows a ‘correct’ answer for spatial distribution, for
example 4 for 2020 quadrat and 8 for 15 quadrat. However, conclusions
randomly change according to where quadrats tossed.
(2) Detect spatial distribution of Douglas-fir and Hemlock using a distance-based index of
your choice. Calculate the index up to the 100th nearest neighbor distance and test
whether Douglas-fir and Hemlock are at csr.
Answer:
In this case, I choose Pielou’s index of non-randomness (α) to test if these trees
distribute randomly or not. The index is defined as:
𝛼 = 𝜋𝜆𝜔
̅
,where λ is density, 𝜔
̅ is expect distance.
Tab. 2 show the parameters calculated by Pielou’s index with 200 points. ω is
observed distances between points to trees. Tab. 3 show the results tested with
different number of points.
Results are calculated by R function distance.main from package spatstat.
There are 652 douglas-fir and 982 hemlock in the 10383m area. The critical
region for both trees is (0.866204, 1.143264). If index value outsides the interval,
CSR will be rejected.
Tab. 2 results of Pielou’s index test (200 points to trees)
λ
0.07357
0.11244
Douglas-fir
Hemlock
ω
4.08036
10.2604
̅
𝝎
0.02342
0.03579
α
CSR
0.94314 Yes
3.62434 No
Tab. 3 Pielou’s index for different number of points to trees
Douglas-fir
Hemlock
50
0.84525
3.08498
100
0.96797
4.05171
150
0.93867
3.01503
200
1.00532
3.44778
300
0.98935
3.70481
600
800
0.94097 Null
3.55299 3.88273
The value of Pielou’s index varies when number of points changed. However,
different tests have similar results for distribution. When set a small number of
points for test, the index can be randomly inside or outside of the critical interval,
for example, Douglas-fir in the test with 50 points.
R function nndist is chosen to calculate the n-th nearest neighbor distance.
Meanwhile, a curve for expect distances is drawn for comparing if the distribution
is aggregation or random.
30
Observed distances of Douglas-fir are closed to CSR in 20. It is bigger than CSR
in the rest distance. Hemlock aggregates under the 100th neighbor.
DF
CSR
2
3
log of Distance, E(m)
15
10
1
5
0
Distance, E(m)
20
25
4
DF
CSR
0
50
100
n-th nearest neighbor
150
0
1
2
3
4
5
6
log of n-th nearest neighbor
7
30
HL
CSR
3
0
0
5
1
2
log of Distance, E(m)
15
10
Distance, E(m)
20
25
4
HL
CSR
0
50
100
150
n-th nearest neighbor
0
1
2
3
4
5
6
7
log of n-th nearest neighbor
Figure 2. n-th nearest neighbor distance and logarithmic distance for Douglas-fir
and Hemlock
(3) Compute Ripley’s L function for Douglas-fir and Hemlock. Compare and analyze L
functions with the quadrat-based and distance-based results.
Answer:
Distribution is aggregated distribution if index of Ripley’s L-function is bigger
than 0, random when it is 0, and regular when less than 0.
The results show (Figure 3) that Douglas-fir distribution is regular at low
numbers, and then it becomes random and as numbers increased. The distribution
becomes aggregated when h>5. Hemlock’ distribution is constantly in all the h
value, which is aggregation.
These three methods performance similarly.
L(h)
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
DF
0
5
10
15
20
15
20
h
L(h)
0.0
0.5
1.0
1.5
2.0
2.5
3.0
HL
0
5
10
h
Figure 3 Ripley’s L function and simulation envelopes of Douglas-fir and hemlock
(4) Compute bivariate L functions between Douglas-fir-Hemlock, Douglas-fir-Cedar, and
Hemlock-Cedar. Interpret the results.
Figure douglas-fir (live-death)
1.0
0.6
L function
-0.2
0.2
1.0
0.6
L function
0.2
-0.2
0
5
10
15
20
0
5
15
20
h
DF CD
0.6
0.2
-0.2
L function
1.0
h
DF HL
10
0
5
10
15
20
h
HL CD
Figure 4
2. Geostatistic: Kriging surface PO4 for Gigante plot (PO4srf in “soil.dat”) and
produce the maps of the kriged PO4 and its variance. Evaluate the kriging prediction
use cross-validation.
Answer:

Step 1: EDA exploration, removing trend, checking for stationarity and
isotropy
PO4 (ppm) is sampled from 349 points, which scattered in 400*800 meters
area. The proportion of PO4 ranges from 0.011 to 12.112 ppm (Tab 4). The
sampling intervals are from 2 to 20 m (Figure 5).
Tab 4. Statistics of PO4
Min.
0.011
1st Qu.
1.058
Median
1.826
Mean
2.178
3rd Qu.
2.66
Max.
12.11
Histogram of PO4
0
0
20
200
40
60
Frequency
400
Y (metre)
80
600
100
800
PO4 surface
0
100
200
300
400
0
X (metre)
2
4
6
8
10
12
PO4 (ppm)
Figure 5. Distribution of phosphate (left) and histogram of phosphate (right)
Second order
2.0
1.0
1.5
semivariance
2
0.0
0.5
1
0
semivariance
2.5
3
3.0
3.5
4
First order
0
100 200 300 400 500
distance
0
100 200 300 400 500
distance
Figure 6. First and second order of empirical variogram

Step 2: Computing the empirical variogram
Empirical variogram is computed by directly considering trend (Figure 6.)

Step 3: Fitting and selecting a theoretical variogram model to the empirical
variogram.
Logistic model has shorter range (100) than spheric model does (128). In this
studying, I choose logistic model as the theoretical varigoram model.
Spheric model:
parameter estimates:
tausq sigmasq
phi
1.439
1.226 127.762
Practical Range with cor=0.05 for asymptotic range: 127.7620
variofit: minimised weighted sum of squares = 5932.714
logistic model:
v ~ c0 + a * u^2/(1 + b * u^2)
parent.frame()
a
b
0.0009485 0.0006551
sum-of-squares: 17.27
2.0
1.5
1.0
0.5
Spheric model
Logistic model
0.0
semivariance
2.5
3.0
3.5
model:
data:
c0
1.1967563
residual
0
100
200
300
400
distance
Figure 7. theoretical varigram model
500

Step 4: Computing the weight w using the fitted theoretical variogram, i.e.,
kriging.

Step 5: Predicting the values at the locations of interest
800
R function krige.conv is use to predict the value on my research area (Figure
8).
5.5
5
6
5.5
6
5.5
6.5
5.5
5
6
600
6
5
5
5.5
5.5
5.5
400
5.5
6
5
6
200
5.5
5
5
6
5
6
5.5
5
5
0
Y Coord
6
5.5
6
6
5
6
6
5.5
6
-200
0
200
400
X Coord
Figure 8. kriging surface for PO4
600
800
5.5
5
6
5.5
6
5.5
6.5
5.5
5
6
600
6
5
5
5.5
5.5
5.5
400
5.5
6
5
Y Coord
6
5.5
6
6
5
6
6
5.5
6
6
200
5.5
5
5
6
5
6
5.5
0
5
5
-200
0
200
400
600
X Coord
Figure 9. Standard error surface of prediction

Validation
Cross-validation is chosen to validate the kringing surface. The function is
xvalid in package geoR.
Figure 10. cross-validation
3. Lattice data mapping and modeling: model the distribution of BCI species “ocotwh”. Data
are included in the attached workspace, “ocotwh.RData”. The data “ocotwh.dat” contains
the (x, y) locations of 1118 trees. To convert the point pattern into lattice data, implement:
>occupancy.main(ocotwh.dat,10)
# 10 m is the cell size.
(1) Map the distribution of saplings at 2020 m cell size. Here, “sapling” is defined
by the stems with dbh<2 cm, not include 2 cm. Note the measurement unit of the
dbh in the file is mm not cm.
There are 434 saplings in the data set.
500
400
300
200
100
0
200
400
600
800
1000
0
200
400
600
800
1000
0
100
200
300
400
500
0
(2) Use Poisson model to identify those cells which has the “relative risk” >1 (see
Chapter 15).
Suppose pixels contained saplings have high mortality than pixels have big tree.
Therefore ,
P+=1118
O+=434
r+= O+/ P+= 0.3881932
(3) Use the CAR model to model the relative risk () in terms of the three
topographic covariates (slope, elevation and convexity). The topographic data at
2020 m cell size are in the R workspace used throughout the course. The CAR
model has the form (see the last slide of Chapter 15):
log(  )   0  1 x     ,
Download