Learn R Programming

GLDEX (version 2.0.0.9.4)

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

362

Version

2.0.0.9.4

License

GPL (>= 3)

Maintainer

Steve Su

Last Published

July 23rd, 2025

Functions in GLDEX (2.0.0.9.4)

fun.RPRS.ml

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

Fit RS 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.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.ml

Fit FMKL 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.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

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

Finds the initial values for optimisation in fitting the bimodal generalised lambda distribution.
fun.bimodal.fit.ml

Finds the final fits using the maximum likelihood estimation for the bimodal dataset.
fun.RPRS.qs

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

Finds the final fits using partition maximum likelihood estimation for the bimodal dataset.
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.auto.bimodal.qs

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

Fitting mixture of generalied lambda distribtions to data using maximum likelihood estimation via the EM algorithm
fun.RPRS.mm

Fit RS generalised lambda distribution to data set using moment matching
fun.beta

This is a collection of functions used in the calculation of the beta function.
fun.auto.bimodal.pml

Fitting mixture of generalied lambda distribtions to data using parition maximum likelihood estimation
fun.data.fit.lm

Fit data using L moment matching estimation for RS and FMKL GLD
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.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.mm

Fit data using moment matching estimation for RS and FMKL GLD
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.class.regime.bi

Classifies data into two groups using a clustering regime.
fun.moments.bimodal

Finds the moments of fitted mixture of generalised lambda distribution by simulation.
fun.minmax.check.gld

Check whether the specified GLDs cover the minimum and the maximum values in a dataset
fun.comp.moments.ml

Compare the moments of the data and the fitted univariate generalised lambda distribution.
fun.diag1

Diagnostic function for theoretical distribution fits through the resample Kolmogorov-Smirnoff tests
fun.diag2

Diagnostic function for empirical data distribution fits through the resample Kolmogorov-Smirnoff tests
fun.diag.ks.g

Compute the simulated Kolmogorov-Smirnov tests for the unimodal dataset
fun.diag.ks.g.bimodal

Compute the simulated Kolmogorov-Smirnov tests for the bimodal dataset
fun.disc.estimation

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

Find the theoretical first four L moments of the generalised lambda distribution.
fun.data.fit.ml

Fit data using RS, FMKL maximum likelihood estimation and the FMKL starship method.
fun.gen.qrn

Finds the low discrepancy quasi random numbers
fun.data.fit.qs

Fit data using quantile matching estimation for RS and FMKL GLD
fun.mApply

Applying functions based on an index for a matrix.
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.moments.r

Calculate mean, variance, skewness and kurtosis of a numerical vector
fun.theo.bi.mv.gld

Calculates the theoretical mean, variance, skewness and kurtosis for mixture of two generalised lambda distributions.
fun.theo.mv.gld

Find the theoretical first four moments of the generalised lambda distribution.
fun.which.zero

Determine which values are zero.
fun.plot.fit

Plotting the univariate generalised lambda distribution fits on the data set.
fun.plot.fit.bm

Plotting mixture of two generalised lambda distributions on the data set.
fun.plot.many.gld

Plotting many univariate generalised lambda distributions on one page.
fun.rawmoments

Computes the raw moments of the generalised lambda distribution up to 4th order.
fun.zero.omit

Returns a vector after removing all the zeros.
gl.check.lambda.alt

Checks whether the parameters provided constitute a valid generalised lambda distribution.
Optimisation functions

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

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

Returns a logical vector TRUE, if the value is not Inf or -Inf.
gl.check.lambda.alt1

Checks whether the parameters provided constitute a valid generalised lambda distribution.
ks.gof

Kolmogorov-Smirnov test
pretty.su

An alternative to the normal pretty function in R.
histsu

Histogram with exact number of bins specified by the user
is.inf

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

Determine Missing Values
qqplot.gld

Do a quantile plot on the univariate distribution fits.
qqplot.gld.bi

Do a quantile plot on the bimodal distribution fits.
starship.obj

Objective function that is minimised in starship estimation method
skewness and kurtosis

Compute skewness and kurtosis statistics
starship.adaptivegrid

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

Carry out the ``starship'' estimation method for the generalised lambda distribution
t1lmoments

Trimmed L-moments
digitsBase

Digit/Bit Representation of Integers in any Base
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.
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.
fun.RMFMKL.hs

Fit FMKL generalised distribution to data using discretised approach with weights.
fun.RMFMKL.hs.nw

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

The Generalised Lambda Distribution Family
QUnif

Quasi Randum Numbers via Halton Sequences
Fitting functions

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

L-moments
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.