% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/reconc_MixCond.R
\name{.core_reconc_MixCond}
\alias{.core_reconc_MixCond}
\title{Core Reconciliation via Importance Sampling for Mixed Hierarchies}
\usage{
.core_reconc_MixCond(
  A,
  B,
  mean_upper,
  cov_upper,
  num_samples,
  return_type,
  return_ESS = TRUE,
  return_upper = TRUE,
  suppress_warnings = FALSE
)
}
\arguments{
\item{A}{Matrix (n_upper x n_bottom) defining the hierarchy where upper = A \%*\% bottom.}

\item{B}{Matrix (n_samples x n_bottom) of bottom base forecast samples to be reconciled.}

\item{mean_upper}{Vector of upper level means.}

\item{cov_upper}{Covariance matrix of upper level.}

\item{num_samples}{Number of samples to draw/resample from.}

\item{return_type}{Character string specifying return format: 'pmf', 'samples', or 'all'.}

\item{return_ESS}{Logical, whether to return the Effective Sample Size (ESS) from importance sampling weights (default TRUE).}

\item{return_upper}{Logical, whether to return the reconciled parameters for the upper variables (default TRUE).}

\item{suppress_warnings}{Logical. If TRUE, suppresses warnings about sample quality (default FALSE).}
}
\value{
A list containing:
\itemize{
\item \code{bottom_rec}: List with reconciled bottom forecasts (pmf and/or samples).
\item \code{bottom_rec_pmf}: list of PMF objects for each bottom series (only if \code{return_type} is 'pmf' or 'all').
\item \code{bottom_rec_samples}: matrix (n_bottom x num_samples) of reconciled bottom samples (only if \code{return_type} is 'samples' or 'all').
\item \code{upper_rec_pmf}: list of PMF objects for each upper series (only if \code{return_type} is 'pmf' or 'all', and \code{return_upper = TRUE}).
\item \code{upper_rec_samples}: matrix (n_upper x num_samples) of reconciled upper samples (only if \code{return_type} is 'samples' or 'all', and \code{return_upper = TRUE}).
\item \code{ESS}: Effective Sample Size resulting from importance sampling reweighting (only if \code{return_ESS = TRUE}).
}
}
\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.
}
\keyword{internal}
