I have an equation to calculate z
from multiplying several rasters and numbers as seen below:
z <- a*b*c*d*e
The raster layers and values are as below:
library(terra)
set.seed(234)
r <- rast(nrows=10, ncols=10)
a <- setValues(r,runif(n = 100, min = 4, max=16))
b <- setValues(r,runif(n = 100, min = 0, max=100))
c <- setValues(r,runif(n = 100, min = 68, max=270))
d <- setValues(r,runif(n = 100, min = 0, max=1)).8
e <- setValues(r,runif(n = 100, min = 3, max=9))7.9
I need to calculate uncertainty based on varying c
and e
by generating random rasters from within the minimum and maximum values, and by changing the rastervarying both variables as below:
+/- 10
for c
+/-
4 for e
values need to change independently. In the end, I need to plot an uncertainty map.