This function computes the theil-sen estimator and the associated P-value, for each pixel over time in a stack of images. The output consists of two rasters (one for the estimators and one for the P-values). It is recommended to use a "RasterBrick", which is more efficient in memory management.
eco.theilsen(stacked, date, adjust = "none")
stacked | Stacked images ("RasterLayer" or "RasterBrick"). |
---|---|
date | data vector with decimal dates for each image. |
adjust | P-values correction method for multiple tests
passed to |
Sen, P. 1968. Estimates of the regression coefficient based on Kendall's tau. Journal of the American Statistical Association, Taylor and Francis Group, 63: 1379-1389.
Theil H. 1950. A rank-invariant method of linear and polynomial regression analysis, Part 3 Proceedings of Koninalijke Nederlandse Akademie van Weinenschatpen A, 53: 397-1412.
rkt
.
# NOT RUN { require("raster") set.seed(6) temp <- list() for(i in 1:100) { temp[[i]] <- runif(36,-1, 1) temp[[i]] <- matrix(temp[[i]], 6, 6) temp[[i]] <- raster(temp[[i]]) } temp <- brick(temp) writeRaster(temp,"temporal.tif", overwrite=T) rm(temp) ndvisim <- brick("temporal.tif") date <- seq(from = 1990.1, length.out = 100, by = 0.2) eco.theilsen(ndvisim, date) pvalue <- raster("pvalue.tif") slope <- raster("slope.tif") par(mfrow = c(1, 2)) plot(pvalue, main = "p-value") plot(slope, main = "slope") # }