mixle.doe.propagate module¶
Forward uncertainty propagation: push an input distribution through a model to output statistics.
Given input uncertainty (a Gaussian or a sampler) and a model f, report the induced uncertainty on
the output – mean, standard deviation, and quantiles. Monte Carlo is general; the unscented transform
propagates the first two moments with 2d+1 deterministic sigma points (exact for a linear model, a
good cheap approximation for mild nonlinearity). The back half of the UQ loop, after sensitivity.
- propagate(func, mean, cov=None, *, n=10000, method='montecarlo', quantiles=(0.05, 0.5, 0.95), seed=0)[source]
Propagate a Gaussian input
N(mean, cov)throughfuncto output statistics.- Parameters:
func (Callable[[ndarray], ndarray]) – a vectorized model
f(X) -> ymapping(m, d)inputs to(m,)(or(m, k)) outputs.mean (ndarray) – length-
dinput mean.cov:(d, d)input covariance (defaults to identity).n (int) – Monte Carlo sample size (ignored by the unscented method).
method (str) –
'montecarlo'(sample + summarize, gives quantiles) or'unscented'(sigma-point moment propagation, mean + std only). Looked up through the propagator registry.quantiles (tuple[float, ...]) – output quantiles to report (Monte Carlo only).
cov (ndarray | None)
seed (int)
- Returns:
{'mean', 'std', 'quantiles' (mc only), 'samples' (mc only)}.- Return type:
- register_propagator(name)[source]
Decorator registering a propagation method under
nameforpropagate().The decorated callable receives
(func, mean, cov, *, n, quantiles, seed)(mean/covalready coerced to float arrays) and returns the output-statistics dict.
- unscented_transform(func, mean, cov, *, alpha=1e-3, beta=2.0, kappa=0.0)[source]
Propagate
(mean, cov)throughfuncwith the unscented (sigma-point) transform.Returns the output
(mean, covariance). Exact for an affinefunc; for a nonlinear one it captures the mean and covariance to second order with only2d+1evaluations.