Skip to content

MultivariateSimulation

Several correlated variables simulated through independent factors.

Every realization simulates each factor with its own seed, back-transforms the factors together at the nodes, and only then averages to blocks.

With a trend at fit, one column per variable (None for a variable without one), each trended variable is normal-scored within classes equal-probability classes of its own trend, the stepwise conditional transform SGS uses. The joint transform and the factor simulations run on those trend-free scores, and each node is back-transformed with its own trend before any averaging to blocks.

Parameters:

Name Type Description Default
transform (PCA, MAF, StepwiseConditional or PPMT)

Template, fitted afresh by fit, that turns the variables into factors. PPMT, which also makes them Gaussian and takes declustering weights, is the usual choice.

required
simulators sequence of SGS or TurningBands

One per factor, in factor order, each with the normal-score variogram of its factor. With a trend, that variogram is of the factor of the trend-free scores.

required
classes int

Equal-probability classes of each trend, as in SGS.

10

fit method descriptor

fit(
    coords,
    data,
    *,
    weights=None,
    holes=None,
    impute=None,
    trend=None,
)

Fits the transform to the data, then each simulator to its factor. Samples missing a variable are dropped with a warning, unless impute; of samples sharing a location, the first is kept, with a warning naming their holes.

Parameters:

Name Type Description Default
coords (array_like, shape(n, 2) or (n, 3), PointSet or BlockModel)
required
data array_like, shape (n, variables), or list of str

One column per simulator, or the columns of coords holding them; NaN or null marks a missing variable.

required
weights array_like or str

Declustering weights, for the transform when it takes them (PCA, StepwiseConditional, PPMT) and for each factor's normal scores.

None
holes array_like or str

Drill-hole ids or names, for max_per_hole and the warning on samples sharing a location.

None
impute bool or GaussianImputer

Keep samples missing some variables: a GaussianImputer fitted to the data fills them afresh in every realization, so the imputation uncertainty reaches the realizations. Given an imputer, its components, spatial and neighbors are used, so with spatial the gaps also follow nearby samples. The transform is fitted to the complete samples. Samples missing every variable are dropped. With a trend, the imputer fills the trend-free scores.

None
trend sequence of array_like or str

One trend column per variable at the data, from any model or estimator, or None for a variable without a trend. An entry is an array or the column of coords holding it, as trend of SGS. simulate then needs that variable's trend at the targets.

None

from_parquet staticmethod

from_parquet(path)

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

simulate method descriptor

simulate(
    targets,
    *,
    n=100,
    seed=0,
    cutoffs=Ellipsis,
    quantiles=Ellipsis,
    keep=None,
    anisotropy=None,
    blocks=None,
    trend=None,
    memory=None,
)

Summaries of n realizations of every variable.

Parameters are those of SGS.simulate; anisotropy needs SGS for every factor. Factor j of realization k is simulated with a seed mixed from seed, k and j, so no two factors share random numbers. memory, the bytes the run may take (at least 1, default 70 % of the memory available now), bounds the realizations simulated at once and the bands of turning-bands factors; a run that does not fit even one realization at a time raises InvalidInput. Realizations do not depend on memory. trend, one entry per variable, is that variable's trend at the targets when it was fitted with one: an array, or the name of a column of PointSet or BlockModel targets, and None for a variable fitted without one. Each node takes its trend back after the joint back-transform and before any averaging.

Returns:

Type Description
list of SimulationSummary

One per variable, in column order.

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