View source: R/raster.kendall.R
raster.kendall | R Documentation |
Calculates a nonparametric statistic for a monotonic trend based on the Kendall tau statistic and the Theil-Sen slope modification
raster.kendall(
x,
intercept = TRUE,
p.value = TRUE,
confidence = TRUE,
tau = TRUE,
min.obs = 6,
method = c("zhang", "yuepilon", "none"),
...
)
x |
A multiband terra SpatRaster object with at least 5 layers |
intercept |
(FALSE/TRUE) return a raster with the pixel wise intercept values |
p.value |
(FALSE/TRUE) return a raster with the pixel wise p.values |
confidence |
(FALSE/TRUE) return a raster with the pixel wise 95 pct confidence levels |
tau |
(FALSE/TRUE) return a raster with the pixel wise tau correlation values |
min.obs |
The threshold of minimum number of observations (default 6) |
method |
Kendall method to use c("zhang", "yuepilon","none"), see kendall function |
... |
Additional arguments passed to the terra app function |
This function implements Kendall's nonparametric test for a monotonic trend using the Theil-Sen (Theil 1950; Sen 1968; Siegel 1982) method to estimate the slope and related confidence intervals.
Depending on arguments, a raster layer or rasterBrick object containing:
raster layer 1 - slope for trend, always returned
raster layer 2 - Kendall's tau two-sided test, reject null at 0, if tau TRUE
raster layer 3 - intercept for trend if intercept TRUE
raster layer 4 - p value for trend fit if p.value TRUE
raster layer 5 - lower confidence level at 95 pct, if confidence TRUE
raster layer 6 - upper confidence level at 95 pct, if confidence TRUE
Jeffrey S. Evans jeffrey_evans@tnc.org
Theil, H. (1950) A rank invariant method for linear and polynomial regression analysis. Nederl. Akad. Wetensch. Proc. Ser. A 53:386-392 (Part I), 53:521-525 (Part II), 53:1397-1412 (Part III).
Sen, P.K. (1968) Estimates of Regression Coefficient Based on Kendall's tau. Journal of the American Statistical Association. 63(324):1379-1389.
Siegel, A.F. (1982) Robust Regression Using Repeated Medians. Biometrika, 69(1):242-244
zyp.trend.vector
for model details
app
for available ... arguments
library(terra)
# note; nonsense example with n=9
r <- c(rast(system.file("ex/logo.tif", package="terra")),
rast(system.file("ex/logo.tif", package="terra")),
rast(system.file("ex/logo.tif", package="terra")))
# Calculate trend slope with p-value and confidence level(s)
# ("slope","intercept", "p.value","z.value", "LCI","UCI","tau")
k <- raster.kendall(r, method="none")
plot(k)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.