Learn R Programming

bspec (version 1.6)

temper: Tempering of (posterior) distributions

Description

Setting the tempering parameter of (‘tempered’) bspec objects.

Usage

temper(x, ...)
  # S3 method for bspec
temper(x, temperature = 2, likelihood.only = TRUE, ...)

Arguments

x

a bspec object.

temperature

a (positive) ‘temperature’ value.

likelihood.only

a logical flag indicating whether to apply the tempering to the ‘complete’ posterior density, or to the likelihood only (default).

...

currently unused.

Value

An object of class bspec (see the help for the bspec function), but with an additional temperature element.

Details

In the context of Markov chain Monte Carlo (MCMC) applications it is often desirable to apply tempering to the distribution of interest, as it is supposed to make the distribution more easily tractable. Examples where tempering is utilised are simulated annealing, parallel tempering or evolutionary MCMC algorithms. In the context of Bayesian inference, tempering may be done by specifying a ‘temperature’ \(T\) and then manipulating the original posterior distribution \(p(\theta|y)\) by applying an exponent \(\frac{1}{T}\) either to the complete posterior distribution: $$p_T(\theta) \propto p(\theta|y)^\frac{1}{T}% = (p(y|\theta)p(\theta))^\frac{1}{T}$$ or to the likelihood part only: $$p_T(\theta) \propto p(y|\theta)^\frac{1}{T}p(\theta).$$ In this context, where the posterior distribution is a product of scaled inverse \(\chi^2\) distributions, the tempered distributions in both cases turn out to be again of the same family, just with different parameters. For more details see also the references.

References

Roever, C. Bayesian inference on astrophysical binary inspirals based on gravitational-wave measurements. PhD thesis, Department of Statistics, The University of Auckland, New Zealand, 2007.

See Also

temperature, bspec

Examples

Run this code
# NOT RUN {
lhspec <- bspec(lh, priorscale=0.6, priordf=1)

# details of the regular posterior distribution:
str(lhspec)

# details of the tempered distribution
# (note the differing scale and degrees-of-freedom):
str(temper(lhspec, 1.23))
# }

Run the code above in your browser using DataLab