Given a fitted Keras submodel and covariate input x, compute uncertainty
estimates according to the uncertainty_method.
"epistemic": estimates only epistemic variance (via MC Dropout passes).
"aleatoric": uses deterministic quantile heads to estimate aleatoric variance.
"both": combines aleatoric and epistemic using variance decomposition.
Otherwise: returns NA placeholders.
.compute_uncertainty(model, x, uncertainty_method, alpha, forward_passes)A data.frame with columns:
lwr, upr: lower/upper bounds of interval estimates.
var_epistemic: epistemic variance.
var_aleatoric: aleatoric variance.
var_total: total variance (epistemic + aleatoric).
Fitted Keras model for a single smooth term.
Input covariate matrix (or vector; will be reshaped as needed).
Character; one of "epistemic", "aleatoric", "both", or "none".
Coverage level (e.g. 0.05 for 95% bands).
Integer; number of MC Dropout passes.
Ines Ortega-Fernandez, Marta Sestelo