Learn R Programming

nomiShape (version 1.0.0)

shape_aic: Fit Nominal Data to Theoretical Shapes Using AIC (Safe Exponential)

Description

Computes the multinomial log-likelihood of observed counts against four theoretical distributions (uniform, triangular, normal-like, and exponential/Pareto-like) and returns AIC and DeltaAIC values.

Usage

shape_aic(df, var, rate_exp = 0.7, eps = 1e-12)

Value

A data.frame with columns: Shape, AIC, DeltaAIC.

Arguments

df

A data.frame or tibble containing the nominal variable.

var

Character string giving the name of the nominal variable in df.

rate_exp

Numeric. Default exponential rate. Only used if tail not clearly exponential.

eps

Small numeric value added to probabilities to avoid log(0). Default is 1e-12.