fit.gpd | R Documentation |
Estimates parameters of the GPD type generalised lambda Distribution. Estimation is via method of L moments or the starship method.
The Method of L-Moments estimates for the GPD type are the only estimates for any generalised lambda distribution type with closed form expressions, and the only with algebraic results for standard errors of the estimates.
For further details on the starship method, see starship
.
fit.gpd(x, method = "LM", na.rm = TRUE, record.cpu.time = TRUE, return.data = FALSE, LambdaZeroEpsilon=1e-15) fit.gpd.lmom(data, na.rm = TRUE,LambdaZeroEpsilon=1e-15) fit.gpd.lmom.given(lmoms, n = NULL,LambdaZeroEpsilon=1e-15)
x |
Data to be fitted, as a vector |
method |
A character string, to select the estimation method. The available methods are 1. "LM" for Method of L-Moments, 2. "SM" or "starship" for the Starship method. |
na.rm |
Logical: Should missing values be removed? |
record.cpu.time |
Logical: should the CPU time used in fitting be recorded in the fitted model object? |
return.data |
Logical: Should the function return the data (from the argument |
data |
Data to be fitted, as a vector |
lmoms |
A numeric vector containing two L-moments and two L-moment ratios, in the order l_1, l_2, t_3, t_4. |
n |
the sample size, defaults to NULL |
LambdaZeroEpsilon |
tolerance for lambda estimate of zero |
The starship method calls the starship
function - see its help for more details.
The method of L-Moments equates sample L-Moments with expressions for the L-Moments of the GPD type GLD. Closed form expressions exist to give these estimates.
For many values there are two possible estimates for the same L Moment values, one in each of two regions of the GPD GLD parameter space, denoted region A and region B in van Staden (2013). More details on these regions can be found on page 154 of van Staden (2013).
If the 4th L-Moment ratio, tau4 is less than the minimum value that tau4 can obtain for the GPD generalised lambda distribution;
(12-5*sqrt(6))/(12+5*sqrt(6)) = approx -0.0102051,
there is no possible L-Moment estimate (from either region A or B), and this function returns NA for the estimates.
When estimating from data, or for given L-Moments with n given, standard errors of the estimates are calculated if possible (standard errors are only finite if lambda > -0.5).
If lambda is zero, the GPD gld is a special case
the Quantile Based Skew Logistic Distribution. If the estimated lambda is within LambdaZeroEpsilon
of zero, standard errors for alpha, beta and delta are calculated for the Quantile Based Skew Logistic Distribution and NA is returned as the standard error of lambda.
These functions return an object of class
"GldGPDFit
". It is a list, containing these components (optional components noted here);
estA |
The estimate in region A. This will be NULL if there is no estimate in region A |
estB |
The estimate in region B. This will be NULL if there is no estimate in region B |
warn |
(only if estA and estB are both NULL), the reason there are no
estimates. If this is the case, the function also issues a |
cpu |
A vector showing the computing time used, returned if
|
data |
The data, if |
param |
The character |
starship |
The value returned by |
Each of the estimate elements (if they are not NULL) are either a vector of length 4, or a 4 by 2 matrix if standard errors are calculated. The elements of the vector, or rows of the matrix are the estimated parameters, in order;
alpha |
location parameter |
beta |
scale parameter |
delta |
skewness parameter |
lambda |
kurtosis parameter |
The columns of the matrix are the parameter, and its standard error.
Robert King, robert.king.newcastle@gmail.com, https://github.com/newystats/
Paul van Staden
Van Staden, Paul J., & M.T. Loots. (2009), Method of L-moment Estimation for the Generalized Lambda Distribution. In Proceedings of the Third Annual ASEARC Conference. Callaghan, NSW 2308 Australia: School of Mathematical and Physical Sciences, University of Newcastle.
GeneralisedLambdaDistribution
fit.gpd.lmom.given(c(1,.3,.6,.8)) example.data = rgl(n=300,c(5,2,0.8,-0.1),param="gpd") fit.gpd(example.data) fit.gpd(example.data,method="starship")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.