JackKnifeAcc: Calculation of JeckKnife acceleration parameter for BCA...

Description Usage Arguments Author(s) References Examples

Description

Calculation of JeckKnife acceleration parameter for BCA method.

Internal function

Usage

1
JackKnifeAcc(JackKnifeMat, dx)

Arguments

JackKnifeMat

JackKnife matrix with one row per each considered pash measure. See JackKnife_dx.

dx

A vector with integer counts (deaths).

Author(s)

Maciej J. Danko <danko@demogr.mpg.de> <maciej.danko@gmail.com>

References

Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York: Chapman & Hall. Page 186.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ************************** REMOVE THIS ******************************
# Some functions will not work as they are not in the namespace
# Before integrating with pash please add "pash:::" in front of them. 
# To test them just run all functions in the bootpash.r 
# ***************************** END ***********************************
## Not run: 

#Get some data
population.size <- 10000
obj <- Inputlx(x = australia_10y$x, lx = australia_10y$lx,nax = australia_10y$nax, nx = australia_10y$nx, last_open = TRUE)
dx <- lx2dx(round(object$lt$lx*population.size))
x <- obj$lt$x

#Acceleration parameters calculated by slow method:
times <- dx2age(dx,x)
gp <- function(times, x, pash.parent) getpash(dx = age2dx(times = times, x=x), x=x, pash.parent = pash.parent)
J1 <- as.matrix(sapply(seq_along(times), function(k) gp(times = times[-k], x = x, pash.parent = obj)))
a.slow <- JackKnifeAcc(J1)

#Acceleration parameters calculated by fast method:
J2 <- JackKnife_dx(dx = org.dx, x = org.x, pash.parent = obj)
a.fast <- JackKnifeAcc(J2,dx)

#Compare results
cbind(a.slow = a.slow, a.fast = a.fast, diff = round(a.slow - a.fast, 12))


## End(Not run)

MaciejDanko/BootstrapLT documentation built on May 14, 2019, 2:40 p.m.