prior.likewts: Prior likelihoods and weights

Description Usage Arguments Value Note References See Also Examples

View source: R/prior.likewts.R

Description

Calculates the log-likelihood and importance weight for each set (i.e. each row) of Heligman-Pollard parameters in the prior

Usage

1
2
prior.likewts(prior, nrisk, ndeath, theta.dim = 8, 
age = c(1e-05, 1, seq(5, 100, 5)))

Arguments

prior

A (theta.dim*1000) x theta.dim matrix containing the prior distribution

nrisk

A vector containing the number of persons at risk in each age group

ndeath

A vector containing the number of deaths in each age group

theta.dim

Number of columns of the prior matrix. Defaults to 8

age

A vector containing the ages at which each age interval begins

Value

wts.0

A vector containing an importance weight for each set of parameters from the prior

log.ilke.0

A vector containing a log likelihood for each set of parameters from the prior

Note

Used in the loop.optim function

References

Heligman, Larry and John H. Pollard. 1980 "The Age Pattern of Mortality." Journal of the Institute of Actuaries 107:49–80.

Poole, David and Adrian Raftery. 2000. "Inference for Deterministic Simulation Models: The Bayesian Melding Approach." Journal of the American Statistical Association 95:1244–1255.

Raftery, Adrian and Le Bao. 2009. "Estimating and Projecting Trends in HIV/AIDS Gen- eralized Epidemics Using Incremental Mixture Importance Sampling." Technical Report 560, Department of Statistics, University of Washington.

See Also

loop.optim, hp.bm.imis

Examples

1
2
3
4
5
6
7
8
9
lx <- c(1974, 1906, 1860, 1844, 1834, 1823, 1793, 1700, 1549, 1361, 
1181, 1025, 870, 721, 571, 450, 344, 256, 142, 79, 41, 8)
dx <- c(68, 47, 16, 10, 13, 29, 92, 151, 188, 179, 156, 155, 147, 150, 
122, 106, 88, 113, 63, 38, 32, 8)
age <- c(1e-05, 1, seq(5, 85, 5))
q0 <- prior.form()
result <- prior.likewts(prior=q0, nrisk=lx, ndeath=dx, age=age)
summary(result$wts.0)
summary(result$log.like.0)

HPbayes documentation built on May 2, 2019, 5:53 a.m.