Page 1 of 1

RGeostat function for moving window statistics?

PostPosted: Fri Sep 06, 2019 12:04 am
by markm0705
Is there an RGeostat function for moving-window statistics that can be applied to a 2D or 3D grid or irregualry spaced data?

Re: RGeostat function for moving window statistics?

PostPosted: Fri Sep 06, 2019 11:24 am
by Didier Renard
I have a 2-fold answer depending on what is YOUR definition of a moving window

1) If the moving window has a fixed extension, you can try db.stat.grid() which calculates any statistical feature (mean, variance, ...) from your input Db into a grid resulting Db (that I call dbgrid for clarity).
This means that you can calculate the mean (for example) of your target variable for all samples contained in a grid cell.
But you may argue that this is not exactly a MOVING neighborhood.

2) The second possibility is to use the definition of the Moving Neighborhood object of RGeostats instead. But there is no tool for answering exactly your problem for ANY statistical feature. If you are only interested by the mean of the variable (of this moving neighborhood), you can run a (Simple) Kriging by choosing a specific Model (e.g. a pure nugget effect). A s matter of fact, you remember that the result of Kriging with pure nugget effect is exactly the same operator as moving (unweighted) average.

I keep your mail as we can imagine to create a new function with arguments similar to db.stat.grid() which would use a Neighborhood object as argument. It would then offer the possibility of calculating all the statistical features as in db.stat.grid()