View source: R/shift-distributions.R
| bootstrap_rate_distribution | R Documentation |
Precompute parametric bootstrap parameter draws for a fitted rate
distribution. This keeps stochastic uncertainty estimation out of the plotting
method while preserving the bootstrap draws on the returned
rate_distribution_fit object.
bootstrap_rate_distribution(
x,
model = NULL,
reps = 1000L,
seed = NULL,
kl = NULL
)
x |
A |
model |
Distribution model to bootstrap. If |
reps |
Number of bootstrap parameter draws. |
seed |
Optional random seed for the bootstrap draw. The previous global RNG state is restored after the bootstrap when a seed is supplied. |
kl |
|
For Gumbel fits, the default kl = NULL also computes the
Kullback-Leibler divergence between the empirical kernel density of the
fitted data and the fitted Gumbel density, then repeats that calculation for
each bootstrap parameter draw. Extract the compact diagnostic table with
as.data.frame(x, component = "goodness").
A rate_distribution_fit object with a
rate_distribution_bootstrap entry stored in x$bootstrap[[model]].
The entry contains the model name, number of draws, seed, and parameter
matrix returned by univariateML::bootstrapml(). For Gumbel fits, the
entry also stores a bootstrapped Kullback-Leibler divergence summary unless
kl = FALSE.
if (requireNamespace("univariateML", quietly = TRUE) &&
requireNamespace("evd", quietly = TRUE)) {
fit <- fit_rate_distribution(c(1, 1.4, 1.9, 2.8, 4.1, 6.5), models = "gumbel")
fit <- bootstrap_rate_distribution(fit, model = "gumbel", reps = 25, seed = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.