Learn R Programming

neuralGAM (version 2.0.1)

.combine_uncertainties_variance: Internal helper: combine epistemic and aleatoric via variance decomposition

Description

Classical combination of uncertainties without sampling. Assumes the same input shapes as .combine_uncertainties_sampling: each argument is a matrix of shape [passes, n_obs], where rows index MC-Dropout passes and columns index observations.

For each observation (column):

  • Epistemic variance = variance across passes of the mean head.

  • Aleatoric variance = average (across passes) of per-pass variance estimated from quantile width via Normal approximation.

  • Total variance = epistemic + aleatoric.

  • Predictive interval = Normal-theory interval around the chosen centerline.

Usage

.combine_uncertainties_variance(
  lwr_mat,
  upr_mat,
  mean_mat,
  alpha = 0.05,
  centerline = NULL
)

Value

data.frame with columns:

  • lwr, upr: lower/upper predictive interval (Normal-theory)

  • var_epistemic: variance across passes of mean predictions

  • var_aleatoric: average per-pass aleatoric variance (from quantile width)

  • var_total: sum of epistemic and aleatoric variances

Arguments

lwr_mat

[passes, n_obs] lower-quantile predictions per pass.

upr_mat

[passes, n_obs] upper-quantile predictions per pass.

mean_mat

[passes, n_obs] mean-head predictions per pass.

alpha

Coverage level (default 0.05).

centerline

Optional numeric vector (length n_obs) of deterministic mean predictions to use as the PI center. If NULL, uses the across-pass mean.

Author

Ines Ortega-Fernandez, Marta Sestelo