fit_dist_pbox {pbox} | R Documentation |
Fit Marginal Distributions
Description
Fits the best marginal distribution for each variable in a data frame using the 'gamlss::fitDist' function from the GAMLSS package. This function is designed to evaluate multiple distributions, returning a summary of fit for each, along with the Akaike Information Criterion (AIC) for comparison.
Implements the generic function 'fit_dist_pbox' for data frames and data tables. This method utilizes statistical techniques to fit distributions to each column in the 'data' argument, evaluating fit using criteria like AIC to determine the best fitting model.
Usage
fit_dist_pbox(data, ...)
## S4 method for signature 'ANY'
fit_dist_pbox(data, ...)
Arguments
data |
A data frame or data table. |
... |
Additional parameters to pass to the fitting function. |
Value
A list containing two elements:
allDitrs |
List of the fitted distributions for each variable. |
distTable |
A data table displaying the AIC for each tested distribution. |
Examples
data(SEAex)
distFits <- fit_dist_pbox(data=SEAex)
print(distFits$allDitrs)
print(distFits$distTable)