View source: R/shift-distributions.R
| plot.rate_distribution_fit | R Documentation |
Plot a fitted candidate distribution from fit_rate_distribution(). The
current method supports the Gumbel candidate used by Berv et al. (2026). It
can overlay a pointwise bootstrap band and bootstrap density curves when
bootstrap_rate_distribution() has already stored bootstrap draws on x.
## S3 method for class 'rate_distribution_fit'
plot(
x,
model = c("gumbel"),
bootstrap = NULL,
bootstrap_curves = 120L,
col = "#b01f2e",
hist_col = "grey90",
band_alpha = 0.14,
curve_alpha = 0.08,
data_density = TRUE,
rug = TRUE,
breaks = "FD",
main = NULL,
xlab = NULL,
ylab = "Density",
...
)
x |
A |
model |
Distribution model to plot. Currently only |
bootstrap |
|
bootstrap_curves |
Number of precomputed bootstrap density curves to
draw over the band. Set to |
col |
Color for the fitted density, bootstrap band, and bootstrap curves. |
hist_col |
Histogram fill color. A vector of colors is passed through
to |
band_alpha, curve_alpha |
Alpha values for the bootstrap band and individual bootstrap curves. |
data_density |
Logical; overlay the empirical kernel density. |
rug |
Logical; add a rug for the fitted data values. |
breaks |
Histogram breaks passed to |
main, xlab, ylab |
Plot labels. |
... |
Additional arguments passed to |
Invisibly returns a list with the x grid, fitted density, bootstrap densities, bootstrap band, and plotted parameter table.
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)
plot(fit, bootstrap_curves = 5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.