stablereg() of the R package stable created by
Philippe Lambert and Jim Lindsey which can be found in Jim Lindsey's web page
http://popgen.unimaas.nl/~jlindsey/index.html (see also Lambert, P. and Lindsey, J.K. (1999)).
The method is very general but requires starting values for all the parameters. For parametric models it can also
be used to give the exact (that is taking into the account the correlation between the distributional parameters) asymptotic standard errors.
nlgamlss(y = NULL, mu.formula = ~1, sigma.formula = ~1, nu.formula = ~1, tau.formula = ~1, mu.fix = FALSE, sigma.fix = FALSE, nu.fix = FALSE, tau.fix = FALSE, all.fix = FALSE, mu.start = NULL, sigma.start = NULL, nu.start = NULL, tau.start = NULL, family = NO(), weights = 1, exact = FALSE, delta = 1, data = parent.frame(), control = NL.control(), llik.output = FALSE)y. Note the difference between gamlss and nlgamss in declaring the y variable
In gamlss, y~x is used for modelling the location parameters while here you need y=y and mu.fo=x mu.fo=~x
The mu.formula is a linear or nonlinear language expression
beginning with ~ or an R function, describing the regression function for the predictor of the location parameter
(i.e. after transformation of mu by its link function). mu.start is a vector of initial conditions for the parameters
in the regression for this parameter. mu.fix is a boolean indicating if an optimization of the likelihood has to be carried
out on these parameters. If no optimization is desired on the location parameters mu, i.e. when the likelihood has to
be evaluated or optimized at a fixed location, then mu.fix=TRUE has to be explicitly specified with mu.start indicating
the fixed value for the predictor of mu.mu.formula above,
e.g. sigma.formula=~x1+x2. It can be abbreviated to sigma.fo=~x1+x2. nu.fo=~x tau.fo=~xmu.fix=FALSE sigma.fix=FALSEnu.fix=FALSEtau.fix=FALSEmu.start=4 sigma.start=1 nu.start=3tau.start=2 gamlss.family)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 delta below exact=TRUE data=aids nlm() iterations algorithm.
The default setting is the NL.control function gamlss.family)mu, sigma, nu, tau nlm()nlm()Lambert, P. and Lindsey, J.K. (1999) Analysing financial returns using regression models based on non-symmetric stable distributions. Applied Statistics 48, 409-424.
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.
Rigby, R.A. Stasinopoulos, D.M. (2006). Using the Box-Cox t distribution in GAMLSS to mode skewnees and and kurtosis. to appear in Statistical Modelling.
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.com/).
gamlss, gamlss.family data(la)
# fitting a BCPE distribtion to the data
modBCPE<- nlgamlss(y=PET60, mu.fo=~bflow*(1-(1-exp(p1))*exp(-p2/bflow)),
sigma.formula=~1, mu.start = c(-.9, 90),
sigma.start= -2.3, nu.start=0, tau.start=log(2.5),
family=BCPE, data=la)
modBCPE
plot(modBCPE)
Run the code above in your browser using DataLab