Learn R Programming

neuralGAM (version 2.0.1)

.combine_uncertainties_sampling: Internal helper: combine epistemic and aleatoric uncertainties via mixture sampling

Description

Combine uncertainty estimates from multiple MC Dropout passes where each pass produces quantile bounds and a mean. For each observation, samples are drawn from Normal approximations of aleatoric noise across passes, yielding a predictive mixture distribution.

Usage

.combine_uncertainties_sampling(
  lwr_mat,
  upr_mat,
  mean_mat,
  alpha = 0.05,
  inner_samples = 50,
  centerline = NULL
)

Value

A data.frame with columns:

  • lwr, upr: lower/upper predictive interval.

  • var_epistemic: epistemic variance (across passes).

  • var_aleatoric: average aleatoric variance.

  • var_total: sum of epistemic and aleatoric variances.

Arguments

lwr_mat

Matrix [passes, n_obs] of lower quantile predictions.

upr_mat

Matrix [passes, n_obs] of upper quantile predictions.

mean_mat

Matrix [passes, n_obs] of mean predictions.

alpha

Coverage level (default 0.05).

inner_samples

Number of Normal samples per pass/observation.

centerline

Optional vector of deterministic mean predictions (overrides pass-mean).

Author

Ines Ortega-Fernandez, Marta Sestelo