fitDist {gamlss}R Documentation

Fits Different Parametric gamlss.family distributions to data

Description

This function is using the function gamlssML() to fit all relevant parametric gamlss.family distributions to a data vector. The final model is the one which is selected by the generalised Akaike information criterion with penalty k.

Usage

fitDist(y, k = 2, 
      type = c("realAll", "realline", "realplus", "real0to1", "counts", "binom"), 
      try.gamlss = FALSE, extra = NULL, data = NULL, ...)

Arguments

y

the data vector

k

the penalty for the GAIC with default values k=2 the standard AIC

type

the type of distribution to be tried see details

try.gamlss

if gamlssML() failed whether should try gamlss instead. This will slow up things for big data.

extra

whether extra distribution should be tried which are not in the type list

data

the data frame where y ca be found

...

for extra arguments to be passed to gamlssML() to gamlss()

Details

The following are the different type argument:

Value

A gamlssML object with two extra components:

fits

an ordered list according to the GAIC of the fitted distribution

failed

the distributions where the gamlssML)() (or gamlss()) fits have failed

Author(s)

Mikis Stasinopoulos d.stasinopoulos@londonmet.ac.uk, Bob Rigby r.rigby@londonmet.ac.uk, Vlasis Voudouris v.voiudouris@londonmet.ac.uk and Majid Djennad m.djennad.londonmet.ac.uk

References

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

gamlss,gamlssML

Examples

y <- rt(100, df=1)
m1<-fitDist(y, type="realline")
m1$fits
m1$failed
# an example of using  extra
## Not run:  
library(gamlss.tr)
data(tensile)
gen.trun(par=1,family="GA", type="right")
gen.trun(par=1,"LOGNO", type="right")
gen.trun(par=c(0,1),"TF", type="both")
ma<-fitDist(str, type="real0to1", extra=c("GAtr", "LOGNOtr", "TFtr"), data=tensile)

## End(Not run)

[Package gamlss version 4.3-5 Index]