Skip to contents

Native ordinary kriging: solves the standard kriging system built from a fitted variogram and returns the BLUP surface with kriging variances. When no variogram is supplied, a fast weighted least-squares fit with Cressie weights is used; pass vgm = morie_spatial_variogram_fit(...) for the slower full Gaussian-likelihood MLE.

Usage

morie_spatial_krige(coords, values, new_coords, vgm = NULL)

Arguments

coords

Matrix (or coercible) of observation coordinates, one row per observation.

values

Numeric observations at coords.

new_coords

Matrix of prediction locations.

vgm

Optional fitted variogram list with elements model, nugget, psill, range (as returned by morie_spatial_variogram_fit). Default NULL fits by WLS.

Value

A data.frame with one row per prediction location: pred (kriging mean) and var (kriging variance, truncated at zero).

References

Cressie (1993) Statistics for Spatial Data.

Examples

set.seed(1)
xy <- cbind(runif(60), runif(60))
z <- sin(3 * xy[, 1]) + rnorm(60, sd = 0.1)
morie_spatial_krige(xy, z, cbind(0.5, 0.5))
#>      pred        var
#> 1 1.06704 0.01030984