% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial-prior.R
\name{posterior_classify}
\alias{posterior_classify}
\title{Bayesian posterior classifier (optional)}
\usage{
posterior_classify(result, prior, epsilon = 0.001)
}
\arguments{
\item{result}{A \code{\link{ClassificationResult}} from
\code{\link{classify_wrb2022}}.}

\item{prior}{A spatial-prior data.table (as returned by
\code{\link{spatial_prior}}).}

\item{epsilon}{Small smoothing constant added to all prior entries
before normalising, so RSGs unseen by the prior do not
receive zero posterior.}
}
\value{
A \code{data.table} with columns \code{rsg_code},
        \code{prior}, \code{likelihood}, \code{posterior}.
}
\description{
Combines a deterministic \code{\link{ClassificationResult}} with a
spatial prior. The deterministic key remains authoritative -- this
function reports only an alternative probabilistic view useful for
downstream uncertainty quantification.
}
\details{
Posterior is computed under the simple model:
\deqn{P(rsg | site, evidence) \propto L(rsg | evidence) \times P(rsg | site)}
where the likelihood \code{L} is concentrated on the deterministic
assignment (delta-1 at that code) by default, optionally smoothed
if \code{key_passed_others} is supplied.
}
