fit.fkml.moments | R Documentation |
Estimates parameters of the generalised lambda distribution (FKML type) using the Method of Moments, on the basis of moments calculated from data, or moment values (mean, variance, skewness ratio and kurtosis ratio (note, not the excess kurtosis)).
fit.fkml.moments(data,na.rm=TRUE, optim.method="Nelder-Mead", optim.control= list(), starting.point = c(0,0)) fit.fkml.moments.val(moments=c(mean=0, variance=1, skewness=0, kurtosis=3), optim.method="Nelder-Mead", optim.control= list(), starting.point = c(0,0))
data |
A vector of data |
na.rm |
Logical - should NAs be removed from the data - if FALSE, any NAs in the data will cause an error |
moments |
A vector of length 4, consisting of the mean, variance and moment ratios for skewness and kurtosis (do not subtract 3 from the kurtosis ratio) |
optim.method |
Optimisation method for |
optim.control |
argument |
starting.point |
a vector of length 2, giving the starting value for lambda 3 and lambda 4. |
Estimates parameters of the generalised lambda distribution
(FKML type) using Method of Moments on the basis of moment values (mean,
variance, skewness ratio and kurtosis ratio). Note this is the fourth
central moment divided by the second central moment, without subtracting 3.
fit.fkml.moments
will estimates
using the method of moments for a dataset, including calculating the
sample moments.
This function uses optim
to find the parameters that
minimise the sum of squared differences between the skewness and kurtosis
sample ratios and their counterpart expressions for those ratios on the
basis of the parameters lambda 3 and
lambda 4.
On the basis of these estimates (and the mean and variance), this function
then estimates
lambda 2 and then lambda 1.
Note that the first 4 moments don't uniquely identify members of the generalised lambda distribution. Typically, for a set of moments that correspond to a unimodal gld, there is another set of parameters that give a distrbution with the same first 4 moments. This other distribution has a truncated appearance (that is, the distribution has finite support and the density is non-zero at the end points). See the examples below.
A vector containing the parameters of the FKML type generalised lambda;
lambda 1 - location parameter
lambda 2 - scale parameter
lambda 3 - first shape parameter
lambda 4 - second shape parameter
(See gld
for more details)
Robert King, robert.king.newcastle@gmail.com, https://github.com/newystats/
Sigbert Klinke
Paul van Staden
Au-Yeung, Susanna W. M. (2003) Finding Probability Distributions From Moments, Masters thesis, Imperial College of Science, Technology and Medicine (University of London), Department of Computing
Freimer, M., Mudholkar, G. S., Kollia, G. & Lin, C. T. (1988), A study of the generalized tukey lambda family, Communications in Statistics - Theory and Methods 17, 3547–3567.
Lakhany, Asif and Mausser, Helmut (2000) Estimating the parameters of the generalized lambda distribution, Algo Research Quarterly, 3(3):47–58
van Staden, Paul (2013) Modeling of generalized families of probability distributions inthe quantile statistical universe, PhD thesis, University of Pretoria. https://repository.up.ac.za/handle/2263/40265
https://github.com/newystats/gld/
gld.moments
# Moment estimate example.data = rgl(n=400,lambda1=c(0,1,0.4,0), param="fkml") fit.fkml.moments(example.data) # Approximation to the standard normal distribution norm.approx <- fit.fkml.moments.val(c(0,1,0,3)) norm.approx # Another distribution with the same moments another <- fit.fkml.moments.val(c(0,1,0,3),start=c(2,2)) another # Compared plotgld(norm.approx$lambda,ylim=c(0,0.75),main="Approximation to the standard normal", sub="and another GLD with the same first 4 moments") plotgld(another$lambda,add=TRUE,col=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.