Generates bootstrap samples from a fitted parametric distribution
rather than from the empirical sample. Delegates to
boot::boot(sim = "parametric") when boot is installed;
otherwise uses an inline rnorm/rpois/rbinom/rexp/rgamma loop.
Usage
parametric_bootstrap(
data,
statistic,
distribution = "normal",
n_boot = 2000L,
ci_level = 0.95,
seed = 42L,
...
)Arguments
- data
Original numeric data (used to fit the distribution).
- statistic
Function returning a scalar.
- distribution
One of
"normal","poisson","binomial","exponential","gamma".- n_boot
Number of replicates.
- ci_level
Confidence level.
- seed
Random seed.
- ...
Distribution-specific parameters (mu, sigma, lam, p, scale, shape).