| abc_resample | R Documentation |
Performs ABC inference with resampling to assess stability and uncertainty. Each iteration draws a random sample from the simulation pool and runs ABC, producing multiple posterior estimates for comparison.
abc_resample(
target,
param,
sumstat,
n_iterations,
n_samples,
replace = FALSE,
...
)
target |
Target summary statistics from observed data |
param |
Parameter values matrix or data frame |
sumstat |
Summary statistics matrix or data frame |
n_iterations |
Number of resample iterations |
n_samples |
Number of samples to draw in each iteration |
replace |
Logical, whether to sample with replacement (default FALSE) |
... |
Additional arguments passed to abc_abc |
A list of length n_iterations, where each element is an object
of class abc returned by abc. Each list element
contains the ABC posterior for one bootstrap iteration, allowing assessment
of stability and uncertainty in parameter estimates.
# Load ABC input data from example simulation
abc_input <- readRDS(
system.file("extdata", "rdm_minimal", "abc", "abc_input.rds", package = "eam")
)
# Perform ABC resampling
results <- abc_resample(
target = abc_input$target,
param = abc_input$param,
sumstat = abc_input$sumstat,
n_iterations = 2,
n_samples = 2,
tol = 0.5,
method = "rejection"
)
# check the abc results
str(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.