logspline.fit {logspline}R Documentation

Logspline Density Estimation

Usage

logspline.fit(uncensored, right, left, interval, 
              lbound= -Inf, ubound=Inf,
              nknots, knots, penalty, delete=T)

Arguments

uncensored vector of uncensored observations from the distribution whose density is to be estimated. If there are no uncensored observations, this argument can be omitted. However, either uncensored or interval must be specified.
right vector of right censored observations from the distribution whose density is to be estimated. If there are no right censored observations, this argument can be omitted.
left vector of left censored observations from the distribution whose density is to be estimated. If there are no left censored observations, this argument can be omitted.
interval two column matrix of lower and upper bounds of observations that are interval censored from the distribution whose density is to be estimated. If there are no interval censored observations, this argument can be omitted.
lbound,ubound lower/upper bound for the support of the density. For example, if there is a priori knowledge that the density equals zero to the left of 0, and has a discontinuity at 0, the user could specify lbound=0. However, if the density is essentially zero near 0, one does not need to specify lbound.
nknots forces the method to start with nknots knots (delete=T) or to fit a density with nknots knots (delete=F). The method has an automatic rule for selecting nknots if this parameter is not specified.
knots ordered vector of values (that should cover the complete range of the observations), which forces the method to start with these knots (delete=T) or to fit a density with these knots (delete=F). Overrules nknots. If knots is not specified, a default knot-placement rule is employed.
penalty the parameter to be used in the AIC criterion. The method chooses the number of knots that minimizes ` -2*loglikelihood+penalty*(number of knots-1)'. The default is to use penalty=log(samplesize) as in BIC. The effect of this parameter is summarized in logspline.summary.
delete should stepwise knot deletion be employed?

Value

The output is organized to serve as input for logspline.plot, logspline.summary, dlogspline, plogspline, qlogspline and rlogspline. The function returns a list with the following members:

call the command that was executed.
knots vector of the locations of the knots in the logspline model.
coef coefficients of the spline. The first coefficient is the constant term, the second is the linear term and the k-th (k>2) is the coefficient of (x-t(k-2))^3+ (where ^3+ means the positive part of the third power, and t(k-2) means knot k-2). If a coefficient is zero the corresponding knot was deleted from the model.
bound first element: 0 - lbound was -infinity, 1 it was something else; second element: lbound, if specified; third element: 0 - ubound was infinity, 1 it was something else; fourth element: ubound, if specified.
logl the k-th element is the log-likelihood of the fit with k+2 knots.
penalty the penalty that was used.
sample the sample size that was used.
delete was stepwise knot deletion employed?

DESCRIPTION

logspline.fit: density estimation using splines to approximate the log-density.

References

Kooperberg, C. and Stone, C. J. (1991). A Study of Logspline Density Estimation. Computational Statistics and Data Analysis 12, 327-347.

Kooperberg, C. and Stone, C. J. (1992). Logspline Density Estimation for Censored Data. Journal of Computational and Graphical Statistics, 1, 301-328.

See Also

logspline.plot, logspline.summary, dlogspline, plogspline, qlogspline, rlogspline.

Examples

estimate the density of a positive random variable when some of the
observations are right censored, and generate 50 random numbers from
the estimated density:

fit <- logspline.fit(y, y2, lbound=0)
rlogspline(50, fit)


[Package Contents]