I would like some help with programming moving window comparison of spatial
point data vs raster data. To account for georeferencing errors in the
remote sensing data r I'd like to calculate error statistics such as MAE in
250 m increments given a 500m product. So in the example below, a 1km x 1km
grid, I would like to the calculate MAE for the 9 different possible pixel
locations given a 250m shift (4 corners + the 5 locations corresponding to
the 'center plus sign')

require(raster)require(sp)
x=runif(100,0,1000)
y=runif(100,0,1000)
z=runif(100)
df=data.frame(x,y,z)
coordinates(df)<-~x+y
projection(df)<-'+proj=utm +zone=13 +datum=WGS84'

r=raster(matrix(runif(4),nrow=2))
extent(r)=c(0,1000,0,1000)
projection(r)<-'+proj=utm +zone=13 +datum=WGS84'

I was looking at focal in the raster package but that is for a window on
raster data. Googling also brought up caTools and runmean in particular but
I wasn't sure how to make that work since it works on vectors and isn't
inherently spatial. Thanks in advance


P.S. This is cross posted at
http://stackoverflow.com/questions/18424103/calculate-moving-window-mae-for-point-and-raster-databut
haven't gotten any responses there.

	[[alternative HTML version deleted]]

