cens {gamlss.cens} | R Documentation |
This function can be used to fit censored data.
It takes as an argument an existing GAMLSS family distribution and generates
a gamlss.family
object which then can be used to fit
a right, left or interval censored data.
cens(family = "NO", name = "cens", type = c("right", "left", "interval"), local = TRUE, delta = NULL, ...)
family |
a gamlss.family object, which is used to
define the distribution and the link functions of the various parameters.
The distribution families supported by gamlss()
can be found in gamlss.family and in the package gamlss.dist . |
name |
the characters you want to add to the name of new functions, by default is cens |
type |
what type of censoring is required, right , left or interval . |
local |
if TRUE the function will try to find the environment of gamlss to generate
the d and p functions required for the fitting,
if FALSE the functions will be generated in the global environment |
delta |
the delta increment used in the numerical derivatives |
... |
for extra arguments |
This function is created to help the user to fit censored data using an existing gamlss
distribution.
It does this by taking an existing gamlss.family
and changing some of the components
of the distribution to help the fitting process.
It particular it i) creates a (d
) function (for calculating the censored likelihood) and a (p
)
function (for generating the quantile residuals) within gamlss
,
ii) changes the global deviance function G.dev.incr
, the first derivative funtions (see note below)
and other quantities from the original distribution.
It returns a gamlss.family
object which has all the
components needed for fitting a distribution in gamlss
.
This function is experimental and could be changed.
The function cens
changes the first derivatives of the original gamlss family d
function to numerical derivatives for the new censored d
function. The default increment delta
,
for this numerical derivatives function, is eps * pmax(abs(x), 1)
where
eps<-sqrt(.Machine$double.eps)
. The default delta
could be inappropriate for
specific applications and can be overwritten by using the argument delta
.
Mikis Stasinopoulos d.stasinopoulos@londonmet.ac.uk and Bob Rigby r.rigby@londonmet.ac.uk
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. (2003) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.com/).