Skip to content

local_variogram_parameters builtin

local_variogram_parameters(
    coords,
    values,
    grid,
    *,
    variogram,
    window,
    lag,
    max_lag=None,
    anisotropy=None,
    sectors=8,
    min_pairs=100,
)

Locally varying variogram parameters from moving-window fits.

Around each node of grid, the sample pairs within window are binned by distance and by direction, and the shape of variogram (its nugget and structures, rescaled to the variance of the window's values) is fitted to them by least squares weighted by the pair counts. Without anisotropy, the directions are measured in the frame of variogram and the fit finds, per node, the rotation in its major and semi-major plane, the semi-major ratio and a scale of every range. With anisotropy, each pair's separation is read in the local frame of its tail, so the bins follow a folded or rotating continuity; the local angles and minor ratio are kept and the fit finds the semi-major ratio and the scale. Nodes are fitted in parallel, with the same result on any number of threads.

Parameters:

Name Type Description Default
coords (array_like, PointSet or BlockModel)

Sample locations, shape (n, 2) or (n, 3), or a container.

required
values array_like or str

Sample values, or the column of coords holding them.

required
grid (BlockModel, PointSet or array_like)

Nodes to fit at, e.g. a coarse BlockModel.

required
variogram Variogram

Model whose shape is fitted and whose ranges the scales multiply.

required
window float

Radius of the moving window.

required
lag float

Lag-bin width.

required
max_lag float

Largest pair distance; default window.

None
anisotropy LocalAnisotropy

Local frames to measure directions in, taken from the nearest location at each sample and node.

None
sectors int

Direction sectors over 180 degrees.

8
min_pairs int

Fewest pairs in a window for a fit; a node with fewer keeps the angles and ratios of anisotropy, else of variogram, and scale 1.

100

Returns:

Type Description
LocalAnisotropy

At the nodes of grid: angles, ratios (semi-major within [0.05, 1]) and scales (within [0.1, 10]). Smooth it with LocalAnisotropy.smooth and pass it with variogram to kriging or simulation as anisotropy=.

used in