pri.mle: Heligman-Pollard parameter prior formation for use with...

Description Usage Arguments Details Value References See Also Examples

View source: R/pri.mle.R

Description

Forms a prior distribution (drawn from a uniform distribution) for each of the eight Heligman-Pollard parameters. First, using optim(), mle estimates of the parameters are fitted to the deaths and persons at risk supplied by the user. Once these estimates (returned as mle) and their standard errors (se) are obtained, 8000 (See documentation for prior.form) draws from a uniform distribution with bounds mle[i] +/- senum*se are taken to form a prior distribution for each parameter.

Usage

1
2
3
4
5
pri.mle(nrisk, ndeath, age = c(0, 1, seq(5, 100, 5)), 
lo = c(1e-08, 1e-07, 1e-07, 1e-07, 1e-07, 15, 1e-07, 1), 
hi = c(1, 1, 1, 0.5, 15, 55, 0.1, 1.5), senum = 15, 
theta.test = c(0.06008, 0.31087, 0.34431, 0.00698, 1.98569,
26.71071, 0.00022, 1.088), opt.meth = "Nelder-Mead")

Arguments

nrisk

The number of persons at risk of death in each age group

ndeath

The number of deaths in each age group

age

A vector containing the ages at which probabilities of death are calculated

lo

If opt.meth="L-BFGS", this vector contains the lower bounds in lower argument of optim() )

hi

If opt.meth="L-BFGS", this vector contains the upper bounds in upper argument of optim() )

senum

The number of standard errors on each side of the mle estimate. This argument controls how wide or narrow the uniform distribution is from which the prior distribution will be drawn.

theta.test

Start values for optim. The defaults encompass the Brass standard (Rogers and McKnown 1989).

opt.meth

The same as method in opim().

Details

Priors drawn with this function can be used with the function hp.bm.imis or other functions from the HPbayes package.

Value

q0

A matrix containing the prior distibution with each column corresponding to one of the Heligman-Pollard parameters

mle

A vector containing the mle estimates. These define the center of each uniform from which the prior was drawn

se.out

A vector containing the standard error for each element of mle

pri.lo

The lower bounds on the uniform distributions from which the prior for each parameter is drawn

pri.hi

The upper bounds on the uniform distributions from which the prior for each parameter is drawn

References

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

See Also

hp.bm.imis, optim

Examples

1
2
3
data(HPprior) ##loads a vector of persons at risk (lx) and deaths (dx)
prior <- pri.mle(nrisk=lx, ndeath=dx)
summary(prior$q0)

Example output

Loading required package: MASS
Loading required package: mvtnorm
Loading required package: corpcor
Loading required package: numDeriv
Loading required package: boot
       V1                  V2                  V3                  V4         
 Min.   :0.0001302   Min.   :0.0000444   Min.   :0.0003276   Min.   :0.06964  
 1st Qu.:0.2502558   1st Qu.:0.2502829   1st Qu.:0.2506613   1st Qu.:0.11589  
 Median :0.4968367   Median :0.4929713   Median :0.4982379   Median :0.16159  
 Mean   :0.5002196   Mean   :0.4992367   Mean   :0.4988832   Mean   :0.16128  
 3rd Qu.:0.7541943   3rd Qu.:0.7578645   3rd Qu.:0.7487897   3rd Qu.:0.20659  
 Max.   :0.9998715   Max.   :0.9999158   Max.   :0.9998900   Max.   :0.25220  
       V5                 V6              V7                  V8       
 Min.   :0.000495   Min.   :17.87   Min.   :1.089e-07   Min.   :1.115  
 1st Qu.:1.390932   1st Qu.:27.27   1st Qu.:3.977e-05   1st Qu.:1.129  
 Median :2.732871   Median :36.67   Median :7.860e-05   Median :1.143  
 Mean   :2.749613   Mean   :36.48   Mean   :7.853e-05   Mean   :1.143  
 3rd Qu.:4.116821   3rd Qu.:45.65   3rd Qu.:1.185e-04   3rd Qu.:1.157  
 Max.   :5.478265   Max.   :54.99   Max.   :1.555e-04   Max.   :1.172  

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