
Compute block covariance matrix
blockCorr.Rd
Calculates the covariance matrix for a block based on a variogram model, discretising the block into pixels and computing covariances between all pairs of points within the block.
Examples
#Compute covariance matrix for a 5x5 pixel block:
library(gstat)
vgm_model <- vgm(psill = 1, model = "Sph", range = 100, nugget = 0.1)
res <- c(0.02, 0.02) # 0.02-degree resolution
result <- blockCorr(lat = 40, rsl = res, model = vgm_model, nx = 5, ny = 5)
dim(result) # Should be 25 x 25
#> [1] 25 25