Learn R Programming

gldist (version 2160.2)

fitgl:

Fitting of the Generalized Lambda Distribution.

Description

Fitting of the Generalized Lambda Distribution with different estimators.

Usage

fitgl(x, start, inc = FALSE, na.rm = FALSE, method = c("mle", "hist", "prob", "quant", "shape"), ...)

Arguments

x
A numeric vector of length at least one containing only finite values.
start
A numeric vector (optional), initial values for the parameters to be optimized.
inc
A logical value indicating wether the location (median) and scale (inter-quartile) should be included in the optimization or estimated by their smaple estimators. FALSE by default.
method
A character value specifying the method to use to fit the data.
na.rm
logical. Should missing values (including 'NaN') be removed?
...
additional arguments to be passed to the optimization function 'nlminb' or to the objective function. See 'method' argument for the availalbe additional arguments of the objective function.

Value

A list with components.
call
Calling function.
par
The best set of parameters found.
objective
The value of objective corresponding to par.
convergence
An integer code. 0 indicates successful convergence.
message
A character string giving any additional information returned by the optimizer, or NULL. For details, see nlminb documentation.
iterations
Number of iterations performed.
evaluations
Number of objective function and gradient function evaluations.

Details

FIXME

References

Y. Chalabi, D. J. Scott and D. Wuertz, An Asymmetry-Steepness Parameterization of the Generalized Lambda Distribution. Working paper, 2012.

See Also

gldist, gldist-package

Examples

Run this code

# Generate deviates
x <- rgl(1000, med = 1, iqr = 2, chi = 0, xi = .5)

# Fit the data set with the different methods
fitgl(x, inc = FALSE, method = "mle")
fitgl(x, inc = TRUE, method = "mle")

fitgl(x, inc = FALSE, method = "hist", breaks = "FD")
fitgl(x, inc = TRUE, method = "hist", breaks = "FD")

fitgl(x, inc = FALSE, method = "prob")
fitgl(x, inc = TRUE, method = "prob")

fitgl(x, inc = FALSE, method = "quant", len = 1000)
fitgl(x, inc = TRUE, method = "quant", len = 1000)

fitgl(x, method = "shape")

Run the code above in your browser using DataLab