% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/baseline_conjugate.R
\name{disaggregate_conjugate}
\alias{disaggregate_conjugate}
\title{Conjugate (closed-form) disaggregation baseline}
\usage{
disaggregate_conjugate(
  cpi,
  W,
  years = NULL,
  industries = NULL,
  q_frac = 0.1,
  r_frac = 0.05,
  p0_frac = 0.3,
  n_draws = 0L,
  seed = 1234L
)
}
\arguments{
\item{cpi}{Numeric vector (length \eqn{T}); observed aggregate index (levels).}

\item{W}{Numeric matrix (\eqn{T \times K}); VAB weights (rows sum to 1).}

\item{years, industries}{Optional period and sector labels.}

\item{q_frac}{Random-walk innovation sd as a fraction of \code{sd(cpi)}
(state noise). Default \code{0.10}.}

\item{r_frac}{Observation sd as a fraction of \code{sd(cpi)}. Default \code{0.05}.}

\item{p0_frac}{Initial cross-sectional sd as a fraction of \code{cpi[1]}.
Default \code{0.30}.}

\item{n_draws}{Integer; number of joint posterior draws (simulation smoother).
\code{0} (default) returns only the smoothed mean and bands.}

\item{seed}{Integer RNG seed (used only when \code{n_draws > 0}).}
}
\value{
An object of class \code{"disagg_conjugate"}: a list with
  \code{phi_summary} (median = smoothed mean, \code{q2.5}/\code{q97.5} from the
  marginal Gaussian), \code{agg_summary}, \code{loglik} (total Gaussian
  log-likelihood of \code{cpi}), \code{phi_draws} (\code{[T, K, n_draws]} or
  \code{NULL}), \code{years}, \code{industries}, \code{config}.
}
\description{
Exact linear-Gaussian state-space posterior (Kalman/RTS smoother) for the
sectoral price-index levels \eqn{\varphi_{t,k}} given the aggregate index and
the VAB weights. Optionally returns joint posterior draws via the
Durbin-Koopman simulation smoother (so the draws can also feed
\code{bayesianOU::fit_ou_nested_mi}), and a pointwise Gaussian log-likelihood.
}
\examples{
sim <- simulate_disagg(T = 25, K = 4, seed = 7)
bl  <- disaggregate_conjugate(sim$cpi, sim$W)
dim(bl$phi_summary$median)
}
\seealso{
\code{\link{disaggregate_statespace}} (canonical engine).
}
