Skip to contents

StFit: weighted least-squares fit of a vgmST model to an empirical space-time variogram, as gstat::fit.StVariogram (parameters in extractPar order, gstat's default bounds, weights fit_method 1, 2, 6 or 7), by L-BFGS-B, with least-squares AIC and BIC. StUniversalKriging: kriging with drift \(x'\beta\), as krigeST(z ~ x). StLocalKriging: the ceiling(buffer nmax) nearest observations in the metric \(\sqrt{dx^2 + dy^2 + (a\,dt)^2}\), of which the nmax most covarying are kept, as krigeST(nmax, stAni). StBlockKriging: kriging of a space-time block mean (square block, time window, discretised). StLeaveHOut: buffered cross-validation. StKrigingDiagnostics: conditioning, weights, Lagrange multiplier, relative variance. StSmoothness: mean-square differentiability order in space and time. StPredictGrid: grid prediction per time. StSimulate: Cholesky simulation, conditioned on data by simple kriging of residuals. Identical to the Python arm morie.fn.stgeo; neighbour indices are 1-based here.

Usage

StFit(
  dist,
  timelag,
  gamma,
  np_,
  model,
  start,
  fit_method = 6,
  stani = NULL,
  space_model = "Exp",
  time_model = "Exp",
  joint_model = "Exp",
  lower = NULL,
  upper = NULL
)

StUniversalKriging(z, X, coords, times, X0, new_coords, new_times, model)

StLocalKriging(
  z,
  coords,
  times,
  new_coords,
  new_times,
  model,
  nmax,
  stani,
  buffer = 2,
  beta = NULL
)

StBlockKriging(
  z,
  coords,
  times,
  new_coords,
  new_times,
  model,
  block,
  duration,
  n_space = 4L,
  n_time = 3L,
  beta = NULL
)

StLeaveHOut(z, coords, times, model, h, tau, beta = NULL)

StKrigingDiagnostics(coords, times, new_coords, new_times, model)

StSmoothness(model)

StPredictGrid(z, coords, times, model, xs, ys, new_times, beta = NULL)

StSimulate(
  coords,
  times,
  model,
  nsim = 1L,
  seed = 1,
  mean = 0,
  z = NULL,
  data_coords = NULL,
  data_times = NULL
)

Arguments

dist, timelag, gamma, np_

Empirical variogram columns.

model

Model name (StFit) or STCovariance model list.

start

Starting parameters.

fit_method

Weighting (1, 2, 6 or 7).

stani

Space-time anisotropy.

space_model, time_model, joint_model

Marginal model families.

lower, upper

Optional bounds.

z

Observed values.

X, X0

Drift design matrices for data and targets.

coords, times

Observation locations and times.

new_coords, new_times

Target locations and times.

nmax

Neighbourhood size.

buffer

Candidate multiplier.

beta

Known mean (simple kriging).

block, duration

Spatial block side and time window.

n_space, n_time

Block discretisation.

h, tau

Spatial and temporal exclusion radii.

xs, ys

Grid coordinates.

nsim

Number of realisations.

seed

Philox seed.

mean

Field mean.

data_coords, data_times

Conditioning data locations and times.

Value

List.

References

Graeler, B., Pebesma, E. and Heuvelink, G. (2016). Spatio-temporal interpolation using gstat. The R Journal 8(1), 204-218.

Journel, A. G. and Huijbregts, C. J. (1978). Mining Geostatistics. Academic Press.

Stein, M. L. (1999). Interpolation of Spatial Data: Some Theory for Kriging. Springer.

Examples

m <- list(type = "metric", stAni = 1, joint = list(model = "Exp", psill = 1, range = 1))
P <- rbind(c(0, 0), c(1, 0), c(0, 1), c(1, 1))
StBlockKriging(c(1, 2, 1.5, 1.2), P, c(0, 0, 1, 1), rbind(c(0.5, 0.5)), 0.5, m, block = 1,
  duration = 1)$variance
#> [1] 0.1919306
StSmoothness(m)$space
#> [1] 0