R: Maximum Likelihood estimation of a simple GAMLSS model

gamlssML {gamlss} | R Documentation

## Maximum Likelihood estimation of a simple GAMLSS model

### Description

This is a function for fitting a `gamlss.family` distribution to single data set using a non linear maximisation algorithm in `R`. This is relevant only when there are not explanatory variables.

### Usage

    gamlssML(formula, family = NO, weights = NULL, mu.start = NULL,
     sigma.start = NULL, nu.start = NULL, tau.start = NULL,
     mu.fix = FALSE, sigma.fix = FALSE, nu.fix = FALSE,
     tau.fix = FALSE, data =  sys.parent(), start.from = NULL, ...)

### Arguments

`formula` | a vector of data requiring the fit of a `gamlss.family` distribution or a formula, for example, `y~1` (explanatory variables are ignored).
`family` | `gamlss.family` object, which is used to define the distribution and the link functions of the various parameters. The distribution families supported by `gamlssML()` can be found in `gamlss.family`
`weights` | a vector of weights. Here weights can be used to weight out observations (like in `subset`) or for a weighted likelihood analysis where the contribution of the observations to the likelihood differs according to `weights`. The length of `weights` must be the same as the number of observations in the data. By default, the weight is set to one. To set weights to vector w use `weights=w`
`mu.start` | a scalar of initial values for the location parameter `mu` e.g. `mu.start=4`
`sigma.start` | a scalar of initial values for the scale parameter `sigma` e.g. `sigma.start=1`
`nu.start` | scalar of initial values for the parameter `nu` e.g. `nu.start=3`
`tau.start` | scalar of initial values for the parameter `tau` e.g. `tau.start=3`
`mu.fix` | whether the mu parameter should be kept fixed in the fitting processes e.g. `mu.fix=FALSE`
`sigma.fix` | whether the sigma parameter should be kept fixed in the fitting processes e.g. `sigma.fix=FALSE`
`nu.fix` | whether the nu parameter should be kept fixed in the fitting processes e.g. `nu.fix=FALSE`
`tau.fix` | whether the tau parameter should be kept fixed in the fitting processes e.g. `tau.fix=FALSE`
`data` | a data frame containing the variable `y`. If this is missing, the variable should be on the search list. e.g. `data=aids`
`start.from` | a gamlss object to start from the fitting or vector of length as many parameters in the distribution
`...` | for extra arguments

### Details

This function which fits a `gamlss.family` distribution to a single data set is using a non linear maximisation. in fact it uses the internal function `MLE()` which is a copy of the `mle()` function of package `stat4`. The function `gamlssML()` could be for large data faster than the equivalent `gamlss()` function which is designed for regression type of models.

### Value

Returns a `gamlssML` object which behaves like a `gamlss` fitted objected

### Author(s)

Mikis Stasinopoulos mikis.stasinopoulos@gamlss.org, Bob Rigby, Vlasis Voudouris and Majid Djennad

### 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. (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.

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.

(see also http://www.gamlss.org/).

### See Also

`gamlss.family`, `gamlss`

### Examples

    #-------- negative binomial 1000 observations
    y<- rNBI(1000)
      system.time(m1<-gamlss(y~1, family=NBI))
      system.time(m1a<-gamlss(y~1, family=NBI, trace=FALSE))
    system.time(m11<-gamlssML(y, family=NBI))
    AIC(m1,m1a,m11, k=0)
    # neg. binomial   n=10000
     y<- rNBI(10000)
     system.time(m1<-gamlss(y~1, family=NBI))
     system.time(m1a<-gamlss(y~1, family=NBI, trace=FALSE))
    system.time(m11<-gamlssML(y, family=NBI))
    AIC(m1,m1a,m11, k=0)
    # binomial type data
    data(aep)
    m1 <- gamlssML(aep$y, family=BB) # ok
    m2 <- gamlssML(y, data=aep, family=BB) # ok
    m3 <- gamlssML(y~1, data=aep, family=BB) # ok
    m4 <- gamlssML(aep$y~1, family=BB) # ok
    AIC(m1,m2,m3,m4)

[Package gamlss version 5.0-2 Index]