Learn R Programming

GLDEX (version 2.0.0.9.3)

Fitting Single and Mixture of Generalised Lambda Distributions

Description

The fitting algorithms considered in this package have two major objectives. One is to provide a smoothing device to fit distributions to data using the weight and unweighted discretised approach based on the bin width of the histogram. The other is to provide a definitive fit to the data set using the maximum likelihood and quantile matching estimation. Other methods such as moment matching, starship method, L moment matching are also provided. Diagnostics on goodness of fit can be done via qqplots, KS-resample tests and comparing mean, variance, skewness and kurtosis of the data with the fitted distribution. References include the following: Karvanen and Nuutinen (2008) "Characterizing the generalized lambda distribution by L-moments" , King and MacGillivray (1999) "A starship method for fitting the generalised lambda distributions" , Su (2005) "A Discretized Approach to Flexibly Fit Generalized Lambda Distributions to Data" , Su (2007) "Nmerical Maximum Log Likelihood Estimation for Generalized Lambda Distributions" , Su (2007) "Fitting Single and Mixture of Generalized Lambda Distributions to Data via Discretized and Maximum Likelihood Methods: GLDEX in R" , Su (2009) "Confidence Intervals for Quantiles Using Generalized Lambda Distributions" , Su (2010) "Chapter 14: Fitting GLDs and Mixture of GLDs to Data using Quantile Matching Method" , Su (2010) "Chapter 15: Fitting GLD to data using GLDEX 1.0.4 in R" , Su (2015) "Flexible Parametric Quantile Regression Model" , Su (2021) "Flexible parametric accelerated failure time model".

Copy Link

Version

Install

install.packages('GLDEX')

Monthly Downloads

428

Version

2.0.0.9.3

License

GPL (>= 3)

Maintainer

Steve Su

Last Published

August 21st, 2023

Functions in GLDEX (2.0.0.9.3)

fun.RMFMKL.qs

Fit FMKL generalised lambda distribution to data set using quantile matching
fun.RMFMKL.lm

Fit FMKL generalised lambda distribution to data set using L moment matching
fun.RPRS.hs.nw

Fit RS generalised distribution to data using discretised approach without weights.
fun.RPRS.lm

Fit RS generalised lambda distribution to data set using L moment matching
fun.RPRS.ml

Fit RS generalised lambda distribution to data set using maximum likelihood estimation
fun.RPRS.ml.m

Fit RS generalised lambda distribution to data set using maximum likelihood estimation
fun.RMFMKL.ml.m

Fit RS generalised lambda distribution to data set using maximum likelihood estimation
fun.RMFMKL.mm

Fit FMKL generalised lambda distribution to data set using moment matching
fun.RMFMKL.ml

Fit FMKL generalised lambda distribution to data set using maximum likelihood estimation
fun.RPRS.hs

Fit RS generalised distribution to data using discretised approach with weights.
fun.beta

This is a collection of functions used in the calculation of the beta function.
fun.RPRS.mm

Fit RS generalised lambda distribution to data set using moment matching
fun.auto.bimodal.ml

Fitting mixture of generalied lambda distribtions to data using maximum likelihood estimation via the EM algorithm
fun.auto.bimodal.qs

Fitting mixtures of generalied lambda distribtions to data using quantile matching method
fun.bimodal.fit.ml

Finds the final fits using the maximum likelihood estimation for the bimodal dataset.
fun.data.fit.mm

Fit data using moment matching estimation for RS and FMKL GLD
fun.bimodal.fit.pml

Finds the final fits using partition maximum likelihood estimation for the bimodal dataset.
fun.bimodal.init

Finds the initial values for optimisation in fitting the bimodal generalised lambda distribution.
fun.RPRS.qs

Fit RS generalised lambda distribution to data set using quantile matching
fun.auto.bimodal.pml

Fitting mixture of generalied lambda distribtions to data using parition maximum likelihood estimation
fun.check.gld

Check whether the RS or FMKL/FKML GLD is a valid GLD for single values of L1, L2, L3 and L4
fun.comp.moments.ml.2

Compare the moments of the data and the fitted univariate generalised lambda distribution. Specialised funtion designed for RMFMKL.ML and STAR methods.
fun.data.fit.hs.nw

Fit RS and FMKL generalised distributions to data using discretised approach without weights.
fun.data.fit.hs

Fit RS and FMKL generalised distributions to data using discretised approach with weights.
fun.data.fit.qs

Fit data using quantile matching estimation for RS and FMKL GLD
fun.comp.moments.ml

Compare the moments of the data and the fitted univariate generalised lambda distribution.
fun.lm.theo.gld

