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.
.core_reconc_MixCond(
A,
B,
mean_upper,
cov_upper,
num_samples,
return_type,
return_ESS = TRUE,
return_upper = TRUE,
suppress_warnings = FALSE
)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).
Matrix (n_upper x n_bottom) defining the hierarchy where upper = A %*% bottom.
Matrix (n_samples x n_bottom) of bottom base forecast samples to be reconciled.
Vector of upper level means.
Covariance matrix of upper level.
Number of samples to draw/resample from.
Character string specifying return format: 'pmf', 'samples', or 'all'.
Logical, whether to return the Effective Sample Size (ESS) from importance sampling weights (default TRUE).
Logical, whether to return the reconciled parameters for the upper variables (default TRUE).
Logical. If TRUE, suppresses warnings about sample quality (default FALSE).