Learn R Programming

pbox (version 0.1.8)

fit_dist_pbox: 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 ANY fit_dist_pbox(data, ...)

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.

Arguments

data

A data frame or data table.

...

Additional parameters to pass to the fitting function.

Examples

Run this code
  data(SEAex)
  distFits <- fit_dist_pbox(data=SEAex)
  print(distFits$allDitrs)
  print(distFits$distTable)

Run the code above in your browser using DataLab