Last data update: 2014.03.03

R: For fitting truncated distribution to the tails of data
fitTailR 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.

See Also

loglogSurv, logSurv

Examples

data(film90)
F90 <- film90$borev0
# trucated plots
# 10%
w403<- fitTail(F90, family=WEI3)
plot(w403)
qqnorm(resid(w403))
abline(0,1, col="red")

## Not run: 
# hill -sequential plot 10
w1<-fitTailAll(F90)
# plot sigma
plot(w1[,2])
#-----------------
#LOGNO
l403<- fitTail(F90, family=LOGNO)
plot(l403)
qqnorm(resid(l403))
abline(0,1)
#  hill -sequential plot 10
l1<-fitTailAll(F90, family=LOGNO)
plot(l1[,2])
#-------------------------

## End(Not run)

Results