% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial-combine.R
\name{combine_priors}
\alias{combine_priors}
\title{Combine multiple spatial priors via weighted geometric mean}
\usage{
combine_priors(priors, weights = NULL, epsilon = 1e-06)
}
\arguments{
\item{priors}{A list of \code{data.table}s with columns
\code{rsg_code} and \code{probability}.}

\item{weights}{Optional non-negative numeric vector of length
\code{length(priors)}. Defaults to equal weights. Will be
renormalised to sum to 1.}

\item{epsilon}{Smoothing floor for classes missing from a prior
(default 1e-6). Must be > 0 -- otherwise any class missing
from a single prior is suppressed entirely.}
}
\value{
A \code{data.table} with columns \code{rsg_code},
        \code{probability}, sorted by descending probability.
}
\description{
Given a list of priors (each a data.table with \code{rsg_code,
probability}), pools them into a single distribution using a
weighted geometric mean and renormalises to sum to 1.
}
\details{
Geometric pooling has two desirable properties for soil-class
priors:
\enumerate{
  \item externally Bayesian (the pooled posterior under any common
        likelihood matches what one would get by individual
        updates), and
  \item zero-preserving: a class assigned probability 0 by any
        prior is suppressed in the pooled distribution. To avoid
        that, classes absent from a given prior are imputed with
        the smoothing constant \code{epsilon}.
}
}
