| .core_reconc_MixCond | R Documentation |
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 |
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). |
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).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.