Professional Documents
Culture Documents
Contents
1 variograms
1.1 variogram figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 variogram envelopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 directional variogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
2
3
4
2 estimating parameters
2.1 estimating parameters with variofit()
2.2 likfit() . . . . . . . . . . . . . . . . .
2.3 simple kriging . . . . . . . . . . . . .
2.4 comparing to our original figure . . .
5
5
7
8
9
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Created on January 21, 2014, with R version 2.14.1 (2011-12-22) on an x86_64-pc-linux-gnu machine.
1
variograms
1.1
variogram figures
classical estimator
modulus estimator
0.8
0.20
0.0000
0.0005
0.0010
0.4
0.10
0.05
0.00
0.2
0.0
semivariance
0.15
0.6
0.0015 0.0000
0.0005
0.0010
0.0015
distance
0.020
0.020
distance
0.015
0.000
0.005
0.005
0.000
0.0005
0.0010
0.0015 0.0000
10
0.0000
distance
08
06
04
02
00
modu us va og am
04
03
02
01
0.0005
0.0010
distance
00
0.010
semivariance
0.010
0.015
0.0015
1.2
variogram envelopes
demeaned model
0.020
0.010
0.005
0.000
semivariance
0.015
0.0000
0.0005
0.0010
distance
0.0015
1.3
directional variogram
0.025
0.015
0.010
0.005
0.000
semivariance
0.020
0
45
90
135
0.0000
0.0002
0.0004
0.0006
0.0008
distance
0.0010
0.0012
0.0014
estimating parameters
2.1
We see here that for = 1.5, variofit() suggests the Matern correlation function
1
(u) =
2( 32 )
u
9.4 105
32
K
u
9.4 105
with 2 = 0.01512. We can quickly plot that against the empirical variogram:
0.020
0.010
0.000
0.005
semivariance
0.015
0.0000
0.0005
0.0010
distance
0.0015
2.2
likfit()
2.3
>
+
>
>
>
simple kriging
grid
<- expand.grid(seq(min(s1R$x),max(s1R$x),l=100),
seq(min(s1R$y),max(s1R$y),l=100))
kc
<- krige.control(obj.model = mlfit)
set.seed(1)
pred
<- krige.conv(s1R.geo, loc=grid, krige=kc)
0.7180
0.7175
0.7170
Y Coord
0.7185
0.7190
1e03
5e04
0e+00
X Coord
5e04
1e03
2.4
>
>
>
>
+
>
+
+
+
>
require(ggmap)
paste0 <- function(..., collapse = NULL) paste(..., sep = "", collapse = collapse)
cLat=(37.95564 + 38.05752)/2; cLon=(-121.3681 -121.2502)/2
stocktonMap_toner <- qmap(c(cLon,cLat), zoom=12, source = "stamen",
maptype = "toner")
stocktonMap_toner +
geom_point(aes(x=long, y=lat, colour=residual, size=residual), data=s) +
scale_colour_gradient(low = "aquamarine1", high = "navyblue") +
guides(colour = guide_legend())
rm(s)
residual
0.25
0.00
0.25
0.50
3
3.1
radians), and
0.020
0.025
0.030
0
45
90
135
0.000
0.000
0.005
0.005
0.010
0.010
semivariance
0.015
0.020
0
45
90
135
0.015
0.025
0.035
coords.aniso() takes two arguments: anisotropy angle psiA (which here is 135 degrees =
anisotropy ratio psiR which Ive varied in the below: 1 (no change), 1.5, 2, 5:
0.0012
0.0000
0.025
0.030
distance
0.0004
0
45
90
135
0.00
0.000
0.005
0.01
0.010
0.02
semivariance
0.03
0.04
0
45
90
135
0.0008
0.020
0.0004
0.015
0.0000
3.2
10
0.0008
distance
0.0012
+
+
+
cov.pars=c(7.277033e-03, 9.361362e-05),
kap=1.5, nug=1.512544e-02,
psiA=(3*pi)/4, psiR=1.5)
[1] 766.9429
> # log likelihood for model, psiA=(3*pi)/4, psiR=2
> loglik.GRF(s1R.geo, cov.model='mat',
+
cov.pars=c(7.277033e-03, 9.361362e-05),
+
kap=1.5, nug=1.512544e-02,
+
psiA=(3*pi)/4, psiR=2)
[1] 758.4905
> # log likelihood for model, psiA=(3*pi)/4, psiR=5
> loglik.GRF(s1R.geo, cov.model='mat',
+
cov.pars=c(7.277033e-03, 9.361362e-05),
+
kap=1.5, nug=1.512544e-02,
+
psiA=(3*pi)/4, psiR=5)
[1] 724.8255
All these numbers seem very similar.
Given the similarity, I wanted to check with you both before chopping the points up into quadrants and rerunning. (I also ran out of time.) :)
11