tableFit_gb2: Fits parametric distribution functions of the family...

Description Usage Arguments Value

View source: R/tableFit.R

Description

A wrapper function for fitting distribution functions (pdf, cdf, quantile function, and Lorenz Curve) to binned data (edged and counts) using parametric interpolations using the GB2 distributions. See the package binequality.

Usage

1
2
3
4
5
6
7
tableFit_gb2(
  incomeTable,
  modelsToFit = c("GB2", "GG", "BETA2", "DAGUM", "SINGMAD", "LOGNO", "WEI", "GA",
    "LOGLOG", "PARETO2"),
  obs_mean = NULL,
  grid_quantile = NULL
)

Arguments

incomeTable

A data.frame with 3 columns: N (the proportion or number of observations at the bin); lower (left endpoints of each bin); upper (right endpoints of each bin)

modelsToFit

A character vector with the names of the distributions to be fitted: "GB2", "GG", "BETA2", "DAGUM", "SINGMAD", "LOGNO", "WEI", "GA", "LOGLOG", "PARETO2". As a default, all the 10 distributions are adjusted to the data and then, using the BIC statistic, the best one is chosen.

obs_mean

The observed mean value of the binned distribution, if available.

grid_quantile

A NIGrid object created by createNIGrid (package mvQuad) indicating how precise the numerical integration of the quantile function should be. The integration of the quantile function is used to generate the Lorenz Curve

Value

Returns a list with the following components

\descriptive

A tibble with four columns: distribution (the name of the distribution fitted), estMean (the distribution mean), gini (the Gini Coefficient, if gini = TRUE, NA otherwise), endpoint (the right-hand endpoint of the support of the PDF) \pdf The PDF function. Takes values as input and returns probability densities. \cdf The CDF function. Takes values as input and returns cumulative probabilities. \quantile The Quantile function. Takes cumulative probabilities as input and returns quantile values as outputs. \lorenz The Lorenz Curve function. Takes cumulative probabilities as input and returns the proportion of income accumulated at the quantile.


antrologos/inequalityTools documentation built on May 23, 2021, 11:56 a.m.