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
domains at fit, Search.soft lets the raw grades 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.
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,
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
|
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,
domains=None,
domain_column=None,
secondary=None,
grade_tonnage_cutoffs=None,
density=None,
tonnage=None,
categories=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 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
|
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
|
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