Skip to content

SimulationSummary

Uncertainty at every target from n realizations of a continuous variable. Per-cutoff and per-quantile arrays have one row per target and one column per cutoff or quantile.

cv property

cv

Coefficient of variation across realizations, std / mean; NaN where the mean is 0.

groups property

groups

Label of each row from groups=, in row order; None without it.

kept property

kept

Indices of the realizations kept with keep=.

mean property

mean

Mean of the realizations (E-type estimate).

mean_above property

mean_above

(targets, cutoffs) mean of the values above each cutoff; NaN where no realization is above it.

precision property

precision

(targets, tolerances) fraction of realizations within r * |mean| of the mean, P(|Z - mean| <= r |mean|), for each tolerance r of simulate(tolerances=). With r = 0.15, a row whose precision reaches 0.9 meets the common ±15 % at 90 % confidence criterion for measured resources. NaN where the mean is 0 or NaN.

probability_above property

probability_above

(targets, cutoffs) fraction of realizations above each cutoff.

quantile_values property

quantile_values

(targets, quantiles) values at each requested quantile.

realization_above property

realization_above

(n, cutoffs) fraction of targets above each cutoff in each realization.

realization_mean property

realization_mean

Mean of each realization over all targets, (n,).

realizations property

realizations

(len(kept), targets) kept realizations; None when none were kept.

variance property

variance

Variance across realizations.

from_parquet staticmethod

from_parquet(path)

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

grade_tonnage method descriptor

grade_tonnage(*, probabilities=Ellipsis)

Grade–tonnage curves across realizations, from a simulate run with grade_tonnage_cutoffs.

Parameters:

Name Type Description Default
probabilities sequence of float
(0.1, 0.5, 0.9)

Returns:

Type Description
Table

category (all for all targets), cutoff, probability, and the quantiles of tonnage, metal and mean_grade above the cutoff across realizations, each taken on its own: the P50 tonnage and the P50 grade may come from different realizations. mean_grade skips realizations with no tonnes above the cutoff.

relative_error method descriptor

relative_error(*, confidence=0.9, center='mean')

Relative error per target: half the central confidence interval over its center, (q_hi - q_lo) / (2 * center).

Parameters:

Name Type Description Default
confidence float

Probability within the interval; 0.9 reads the 0.05 and 0.95 quantiles, which quantiles= must have requested.

0.9
center (mean, median)

The median needs the 0.5 quantile too.

"mean"

Returns:

Type Description
ndarray

NaN where the center is 0.

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.

validate method descriptor

validate(
    truth,
    *,
    data=None,
    confidence=0.9,
    cutoff=None,
    probability=0.5,
)

Checks the summary against a known truth, such as a reference realization the data were sampled from.

Parameters:

Name Type Description Default
truth array_like or str

True value of each summary row, or the column of data holding it.

required
data PointSet or BlockModel

Container whose column truth names.

None
confidence float

Confidence of the maximum expected error (MEE, after Koppe), relative_error at this confidence; needs the matching quantiles, 0.05 and 0.95 for 0.9.

0.9
cutoff float

Classifies each row as ore where the probability above cutoff, which simulate(cutoffs=) must have requested, is at least probability.

None
probability float

Probability above cutoff from which a row is ore.

0.5

Returns:

Type Description
Table

truth, mean, error ((mean - truth) / truth, positive where the mean overestimates, NaN where the truth is 0), covered (|truth - mean| / |mean| within the MEE, false where the truth or the MEE is NaN), and with cutoff, type_1 (classified ore while the truth is at or below the cutoff) and type_2 (classified waste while the truth is above it). One row per summary row.

Raises:

Type Description
InvalidInput

If the quantiles or the cutoff were not requested, or truth has the wrong length.