autoemulate.calibration.interval_excursion_set#
- class BoundedDomainTransform(domain_min, domain_max)[source]#
Bases:
Transform
Transform to map from unbounded domain to bounded domain.
- domain = Real()#
- codomain = Interval(lower_bound=0.0, upper_bound=1.0)#
- bijective = True#
- class IntervalExcursionSetCalibration(emulator, parameters_range, output_bounds, output_names, device=None, log_level='progress_bar')[source]#
Bases:
TorchDeviceMixin
,BayesianMixin
Interval excursion set calibration using MC methods.
Interval excursion set calibration identifies the set of input parameters that lead to model outputs that are within specified intervals of observed data.
- MIN_VAR = 1e-12#
Minimum variance to avoid numerical issues.
- property y_lower#
Return lower bounds as a tensor.
- property y_upper#
Return upper bounds as a tensor.
- interval_prob_from_mu_sigma(mu, var_or_cov, y1, y2, aggregate='geomean')[source]#
Interval probability across tasks given GP mean and variance/covariance.
- Parameters:
mu (TensorLike) – Mean per task (N, T) or (T,)
var_or_cov (TensorLike) – (N, T) variance per task OR (N, T, T) covariance across tasks
y1 (TensorLike) – (T,) lower/upper bounds per task
y2 (TensorLike) – (T,) lower/upper bounds per task
aggregate (str) –
- ‘geomean’ | ‘sumlog’ | ‘none’
’geomean’: returns geometric mean across tasks (shape N,)
’sumlog’: returns sum of log-probs across tasks (shape N,)
’none’: returns per-task probabilities (shape N, T)
- interval_logprob(mu, var, y1, y2, temperature=1.0)[source]#
Multi-task interval log-probability (sum of log-probs across tasks).
- Parameters:
mu (TensorLike) – Predicted mean. Shape (N, T) or (T,)
var (TensorLike) – Predicted variance per task (N, T) or covariance (N, T, T)
y1 (TensorLike) – lower bounds (T,)
y2 (TensorLike) – upper bounds (T,)
temperature (float) – Optional temperature scaling. Defaults to 1.0.
- Returns:
Scalar per sample (sums over tasks) and then summed over batch here only when inputs are 1-sample; callers can keep per-sample if needed by removing .sum().
- Return type:
TensorLike
- model(temperature=1.0, uniform_prior=True, predict=False)[source]#
Pyro model for interval excursion set calibration.
- run_smc(n_particles=4000, ess_target_frac=0.7, max_steps=60, move_steps=2, rw_step=0.3, seed=None, uniform_prior=True, plot_diagnostics=True, return_az_data=True)[source]#
SMC with adaptive tempering for interval posterior.
- Parameters:
n_particles (int) – Number of particles to use. Defaults to 4000.
ess_target_frac (float) – Target effective sample size (ESS) as a fraction of n_particles. Defaults to 0.7.
max_steps (int) – Maximum number of tempering steps. Defaults to 60.
move_steps (int) – Number of random-walk Metropolis steps per rejuvenation. Defaults to 2.
rw_step (float) – Standard deviation of the random-walk proposal in whitened space. Defaults to 0.
seed (int | None) – Random seed for reproducibility. Defaults to None.
uniform_prior (bool) – If True, use uniform prior over the bounded domain. If False, use standard normal prior in the whitened space (z ~ N(0, I_d)). Defaults to True.
plot_diagnostics (bool) – Whether to plot diagnostic plots of the final particles, temperature schedule, and ESS history. Defaults to True.
return_az_data (bool) – Whether to return ArviZ InferenceData object. Defaults to True.
- Returns:
A tuple of x_final, weights, beta_schedule, ess_history, unique_count or an ArviZ InferenceData object if return_az_data is True.
- Return type:
Tuple[TensorLike, TensorLike, TensorLike, TensorLike, int] | az.InferenceData
References
See Del Moral et al. (2006) <https://doi.org/10.1111/j.1467-9868.2006.00553.x> “Sequential Monte Carlo samplers” for details on the SMC algorithm.