| compare_dists | R Documentation |
Fits one or more parametric distributions to a numeric vector and returns
an ordered ranking table without producing a plot or a full fitverse
object. Use this function when you want a quick tabular comparison and
do not need the fitted-object infrastructure.
compare_dists(x,
dists = "all",
method = "MLE",
criterion = "AIC",
xlab = "x",
verbose = TRUE)
x |
A numeric vector of observations. Non-finite values are removed automatically before fitting. |
dists |
Character vector of distribution keys, or |
method |
Character vector: one or more of |
criterion |
|
xlab |
Character: a label for the data variable, passed through to any
downstream functions. Default |
verbose |
Logical: print progress messages? Default |
compare_dists() calls the same internal fitting engine as
fitverse() but skips GoF test computation, data-summary
computation, and plotting. It is therefore faster and better suited to
exploratory screening of many distributions or methods.
The returned data frame can be used directly with kable
or datatable for reporting.
A data frame with one row per distribution-method combination, ordered by the chosen information criterion (ascending), with columns:
Integer rank (1 = best).
Full distribution name.
Estimation method ("MLE", "MOM", or "LMOM").
Number of free parameters.
Maximised log-likelihood.
Akaike Information Criterion.
AIC difference relative to the best model.
Bayesian Information Criterion.
BIC difference relative to the best model.
Logical: did the optimiser converge?
Internal distribution key (character).
Karuna G. Reddy karuna.reddy@auckland.ac.nz
M. G. M. Khan mgm.khan@usp.ac.fj
fitverse for a full fitted object plus diagnostic plot.
set.seed(1)
x <- rgamma(200, shape = 3, rate = 0.5)
tbl <- compare_dists(x,
dists = c("gamma", "lognormal", "weibull", "exponential"),
method = "MLE",
verbose = FALSE)
head(tbl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.