Arc features the TREND function with linear interpolation up to 12th order. Is there an equivalent approach in R (preferably) or python?
I'm trying to de-trend a raster surface using polynomial regression. Unfortunately, spatialEco::raster.deviation()
is limited to 2nd order, and I'd ideally like to use 12th, so it isn't feasible here.
Edit: I've found a method that begins to approach my goal: the surf.ls
function in R's spatial
library. raster::rasterToPoints()
gets you to the class you need for surf.ls
. However, this method is still limited to 6th-order polynomials so I'm going to leave the question unresolved in the event that a more complete TREND equivalent exists.