R: For fitting truncated distribution to the tails of data
fitTail
R Documentation
For fitting truncated distribution to the tails of data
Description
There are two functions here. The function fitTail() which fits a truncated distribution to certain percentage of the tail of a response variable and the function fitTailAll() which does a sequence of truncated fits. Plotting the results from those fits is analogous to the Hill plot, Hill (1975).
Usage
fitTail(y, family = "WEI3", percentage = 10, howmany = NULL,
type = c("right", "left"), ...)
fitTailAll(y, family = "WEI3", percentage = 10, howmany = NULL,
type = c("right", "left"), plot = TRUE,
print = TRUE, save = FALSE, start = 5)
Arguments
y
The variable of interest
family
a gamlsss.family distribution
percentage
what percentage of the tail need to be modelled, default is 10%
howmany
how many observations in the tail needed. This is an alternative to percentage. If it specified it take over from the percentage argument otherwise percentage is used.
type
which tall needs checking the right (default) of the left
plot
whether to plot with default equal TRUE
print
whether to print the coefficients with default equal TRUE
save
whether to save the fitted linear model with default equal FALSE
start
where to start fitting from the tail of the data
...
for further argument to the fitting function
Details
The idea here is to fit a truncated distribution to the tail of the data.
Truncated log-normal and Weibull distributions could be appropriate distributions. More details can be found in Chapter 6 of "The Distribution Toolbox of GAMLSS" book which can be found in http://www.gamlss.org/).
Value
A fitted gamlss model
Author(s)
Bob Rigby, Mikis Stasinopoulos and Vlassios Voudouris
References
Hill B. M. (1975) A Simple General Approach to Inference About the Tail of a Distribution
Ann. Statist. Volume 3, Number 5, pp 1163-1174.
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R.
Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.