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.
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 |
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 |
None
|
trend
|
array_like or str
|
Locally varying mean at the data, from any model or estimator;
|
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 |
None
|
secondary
|
array_like or str
|
A secondary variable at the data, for collocated co-DSS:
|
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 |
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 |
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 |
None
|
domains
|
array_like or label
|
As in |
None
|
domain_column
|
str
|
As in |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The pass, 1-based; NaN where no search finds enough data, and
|
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 |
None
|
quantiles
|
sequence of float
|
Probabilities for the values at quantiles. |
Ellipsis
|
tolerances
|
sequence of float
|
Relative tolerances for |
Ellipsis
|
keep
|
bool or sequence of int
|
Keep all realizations, or those indices, as an
|
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
|
|
None
|
groups
|
array_like or str
|
Label of each row, or a column name: one summary row per
distinct label, in |
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 |
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 |
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 |
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