boot_jaatha {jaatha} | R Documentation |
Parametric Bootstrapping of Jaatha Estimates
Description
This function is a helper function for using the boot
function to bootstrap Jaatha estimates. Each bootstap replication requires
a complete jaatha estimation on data simulated with the original parameter
estimates. Therefore, bootstrapping is normally computationally demanding and
should be executed on a computing cluster.
Usage
boot_jaatha(results, R, cores_per_run = 1, verbose = TRUE, ...)
Arguments
results |
The results of an |
R |
The number of bootstrapping replicates that are performed. |
cores_per_run |
The number of cores that are used for each replicate.
This corresponds to the |
verbose |
If TRUE (default), each bootstrap estimation is written as a message. |
... |
Additional arguments that are passed on |
Value
The result of boot
. This object can be used to
estimate standard errors or confidence intervals of the estimates using
the functions available in package boot.
Note that the returned object contains a vector of parameter values t0
that is the result of an additional jaatha run for the original data, whereas
the parametric bootstrap simulations used parameter values that are in the vector
mle
in the returned boot
object.
By default, the function boot.ci
of the boot
package
uses the parameter values t0
as a reference point.
To use the values in mle
instead, overwrite t0
with mle
before
applying the function boot.ci
.
See Also
Examples
# The original Jaatha anaylsis:
model <- create_jaatha_model(function(x) rpois(10, x),
par_ranges = matrix(c(0.1, 0.1, 10, 10), 2, 2),
sum_stats = list(create_jaatha_stat("sum", sum)))
data <- create_jaatha_data(rpois(10, 9), model)
jaatha_result <- jaatha(model, data, cores = 2)
# Bootstrapping the results:
library(boot)
jaatha_boot_results <- boot_jaatha(jaatha_result, 50,
cores_per_run = 2)
boot.ci(jaatha_boot_results, type = "norm")
jaatha_boot_results$t0 <- jaatha_boot_results$mle
boot.ci(jaatha_boot_results, type = "norm")