bridge: Bridge Function to Obtain Normalising Constant

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/bridge.R

Description

Returns the normalising constant, given posterior model densities, q1(.), normalised densities, q2(.) and their ratios, l(.), from both unnormailised (w1) and normalised samples (w2) of parameter values. All three of these input measures can be obtained from each sample using the q1q2l function.

Usage

1
bridge(w1, w2, r0, tol, verbose = FALSE)

Arguments

w1

A data.frame generated from q1q2l using simulations from an unnormalised probability density function. Should have three columns with values named q1 (for the posterior model density function), q2 (for the normalised probability density function) and l (the ratio of q1 and q2).

w2

A data.frame generated from q1q2l using simulations from an normalised probability density function. Should have three columns with values named q1 (for the posterior model density function), q2 (for the normalised probability density function) and l (the ratio of q1 and q2).

r0

Starting value for the calculation of the normalising constant.

tol

Tolerance level for convergence.

verbose

Print sample sizes of w1 and w2 (s_1 and s_2 in Meng and Wong (1996)).

Details

Provides an iterative solution to estimate the normalising constant, following equation (4.1) in Meng and Wong (1996). We adapted their equation slightly to deal with overflow (exponentiating large numbers).

Value

See Details.

Note

Adaption for overflow based on method suggested by Jon Forster.

Author(s)

Guy J. Abel

References

Abel, G.J., Bijak, J., Forster, J.J., Raymer J., Smith P.W.F. and Wong, J.S.T. (2013) Integrating uncertainty in time series population forecasts: An illustration using a simple projection model. Demographic Research. 29 43 1187-1226 doi:10.4054/DemRes.2013.29.43

Meng, X.-L., & Wong, W. H. (1996). Simulating Ratios of Normalizing Constants via a Simple Identity: A Theoretical Exploration. Statistica Sinica, 6, 831-860.

Examples

1
2
3
4
5
6
## Not run: 
# demo example with constant variance models for differenced growth rate
# of England and Wales population as used in Abel et. al. (2013)
demo("cv_bma", "tsbridge")

## End(Not run)

tsbridge documentation built on May 30, 2017, 1:14 a.m.