About

This is an assignment for Applied Time-Series and Spatial Analysis for Environmental Data. This course is a graduate level, R-based statistics course offered by the Huxley College of the Environment, within Western Washington University.

rm(list=ls())
setwd('C:/Users/bruenij/Dropbox (Personal)/School work/2015 Spring/spacetime/Week7')
library(sp)
## Warning: package 'sp' was built under R version 3.1.3
library(gstat)
## Warning: package 'gstat' was built under R version 3.1.3
data(meuse)
data(meuse.grid)

Inverse Distance: What power to use?

This is the big question is seems with IDW. Depending on how ‘strong’ or ‘steep’ you want to go, your interpolation will follow. Below, see that as the powers get larger, the influence of far-away points drops to 0 very quickly.

While this doesn’t answer the question of what power to use, it can help in the decision making process. Knowing something about the processes behind the values we’re trying to interpolate will help decide on what power to use. If you want points beyond a certain distance to have little-no influence on the interpolation, use a higher power. The lower the power (approaching 0), will just be an average of all the values, as each other point will ahve equal influence.

This is a sort of spatial moving average, with the power deptermining the shape of the influence curve at varying distances.

d <- 1:100

p <- 0
w <- d^-p
plot(d,w,type="l",xlab="Distance (d)", ylab="Weight (w)", ylim = c(0,.5),
     col="black", lwd=2,las=1, tcl=.3)
p <- 0.25
w <- d^-p
lines(d,w,col="pink", lwd=2)
p <- 0.33
w <- d^-p
lines(d,w,col="firebrick", lwd=2)
p <- 0.5
w <- d^-p
lines(d,w,col="darkorange", lwd=2)
p <- 0.75
w <- d^-p
lines(d,w,col="gold", lwd=2)
p <- 1.5
w <- d^-p
lines(d,w,col="forestgreen", lwd=2)
p <- 2.5
w <- d^-p
lines(d,w,col="dodgerblue", lwd=2)
legend("topright",legend=c("p=0.25","p=0.33","p=0.5","p=.75","p=1.5","p=2.5"),
       col=c("pink","firebrick","darkorange","gold","forestgreen","dodgerblue"),
       lwd=2,cex=.78)
abline(h=0, lwd=2)
box(lwd=2)

IDW on Zinc

Lets look at several different powers’ effects on IDW interpolation on the Meuse zinc values.

zcIDW1 <- idw(formula=zinc~1,locations=meuse,newdata=meuse.grid,idp=.25)
## [inverse distance weighted interpolation]
spplot(zcIDW1,"var1.pred")

zcIDW2 <- idw(formula=zinc~1,locations=meuse,newdata=meuse.grid,idp=.5)
## [inverse distance weighted interpolation]
spplot(zcIDW2,"var1.pred")

zcIDW3 <- idw(formula=zinc~1,locations=meuse,newdata=meuse.grid,idp=1.5)
## [inverse distance weighted interpolation]
spplot(zcIDW3,"var1.pred")

zcIDW4 <- idw(formula=zinc~1,locations=meuse,newdata=meuse.grid,idp=2.5)
## [inverse distance weighted interpolation]
spplot(zcIDW4,"var1.pred")

While at first the surfaces may be misleading, but pay close attention to the scales on the right. The range is remarkable.

With a power of .25, the range of values is lass than 100, from about 450 - 510. Jump up to a power of 2.5 and the range is now 0 - 1800.

I think this shows that the as the power increases, we approach a scenario where no points have any infulence, and only the value at that specific location matters.

Do you agree?

It’s really interesting how drastic an effect the power has. Also- that someone may run an interpolation in R or ArcGIS, etc and have little idea about what power to chose, and thus accept the default is scary. I know I did it when first learning GIS.

Kriging

More to come…