Generalized additive model for Location, Shape and Scale

 A GAMLSS model is a general regression model which assumes that the response (dependent) variable has any parametric distribution. 
 In addition, all the parameters of the distribution of the response variable can be modelled as functions of the available explanatory variables. This is in contrast to GLM's and GAM's where the distribution of the response variable is restricted to the exponential family of distributions and only the mean (a location parameter) of the distributions is modelled. 
 So, the main characteristic of GAMLSS models is the ability to allow the location, scale and shape of the distribution of the response variable to vary according to the values of explanatory variables.

Reference: https://www.gamlss.com/.

require(gamlss)
## Loading required package: gamlss
## Loading required package: splines
## Loading required package: gamlss.data
## 
## Attaching package: 'gamlss.data'
## The following object is masked from 'package:datasets':
## 
##     sleep
## Loading required package: gamlss.dist
## Loading required package: MASS
## Loading required package: nlme
## Loading required package: parallel
##  **********   GAMLSS Version 5.3-4  **********
## For more on GAMLSS look at https://www.gamlss.com/
## Type gamlssNews() to see new features/changes/bug fixes.

GAMLSS Model explanation with “rent” dataset

 About the data:
      A survey was conducted in April 1993 by Infratest Sozialforschung. A random sample of accommodation with new tenancy agreements or increases of rents within the last four years in Munich was selected including: i) single rooms, ii) small apartments, iii) flats, iv) two-family houses. Accommodation subject to price control rents, one family houses and special houses, such as penthouses, were excluded because they are rather different from the rest and are considered a separate market. For the purpose of this study, 1967 observations of the variables listed below were used, i.e. the rent response variable R followed by the explanatory variables found to be appropriate for a regression analysis approach by Fahrmeir et al. (1994, 1995).
Output1<-gamlss(R ~ pb(Fl)+pb(A)+H+loc, 
       sigma.fo=~pb(Fl)+pb(A)+H+loc,
       nu.fo=~1, 
       family=BCCGo, 
       data=rent)
## GAMLSS-RS iteration 1: Global Deviance = 27628.31 
## GAMLSS-RS iteration 2: Global Deviance = 27568.64 
## GAMLSS-RS iteration 3: Global Deviance = 27566.3 
## GAMLSS-RS iteration 4: Global Deviance = 27566.09 
## GAMLSS-RS iteration 5: Global Deviance = 27566.06 
## GAMLSS-RS iteration 6: Global Deviance = 27566.06 
## GAMLSS-RS iteration 7: Global Deviance = 27566.06 
## GAMLSS-RS iteration 8: Global Deviance = 27566.06
Output2<-gamlss(R ~ pb(Fl)+pb(A)+H+loc,
                sigma.fo=~pb(Fl)+pb(A)+H+loc,
                nu.fo=~pb(Fl)+pb(A)+H+loc, 
                family=BCCGo, 
                data=rent)
## GAMLSS-RS iteration 1: Global Deviance = 27616.6 
## GAMLSS-RS iteration 2: Global Deviance = 27553.71 
## GAMLSS-RS iteration 3: Global Deviance = 27551.5 
## GAMLSS-RS iteration 4: Global Deviance = 27551.32 
## GAMLSS-RS iteration 5: Global Deviance = 27551.32 
## GAMLSS-RS iteration 6: Global Deviance = 27551.32 
## GAMLSS-RS iteration 7: Global Deviance = 27551.32
AIC(Output1,Output2)
##               df      AIC
## Output2 28.41391 27608.15
## Output1 22.48092 27611.02
op <- par(mfrow=c(1,2))
wp(Output1, ylim.all=.6) ; title(" (c) BCCG(mu, sigma)")
wp(Output2, ylim.all=.6); title(" (d) BCCG(mu, sigma, nu)")

par(op)