How many points does this variogram cloud show?
library(sp)
library(gstat)
data(meuse)
coordinates(meuse) = ~x + y
plot(variogram(log(lead) ~ 1, meuse, cloud = TRUE))
points = (variogram(log(lead) ~ 1, meuse, cloud = TRUE))
dim(points)
## [1] 6883 6
The cloud contains 6883 points.
How many could it show maximally?
For a single point shown in the variogram cloud, how are the x and y coordinates in the plot computed?
http://www.youtube.com/watch?v=SJLDlasDLEU
How is a sample variogram computed from the variogram cloud? Carry this out for the log(lead) variable in meuse.
plot(variogram(log(lead) ~ 1, meuse))
Fit a variogram model to the log(lead) sample variogram, and carry out an ordinary kriging for this variable, on the grid cells of meuse.grid.
data(meuse.grid)
gridded(meuse.grid) = ~x + y
lead.variogram = variogram(log(lead) ~ 1, meuse)
lead.model = fit.variogram(lead.variogram, vgm(0.6, "Sph", 1000, 0.05))
ok <- krige(log(lead) ~ 1, meuse, meuse.grid, model = lead.model)
## [using ordinary kriging]
spplot(ok["var1.pred"], main = "Ordinary Kriging Predictions")
spplot(ok["var1.var"], main = "Ordinary Kriging Variance")
Explain how the variogram informs about the strength of autocorrelation.
The slope of the model indicates the strength of autocorrelation.
Explain how the variogram informs about the distance up to which autocorrelation is present.
When you look at the model of a semivariogram, you'll notice that at a certain distance, the model levels out. The distance where the model first flattens out is known as the range. Sample locations separated by distances closer than the range are spatially autocorrelated, whereas locations farther apart than the range are not.