Sunteți pe pagina 1din 12

Spatial Analysis Pattern

GIANNI GORGOGLIONE
1

Spatial analysis Point Pattern Processes
Workflow example in R
Part 1 Exploring point data

Q1. install.packages("spatstat")
data(swedishpines)

Q2. Pine1 <- runifpoint(71, swedishpines)
plot(Pine1)

Q3. window: rectangle = [0, 96] x [0, 100]

Average intensity 0.0074 points per square unit (one unit = 0.1 metres)
Q4. plot(swedishpines)
swedishpines->sp
density.ppp(sp)
plot(density.ppp(sp))
plot(density.ppp(sp),add=T)
Q5. quadratcount(sp)
quadratcount(sp, 10,10)
Yes, it looks that data are evenly distributed
Q6. Pine2 <- runifpoint(71, swedishpines)
quadratcount(Pine2)
plot(swedishpines,pch=1)
Spatial Analysis Pattern
GIANNI GORGOGLIONE
2

plot(Pine2,pch=2,add=TRUE)
plot(Pine3,pch=3,add=TRUE)

Q7. ##it Is a simple random point pattern where the intensity of the events does not vary across
a region. Besides the location of the event is independent by the location of
any event.

Q8. plot(density.ppp(sp),"left",par(mfrow=c(2,2)))
plot(density.ppp(Pine2))
plot(density.ppp(Pine3))










Q9. A) When a z is below -1.96 the expeted outcome is a clastered point distribution
With z above 1.96 the pattern has a significant uniformity.
A z value close to zero implies a random pattern.
B) X<-rStrauss(0.05,gamma=0,R=2,W=swedishpines$window)
Y<-rThomas(0.05,1.5,3,win=swedishpines$window)
Spatial Analysis Pattern
GIANNI GORGOGLIONE
3

Z<-rpoispp(0.05,win=swedishpines$window)
plot(envelope(Z,Gest,nsim=200))
c) plot(envelope(X,Gest,nsim=200))
plot(envelope(Z,Gest,nsim=200))
plot(envelope(Y,Gest,nsim=200))






















Figure 3 G-function For X pattern
The Gobs is below the envelopes and
it means that there is uniform.

Figure 1G-function for Z pattern
In this case, the Gfunction is between
the envelopes so we are in the case
of CSR.
Figure 2 G-function for Y pattern
Gobs is above the envelopes
and that means there is clustering
Spatial Analysis Pattern
GIANNI GORGOGLIONE
4


E) The envelope generates simulations and calculates envelopes of a summary statistic. When you plot
the envelopes it is possible to see and evaluate the goodness of fit of simulated models for points
pattern.


Part 2 Marked point patterns

1) Summary(lansing)
2) lan.plot<-plot(lansing); legend(-0.25,0.5, names(lan.plot),pch = lan.plot)
plot(split(lansing))


Spatial Analysis Pattern
GIANNI GORGOGLIONE
5


3) plot( relrisk(lansing ) , zlim = c(0,1))

Yes, it looks that there is segregation between hickory and maple mark in the area upper left.


4) pairs(density(split(lansing)[c(2,3,5)]))
pairs(density(split(lansing)[c(1,2,3,4,5,6)]))


Spatial Analysis Pattern
GIANNI GORGOGLIONE
6




Here, again we see differences between maples and hickory trees as the preview graphs showing a
segregation. Instead, it looks that Redoak dont have any segregation against the other two species.
5) plot(alltypes(lansing,"G", correction = c("none"),envelope = TRUE))
Spatial Analysis Pattern
GIANNI GORGOGLIONE
7

In presence of a segregation between the marks we should expect that G-function will have the
G-obs below the Gtheor. The distances are supposed to be larger than those from Random
process. The array plot can support this hypothesis since it shows the segregation occurring
between maples and hickory species.
















plot(envelope(lansing, "Gcross",i="hickory",j="maple"))






Spatial Analysis Pattern
GIANNI GORGOGLIONE
8



Part 3 Covariate effects

1. library(gstat)
library(spatstat)
library(splancs)
library(adehabitat)
library(rgdal)
library(lattice)
library(RSAGA)

?bei
Pattern of 3605 points representing trees in a tropical rain forest
summary(bei)
2. plot(bei)


plot(density.ppp(bei))
bei
Spatial Analysis Pattern
GIANNI GORGOGLIONE
9



plot(bei.extra)


plot(bei.extra$elev)
plot(bei, add=TRUE)
density.ppp(bei)
0
.
0
0
5
0
.
0
1
5
bei.extra
elev
1
2
0
1
4
0
grad
0
.
0
5
0
.
2
0
.
3
Spatial Analysis Pattern
GIANNI GORGOGLIONE
10


plot(bei.extra$elev)



From the images above it is possible to observe that the population of some tree species the
higher the elevation and the slope are the more they grow.




bei.extra$elev
1
2
0
1
3
0
1
4
0
1
5
0
Spatial Analysis Pattern
GIANNI GORGOGLIONE
11

0.00 0.05 0.10 0.15 0.20 0.25 0.30
0
.
0
0
5
0
.
0
1
0
0
.
0
1
5
rhohat(bei, bei.extra$grad)
X
X
^
X
hi
X
lo
X
3.











By using the Smoothing Estimate of Covariate Transformation is possible to notice that in both graphs
there is a tendency for the intensity to grow higher when the elevation increases.
4.
str(lansing)
split(lansing)
S1<-split(lansing)
str(S1)
plot(density(S1$hickory))
120 130 140 150 160
0
.
0
0
0
0
.
0
0
2
0
.
0
0
4
0
.
0
0
6
0
.
0
0
8
0
.
0
1
0
0
.
0
1
2
rhohat(bei, bei.extra$elev)
X
X
^
X
hi
X
lo
X
Spatial Analysis Pattern
GIANNI GORGOGLIONE
12


plot(rhohat(S1$maple,density(S1$hickory)))



density(S1$hickory)
4
0
0
6
0
0
8
0
0
1
0
0
0
1
2
0
0
1
4
0
0
1
6
0
0
400 600 800 1000 1200 1400
0
2
0
0
4
0
0
6
0
0
8
0
0
1
0
0
0
rhohat(S1$maple, density(S1$hickory))
X
X
^
X
hi
X
lo
X
These last two graphs show again the
there is a segregation between the
species of maples and hickory. The
intensity of the two species are
different related to their own spatial
location.

S-ar putea să vă placă și