A marginal likelihood is a likelihood function that has been integrated over the parameter space. In Bayesian statistics, it represents the probability of generating the observed sample for all possible values of the parameters; it can be understood as the probability of the model itself and is therefore often referred to as model evidence or simply evidence. Due to the integration over the parameter space, the marginal likelihood does not directly depend upon the parameters. If the focus is not on model comparison, the marginal likelihood is simply the normalizing constant that ensures that the posterior is a proper probability. It is related to the partition function in statistical mechanics.
Concept Given a set of independent identically distributed data points X = ( x 1 , … , x n ) , {\displaystyle \mathbf {X} =(x_{1},\ldots ,x_{n}),} where x i ∼ p ( x | θ ) {\displaystyle x_{i}\sim p(x|\theta )} according to some probability distribution parameterized by θ {\displaystyle \theta } , where θ {\displaystyle \theta } itself is a random variable described by a distribution, i.e. θ ∼ p ( θ ∣ α ) , {\displaystyle \theta \sim p(\theta \mid \alpha ),} the marginal likelihood in general asks what the probability p ( X ∣ α ) {\displaystyle p(\mathbf {X} \mid \alpha )} is, where θ {\displaystyle \theta } has been marginalized out (integrated out):
p ( X ∣ α ) = ∫ θ p ( X ∣ θ ) p ( θ ∣ α ) d θ {\displaystyle p(\mathbf {X} \mid \alpha )=\int _{\theta }p(\mathbf {X} \mid \theta )\,p(\theta \mid \alpha )\ \operatorname {d} \!\theta }
The above definition is phrased in the context of Bayesian statistics in which case p ( θ ∣ α ) {\displaystyle p(\theta \mid \alpha )} is called prior density and p ( X ∣ θ ) {\displaystyle p(\mathbf {X} \mid \theta )} is the likelihood. Recognizing that the marginal likelihood is the normalizing constant of the Bayesian posterior density p ( θ ∣ X , α ) {\displaystyle p(\theta \mid \mathbf {X} ,\alpha )} , one also has the alternative expression
p ( X ∣ α ) = p ( X ∣ θ , α ) p ( θ ∣ α ) p ( θ ∣ X , α ) {\displaystyle p(\mathbf {X} \mid \alpha )={\frac {p(\mathbf {X} \mid \theta ,\alpha )p(\theta \mid \alpha )}{p(\theta \mid \mathbf {X} ,\alpha )}}}
which is an identity in θ {\displaystyle \theta } . The marginal likelihood quantifies the agreement between data and prior in a geometric sense made precise via Hilbert spaces in de Carvalho et al. (2019). In classical (frequentist) statistics, the concept of marginal likelihood occurs instead in the context of a joint parameter θ = ( ψ , λ ) {\displaystyle \theta =(\psi ,\lambda )} , where ψ {\displaystyle \psi } is the actual parameter of interest, and λ {\displaystyle \lambda } is a non-interesting nuisance parameter. If there exists a probability distribution for λ {\displaystyle \lambda } , it is often desirable to consider the likelihood function only in terms of ψ {\displaystyle \psi } , by marginalizing out λ {\displaystyle \lambda } :
L ( ψ ; X ) = p ( X ∣ ψ ) = ∫ λ p ( X ∣ λ , ψ ) p ( λ ∣ ψ ) d λ {\displaystyle {\mathcal {L}}(\psi ;\mathbf {X} )=p(\mathbf {X} \mid \psi )=\int _{\lambda }p(\mathbf {X} \mid \lambda ,\psi )\,p(\lambda \mid \psi )\ \operatorname {d} \!\lambda }
… excerpt ends here. Continue reading the full article.

