Skip to content

DSS

Direct sequential simulation: SGS in data units, with no normal-score transform of the kriged field.

Each node is simple kriged from the raw values of its neighbors, with its domain's declustered mean as the known mean. variogram is the variogram of the values: within each domain its nugget and sills are rescaled so that the total sill equals the domain's declustered variance, keeping its shape and relative nugget. The node is then drawn from the domain's declustered histogram, as the back-transform of a Gaussian m + s·z whose back-transformed mean and variance are the kriged ones. A kriged pair that no such draw reaches, such as a mean beyond the data or a large variance near the tails, takes the nearest reachable pair; simulate warns with the fraction of such nodes. Each draw matches the kriged mean and variance, not the shape of the histogram: on skewed grades with a large nugget, low means take wide draws and the realizations hold too many extreme grades, which correct_distribution maps back to the histogram.

search is a Search, or a sequence of them as passes, as in SGS. With a trend at fit (a locally varying mean), the residuals values - trend are simple kriged with mean 0 and variogram is the variogram of those residuals, rescaled to each domain's declustered residual variance; each node is drawn from its domain's residual histogram and added to the node's trend. With domains at fit, Search.soft lets the raw grades (or residuals) of other domains inform a node within the soft distance, and high_grade compares grades with its threshold, kriging a clamped neighbor as the threshold (minus its trend).

correlation property

correlation

Correlation of the standardized primary and secondary used in collocated co-DSS; None when fitted without secondary.

n_samples property

n_samples

Number of fitted samples; None before fit.

search property

search

The search passes given at construction.

variogram property

variogram

The variogram given at construction.

fit method descriptor

fit(
    coords,
    values,
    *,
    weights=None,
    holes=None,
    trend=None,
    domains=None,
    domain_column=None,
    secondary=None,
    correlation=None,
)

Takes the conditioning data. Samples sharing a location keep the first, with a warning naming their holes.

Parameters:

Name Type Description Default
coords (array_like, shape(n, 2) or (n, 3), PointSet or BlockModel)
required
values array_like, shape (n,), or str

Values, or the column of coords holding them; so for weights, holes and trend.

required
weights array_like or str

Declustering weights, for each domain's histogram, mean and variance.

None
holes array_like or str

Drill-hole ids or names, for max_per_hole.

None
trend array_like or str

Locally varying mean at the data, from any model or estimator; simulate then needs the trend at the targets.

None
domains array_like or label

Domain label of each sample, or one label for all: strings, numbers or booleans. Each domain has its own histogram, mean and rescaled variogram.

None
domain_column str

The column of coords holding the domains, instead of domains.

None
secondary array_like or str

A secondary variable at the data, for collocated co-DSS: simulate then needs it at every target. Each node's kriged mean and variance become those of the collocated simple cokriging, in standardized units, of its neighbors and the secondary at the node, under the Markov model (the cross-covariance is correlation times the primary covariance), and the node is drawn from the histogram with that mean and variance. The primary is standardized by its domain's declustered mean and variance, the secondary by its own at the data.

None
correlation float

Correlation of the standardized primary and secondary, in [-1, 1]; by default their weighted correlation at the data. 0 simulates as without secondary.

None

Raises:

Type Description
InvalidInput

If the values of a domain do not vary, a Search.soft names a domain without samples or has no domains to work on, both domains and domain_column are given, or correlation comes without secondary or outside [-1, 1].

from_parquet staticmethod

from_parquet(path)

Reads to_parquet output; raises InvalidInput on another class's file or a newer format.

passes method descriptor

passes(
    targets,
    *,
    anisotropy=None,
    domains=None,
    domain_column=None,
)

The search pass of every target, as in SGS.passes.

Parameters:

Name Type Description Default
targets array_like or BlockModel
required
anisotropy LocalAnisotropy

As in simulate.

None
domains array_like or label

As in simulate.

None
domain_column str

As in simulate.

None

Returns:

Type Description
ndarray

The pass, 1-based; NaN where no search finds enough data, and simulate uses the last.

simulate method descriptor

simulate(
    targets,
    *,
    n=100,
    seed=0,
    cutoffs=None,
    quantiles=Ellipsis,
    tolerances=Ellipsis,
    keep=None,
    anisotropy=None,
    blocks=None,
    window=None,
    groups=None,
    trend=None,
    domains=None,
    domain_column=None,
    secondary=None,
    grade_tonnage_cutoffs=None,
    density=None,
    tonnage=None,
    categories=None,
    path=None,
    batch=None,
    memory=None,
)

Summary of n realizations at targets, each seeded from seed and its index.

Parameters:

Name Type Description Default
targets array_like or BlockModel
required
n int
100
seed int
0
cutoffs sequence of float or str

Grades for the probability and mean at or above, in the unit of the values or as text such as "0.5 g/t".

None
quantiles sequence of float

Probabilities for the values at quantiles.

Ellipsis
tolerances sequence of float

Relative tolerances for SimulationSummary.precision, as in SGS.simulate.

Ellipsis
keep bool or sequence of int

Keep all realizations, or those indices, as an (n, targets) array.

False
anisotropy LocalAnisotropy

Orients each node's variogram and search.

None
blocks BlockModel

Coarser blocks each realization is averaged to, weighted by node volume, and summarized at; nodes outside every block are ignored and a block holding no node is an error.

None
window tuple of float

(dx, dy, dz) box centered on each row (the blocks when given, else the targets), summarized at the average of the rows whose center it holds, as in SGS.simulate.

None
groups array_like or str

Label of each row, or a column name: one summary row per distinct label, in numpy.unique order, as in SGS.simulate.

None
trend array_like or str

Needed when fitted with a trend: the locally varying mean at the targets, as an array or the name of a column of PointSet or BlockModel targets.

None
domains array_like or label

Needed when fitted with domains: labels of the targets, one label for all, or an (n, targets) array of simulated domains, realization k of the grades simulated within row k. A target in a domain without samples raises InvalidInput.

None
domain_column str

The column of PointSet or BlockModel targets holding the domains.

None
secondary array_like or str

Needed when fitted with one: the secondary variable at the targets, the name of a column of PointSet or BlockModel targets, or an (n, targets) array such as the realizations of a simulation of the secondary, realization k then cosimulated with row k.

None
grade_tonnage_cutoffs optional

Grade–tonnage curves per realization, as in SGS.simulate.

None
density optional

Grade–tonnage curves per realization, as in SGS.simulate.

None
tonnage optional

Grade–tonnage curves per realization, as in SGS.simulate.

None
categories optional

Grade–tonnage curves per realization, as in SGS.simulate.

None
path (shared, random)

"shared" walks one multigrid path for every realization on a regular or masked BlockModel, so each node's neighbors and kriging weights are found once for a batch of realizations; "random" draws a new random path per realization. The default is "shared" where it can run and "random" otherwise (points, local anisotropy, domains, a secondary variable, a trend, octant or sector searches, min_holes, soft boundaries); "shared" raises InvalidInput there.

"shared"
batch int

On a shared path, the realizations simulated together; by default as many as fit in memory. The realizations do not depend on it.

None
memory int or float

Bytes the run may take, at least 1; default 70 % of the memory available now. It bounds the realizations simulated at once; a run whose single realization does not fit raises InvalidInput. The realizations do not depend on it.

None

Returns:

Type Description
SimulationSummary

Warns:

Type Description
UserWarning

With the fraction of nodes whose kriged mean and variance no draw from the histogram reaches, drawn from the nearest reachable pair.

to_parquet method descriptor

to_parquet(path)

Writes arrays as Parquet columns and parameters as JSON in the file metadata; from_parquet reads it back.

Used in