get.dist: Find the best-fit distribution

View source: R/get.dist.R

get.distR Documentation

Find the best-fit distribution

Description

Identifies the best-fit distribution for a numeric vector, by AIC among the supported families.

Usage

get.dist(data, my_env)

Arguments

data

Input dataset.

my_env

Environment object.

Value

...

Fits several candidate distributions via MLE and selects the model with the lowest (finite) AIC. For strictly positive data, tail-sensitive families are also tried. If a triangular fit narrowly wins (Delta AIC <= 10 over a tail model, prefer the tail model (helps avoid spurious triangular wins on mildly skewed data).

Returns a list with: - distr: best model name (e.g., "gamma", "weibull", "triangle", ...) - params: named parameter vector for the best model - aic: named numeric vector of AICs for all attempted models (NA if failed) - fits_ok: named logical vector (TRUE where fit succeeded) - messages:named list of diagnostic messages per model (errors/warnings)


stratifyR documentation built on Nov. 13, 2026, 9:06 a.m.