# Posterior probability

Suppose that we have have scoring functions $f(\textbf{x})$ and $g(\textbf{x})$ for classifying an object as red or blue. These are based on linear discriminant analysis. So if $f(\textbf{x}) > g(\textbf{x})$, then the object is red. Why is the posterior probability that an object is red the following:

$$\frac{\exp(f(\textbf{x})}{\exp(f(\textbf{x}))+\exp(g(\textbf{x}))}$$

Why do we exponentiate the functions?

• Can you provide some references where the expression comes from? Are you doing Fischer LDA, or Canonical LDA? f and g cannot just be "some" scoring functions, otherwise the expression wouldn't be a valid probability. So please state the prior, the likelihood, as well as what f(x) is, or provide some references where the term occurs. – means-to-meaning Nov 4 '13 at 22:05
• You might also want to look at Gibbs measure and how the energy of a configuration and its probability are related. – Luca Mar 6 '14 at 11:59

The expression you give has the following canonical form, $$P(Y|X) = \frac{e^{\beta E(Y,X)}}{\sum_{Y}e^{\beta E(Y,X)}}$$ where $E(Y,X)$ the energy functions (what you referred to as scoring functions), are a measure of how plausible is to assign a sample $X$ the label $Y$. Under this transformation, one can give a probabilistic interpretation to finding the optimal label. Finding the $Y$ that minimizes the energy (inference) maximizes at the same time the likelihood.