Find the theoretical first four L moments of the generalised lambda distribution.
fun.minmax.check.gld

Check whether the specified GLDs cover the minimum and the maximum values in a dataset
fun.mApply

Applying functions based on an index for a matrix.
fun.plot.fit

Plotting the univariate generalised lambda distribution fits on the data set.
fun.diag.ks.g

Compute the simulated Kolmogorov-Smirnov tests for the unimodal dataset
fun.plot.fit.bm

Plotting mixture of two generalised lambda distributions on the data set.
fun.check.gld.multi

Check whether the RS or FMKL/FKML GLD is a valid GLD for vectors of L1, L2, L3 and L4
fun.moments.bimodal

Finds the moments of fitted mixture of generalised lambda distribution by simulation.
fun.zero.omit

Returns a vector after removing all the zeros.
Optimisation functions

This is a collection of functions used in the optimisation processes for all the fitting methods covered in this package.
fun.rawmoments

Computes the raw moments of the generalised lambda distribution up to 4th order.
fun.plot.many.gld

Plotting many univariate generalised lambda distributions on one page.
is.notinf

Returns a logical vector TRUE, if the value is not Inf or -Inf.
fun.diag.ks.g.bimodal

Compute the simulated Kolmogorov-Smirnov tests for the bimodal dataset
gl.check.lambda.alt

Checks whether the parameters provided constitute a valid generalised lambda distribution.
fun.gen.qrn

Finds the low discrepancy quasi random numbers
fun.class.regime.bi

Classifies data into two groups using a clustering regime.
fun.disc.estimation

Estimates the mean and variance after cutting up a vector of variable into evenly spaced categories.
fun.diag1

Diagnostic function for theoretical distribution fits through the resample Kolmogorov-Smirnoff tests
ks.gof

Kolmogorov-Smirnov test
fun.data.fit.lm

Fit data using L moment matching estimation for RS and FMKL GLD
is.inf

Returns a logical vecto, TRUE if the value is Inf or -Inf.
histsu

Histogram with exact number of bins specified by the user
fun.data.fit.ml

Fit data using RS, FMKL maximum likelihood estimation and the FMKL starship method.
fun.theo.mv.gld

Find the theoretical first four moments of the generalised lambda distribution.
starship.obj

Objective function that is minimised in starship estimation method
starship.adaptivegrid

Carry out the ``starship'' estimation method for the generalised lambda distribution using a grid-based search
fun.moments.r

Calculate mean, variance, skewness and kurtosis of a numerical vector
fun.which.zero

Determine which values are zero.
gl.check.lambda.alt1

Checks whether the parameters provided constitute a valid generalised lambda distribution.
fun.nclass.e

Estimates the number of classes or bins to smooth over in the discretised method of fitting generalised lambda distribution to data.
fun.simu.bimodal

Simulate a mixture of two generalised lambda distributions.
fun.theo.bi.mv.gld

Calculates the theoretical mean, variance, skewness and kurtosis for mixture of two generalised lambda distributions.
Hidden basic functions

This is a collection of functions designed to implement the basic GLD functions.
t1lmoments

Trimmed L-moments
which.na

Determine Missing Values
skewness and kurtosis

Compute skewness and kurtosis statistics
fun.diag2

Diagnostic function for empirical data distribution fits through the resample Kolmogorov-Smirnoff tests
pretty.su

An alternative to the normal pretty function in R.
qqplot.gld

Do a quantile plot on the univariate distribution fits.
starship

Carry out the ``starship'' estimation method for the generalised lambda distribution
qqplot.gld.bi

Do a quantile plot on the bimodal distribution fits.
GLD functions

The Generalised Lambda Distribution Family
Fitting functions

This is a collection of functions designed to implement the fitting algorithms for all the methods covered in this package.
fun.RMFMKL.hs.nw

Fit FMKL generalised distribution to data using discretised approach without weights.
Lmoments

L-moments
fun.RMFMKL.hs

Fit FMKL generalised distribution to data using discretised approach with weights.
RS fitting and basic functions

This is a collection of functions designed to find the initial values of method of moments for RS generalised lambda distribution. It also includes basic RS GLD functions.
FMKL fitting and basic functions

This is a collection of functions designed to find the initial values under the method of moments for FMKL generalised lambda distribution. It also includes basic FMKL GLD functions.
QUnif

Quasi Randum Numbers via Halton Sequences
digitsBase

Digit/Bit Representation of Integers in any Base
GLDEX-package

This package fits RS and FMKL generalised lambda distributions using various methods. It also provides functions for fitting bimodal distributions using mixtures of generalised lambda distributions.