ti: Thermodynamic integration

View source: R/ti.R

tiR Documentation

Thermodynamic integration

Description

This function produces a thermodynamic integration estimate of the marginal likelihood given a set of log-likelihood values at different temperatures.

Usage

ti(x, actPlot = FALSE, temp = NULL)

Arguments

x

A data frame with the folloging columns: logL and invTemp, which contain the log-likelihood and inverse temperature values, respectively.

actPlot

If it is TRUE, the function plots the temperatures against the log-likelihood means at the different temperatures.

temp

It indicates the temperatures to be used in the analysis, for instance, c(1,3,K) considers the temperatures at those positions, where K is the number of temperatures. In this case, the temperatures must be sorted in an increasing order. Note that samples from the prior and posterior must be included in the process. "NULL" stands for all the temperatures in x.

Details

Power posterior methods, among them thermodynamic integration, rely on a set of samples from different transitional distributions, connecting the prior and the posterior distributions, which is defined by the power posterior density

p(θ) \propto L(x|θ)^{β} π(θ),

where θ is the parameter vector, 0 ≤ β ≤ 1 is the inverse temperature, x is the data, p(θ) is the power posterior density, L(x|θ) is the likelihood function, and π(θ) is the prior density. ti uses the trapezoidal rule in the estimation (see more details in Lartillot and Philippe (2006)).

Value

Thermodynamic integration estimate (numeric value), and an optional plot

Author(s)

Patricio Maturana Russel p.russel@auckland.ac.nz

References

Lartillot, N., and Philippe, H. 2006. Computing Bayes factors using Thermodynamic Integration. Systematic Biology 55(2), 195–207.

Examples

## Not run: 
data(ligoVirgoSim)
ti(ligoVirgoSim, actPlot = TRUE, temp = NULL)

## End(Not run)

pmat747/powModSel documentation built on Aug. 1, 2022, 1:07 p.m.