temper {bspec}R Documentation

Tempering of (posterior) distributions


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


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



a bspec object.


a (positive) ‘temperature’ value.


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


currently unused.


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 1/T either to the complete posterior distribution:

p_T(theta) ~ p(theta|y)^(1/T) = (p(y|theta)*p(theta))^(1/T)

or to the likelihood part only:

p_T(theta) ~ p(theta|y)^(1/T) * p(theta).

In this context, where the posterior distribution is a product of scaled inverse chi-squared 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.


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


Tempering with the likelihood.only flag set to FALSE only works as long as the temperature is less than min((x$df+2)/2).


Christian Roever, christian.roever@med.uni-goettingen.de


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


lhspec <- bspec(lh, priorscale=0.6, priordf=1)

# details of the regular posterior distribution:

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

[Package bspec version 1.5 Index]