aquakin.MonteCarloResult#

class aquakin.MonteCarloResult(input_names, output_names, samples, outputs, n_drawn, n_valid, sampler, seed)[source]#

Bases: object

Result of monte_carlo(): the sampled input/output ensemble.

Variables:
  • output_names (input_names,) – Names of the inputs (columns of samples) and outputs (columns of outputs).

  • samples (np.ndarray) – (n_valid, d) sampled input vectors (in physical space) with a finite output.

  • outputs (np.ndarray) – (n_valid, m) model outputs.

  • n_valid (n_drawn,) – Points drawn / kept (a non-finite output – a failed/clipped solve – is dropped).

  • seed (sampler,) – Sampler used and its seed (fixing it makes the result reproducible).

Parameters:
  • input_names (list[str])

  • output_names (list[str])

  • samples (ndarray)

  • outputs (ndarray)

  • n_drawn (int)

  • n_valid (int)

  • sampler (str)

  • seed (int)

__init__(input_names, output_names, samples, outputs, n_drawn, n_valid, sampler, seed)#
Parameters:
  • input_names (list[str])

  • output_names (list[str])

  • samples (ndarray)

  • outputs (ndarray)

  • n_drawn (int)

  • n_valid (int)

  • sampler (str)

  • seed (int)

Return type:

None

Methods

__init__(input_names, output_names, samples, ...)

mean()

Per-output mean, shape (m,).

output_named(name)

The (n_valid,) ensemble of one output by name.

percentiles([q])

Per-output percentiles, shape (len(q), m).

std()

Per-output standard deviation, shape (m,).

summary([q])

A human-readable table of mean / std / percentiles per output.

Attributes

input_names

output_names

samples

outputs

n_drawn

n_valid

sampler

seed

output_named(name)[source]#

The (n_valid,) ensemble of one output by name.

Parameters:

name (str)

Return type:

ndarray

mean()[source]#

Per-output mean, shape (m,).

Return type:

ndarray

std()[source]#

Per-output standard deviation, shape (m,).

Return type:

ndarray

percentiles(q=(2.5, 50.0, 97.5))[source]#

Per-output percentiles, shape (len(q), m).

Parameters:

q (Sequence[float])

Return type:

ndarray

summary(q=(2.5, 50.0, 97.5))[source]#

A human-readable table of mean / std / percentiles per output.

Parameters:

q (Sequence[float])

Return type:

str