fit.fkml | R Documentation |
Estimates parameters of the FKML parameterisation of the Generalised lambda Distribution. Five estimation methods are available;
Numerical Maximum Likelihood,
Maximum Product of Spacings, Titterington's Method,
the Starship (also available in the starship
function, which uses the same underlying code as this for the fkml parameterisation),
Trimmed L-Moments, L-Moments, Distributional Least Absolutes, and Method of Moments.
fit.fkml(x, method = "ML", t1 = 0, t2 = 0, l3.grid = c(-0.9, -0.5, -0.1, 0, 0.1, 0.2, 0.4, 0.8, 1, 1.5), l4.grid = l3.grid, record.cpu.time = TRUE, optim.method = "Nelder-Mead", inverse.eps = .Machine$double.eps, optim.control=list(maxit=10000), optim.penalty=1e20, return.data=FALSE)
x |
Data to be fitted, as a vector |
method |
A character string, to select the estimation method. One of: |
t1 |
Number of observations to be trimmed from the left in the conceptual sample, t1 (A non-negative integer, only used by TL-moment estimation, see details section) |
t2 |
Number of observations to be trimmed from the right in the conceptual sample, t2 (A non-negative integer, only used by TL-moment estimation, see details section). These two arguments are restricted by t1+t2 < n, where n is the sample size |
l3.grid |
A vector of values to form the grid of values of lambda3 used to find a starting point for the optimisation. |
l4.grid |
A vector of values to form the grid of values of lambda4 used to find a starting point for the optimisation. |
record.cpu.time |
Boolean — should the CPU time used in fitting be recorded in the fitted model object? |
optim.method |
Optimisation method, use any of the options available under |
inverse.eps |
Accuracy of calculation for the numerical determination of F(x), defaults to |
optim.control |
List of options for the optimisation step. See
|
optim.penalty |
The penalty to be added to the objective function if parameter values are proposed outside the allowed region |
return.data |
Logical: Should the function return the data (from the argument |
Maximum Likelihood Estimation of the generalised lambda distribution (gld
) proceeds by calculating the density of the data for candidate values of the parameters. Because the
gld is defined by its quantile function, the method first numerically
obtains F(x) by inverting Q(u), then obtains the density for that observation.
Maximum Product of Spacings estimation (sometimes referred to as Maximum Spacing Estimation, or Maximum Spacings Product) finds the parameter values that maximise the product of the spacings (the difference between successive depths, F(x_(i+1);theta)-F(x_(i);theta), where F(x;theta) is the distribution function for the candidate values of the parameters). See Dean (2013) and Cheng & Amin (1981) for details.
Titterington (1985) remarked that MPS effectively added
an “extra observation”; there are N data points in the original
sample, but N + 1 spacings in the expression maximised in MPS.
Instead of using spacings between transformed data points, so method TM
uses spacings between transformed, adjacently-averaged, data points.
The spacings are given by Di=F(z(i);theta)- F(z(i-1);theta),
where alpha1 = z0 < z1 < ...
<zn = alpha2
and z_i = (x_i + x_(i+1) )/2
for i = 1,2, ... n-1
(where alpha1 and alpha2
are the lower and upper bounds on the support of the distribution).
This reduces the number of spacings to n and achieves concordance
with the original sample size. See Titterington (1985) and
Dean (2013) for details.
The starship is built on the fact that the gld is a transformation of the uniform distribution. Thus the inverse of this transformation is the distribution function for the gld. The starship method applies different values of the parameters of the distribution to the distribution function, calculates the depths q corresponding to the data and chooses the parameters that make these calculated depths closest (as measured by the Anderson-Darling statistic) to a uniform distribution. See King & MacGillivray (1999) for details.
TL-Moment estimation chooses the values of the parameters that minimise the
difference between the sample Trimmed L-Moments of the data and the Trimmed
L-Moments of the fitted distribution.
TL-Moments are based on inflating the conceptual sample size used in the definition of L-Moments. The t1
and t2
arguments to the
function define the extent of trimming of the conceptual sample. Thus,
the default values of t1=0
and t2=0
reduce the TL-Moment
method to L-Moment estimation. t1
and t2
give the number of
observations to be trimmed (from the left and right respectively) from
the conceptual sample of size n+t1+t2. These two
arguments should be non-negative integers, and t1+t2 < n, where n is the sample size.
See Elamir and Seheult (2003) for more on
TL-Moments in general, Asquith, (2007) for TL-Moments of the RS parameterisation of the gld and Dean (2013) for more details on TL-Moment estimation of the gld.
The method of distributional least absolutes (DLA) minimises the sum of absolute deviations between the order statistics and their medians (based on the candidate parameters). See Dean (2013) for more information.
Moment estimation chooses the values of the parameters that minimise the (sum of the squared) difference between the first four sample moments of the data and the first four moments of the fitted distribution.
fit.fkml
returns an object of class
"starship"
(regardless of the estimation method used).
print
prints the estimated values of the parameters, while
summary.starship
prints these by default, but can also provide
details of the estimation process (from the components grid.results
,
data
and optim
detailed below).
The value of fit.fkml
is a list containing the
following components:
lambda |
A vector of length 4, giving the estimated parameters, in order, lambda 1 - location parameter lambda 2 - scale parameter lambda 3 - first shape parameter lambda 4 - second shape parameter |
grid.results |
output from the grid search |
optim |
output from the optim search,
|
cpu |
A vector showing the computing time used, returned if
|
data |
The data, if |
Robert King, robert.king.newcastle@gmail.com, https://github.com/newystats/
Ben Dean, University of Newcastle benjamin.dean@uon.edu.au
Asquith, W. H. (2007), L-Moments and TL-Moments of the Generalized Lambda Distribution, Computational Statistics & Data Analysis, 51, 4484–4496.
Cheng, R.C.H. & Amin, N.A.K. (1981), Maximum Likelihood Estimation of Parameters in the Inverse Gaussian Distribution, with Unknown Origin, Technometrics, 23(3), 257–263. https://www.jstor.org/stable/1267789
Dean, B. (2013) Improved Estimation and Regression Techniques with the Generalised Lambda Distribution, PhD Thesis, University of Newcastle https://nova.newcastle.edu.au/vital/access/manager/Repository/uon:13503
Elamir, E. A. H., and Seheult, A. H. (2003), Trimmed L-Moments, Computational Statistics & Data Analysis, 43, 299–314.
King, R.A.R. & MacGillivray, H. L. (1999), A starship method for fitting the generalised lambda distributions, Australian and New Zealand Journal of Statistics 41, 353–374.
Titterington, D. M. (1985), Comment on ‘Estimating Parameters in Continuous Univariate Distributions’, Journal of the Royal Statistical Society, Series B, 47, 115–116.
starship
GeneralisedLambdaDistribution
example.data <- rgl(200,c(3,1,.4,-0.1),param="fkml") example.fit <- fit.fkml(example.data,"MSP",return.data=TRUE) print(example.fit) summary(example.fit) plot(example.fit,one.page=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.