dot-core_reconc_MixCond: Core Reconciliation via Importance Sampling for Mixed...

.core_reconc_MixCondR Documentation

Core Reconciliation via Importance Sampling for Mixed Hierarchies

Description

Internal function that performs the core reconciliation logic using importance sampling (IS) to reconcile mixed-type hierarchies. The base bottom forecasts (provided as samples) are reweighted according to their fit to the upper multivariate Gaussian forecasts.

Usage

.core_reconc_MixCond(
  A,
  B,
  mean_upper,
  cov_upper,
  num_samples,
  return_type,
  return_ESS = TRUE,
  return_upper = TRUE,
  suppress_warnings = FALSE
)

Arguments

A

Matrix (n_upper x n_bottom) defining the hierarchy where upper = A %*% bottom.

B

Matrix (n_samples x n_bottom) of bottom base forecast samples to be reconciled.

mean_upper

Vector of upper level means.

cov_upper

Covariance matrix of upper level.

num_samples

Number of samples to draw/resample from.

return_type

Character string specifying return format: 'pmf', 'samples', or 'all'.

return_ESS

Logical, whether to return the Effective Sample Size (ESS) from importance sampling weights (default TRUE).

return_upper

Logical, whether to return the reconciled parameters for the upper variables (default TRUE).

suppress_warnings

Logical. If TRUE, suppresses warnings about sample quality (default FALSE).

Value

A list containing:

  • bottom_rec: List with reconciled bottom forecasts (pmf and/or samples).

  • bottom_rec_pmf: list of PMF objects for each bottom series (only if return_type is 'pmf' or 'all').

  • bottom_rec_samples: matrix (n_bottom x num_samples) of reconciled bottom samples (only if return_type is 'samples' or 'all').

  • upper_rec_pmf: list of PMF objects for each upper series (only if return_type is 'pmf' or 'all', and return_upper = TRUE).

  • upper_rec_samples: matrix (n_upper x num_samples) of reconciled upper samples (only if return_type is 'samples' or 'all', and return_upper = TRUE).

  • ESS: Effective Sample Size resulting from importance sampling reweighting (only if return_ESS = TRUE).


bayesRecon documentation built on March 8, 2026, 9:08 a.m.