[GIS] Raster time series smoothing package using R

rrastersmoothingtime series

Does somebody knows if exist a package in R specifically for raster time series smoothing?

I´m using aproachs like this one (using the equation suggested by Hamunyella et al., 2013)

for (i in 2:(length(stacklist)-1)){
r <-  raster(stacklist[i])
r1 <- raster(stacklist[i-1])
r3 <- raster(stacklist[i+1])
r2<-mean(r1,r3)
r[((r-r1)<(-0.01*r1)) & ((r-r3)<(-0.01*r3))]<-r2[((r-r1)<(-0.01*r1)) & ((r-r3)<(-0.01*r3))]
writeRaster(r,filename=paste(substr(stacklist[i], p1+1, (p1+7)),"_cropmLname.tif",sep=""),format="GTiff",overwrite=TRUE)
}

It is fast, But there is not any easiest way? For example for implement another kind of filter, like Savitzky-Golay, Double-Logistic filtering?

Best Answer

Rather than looking for a specific package for raster time series you could look for functions for smoothing, and then use these with the calc function in the raster package. Here is an example for Savitzky-Golay:

https://stackoverflow.com/questions/37843942/smoothen-rasterstack-using-the-savitzky-golay-sgolayfilt-signal-in-r/37846229#37846229