Plotting estimated penalized densities, need object of class 'pendensity'.
# S3 method for pendensity
plot(x, plot.val = 1, val=NULL, latt = FALSE, kernel = FALSE, confi = TRUE,
main = NULL, sub = NULL, xlab = NULL, ylab = NULL, plot.base = FALSE,
lwd=NULL,legend.txt=NULL,plot.dens=TRUE,...)
object of class pendensity
if plot.val=1 the density is plotted, if plot.val=2 the distribution function of the observation values is plotted, if plot.val=3 the distribution function is plotted as function
vector of y, at which the estimated density should be calculated. If plot.val=2, the calculated values of distribution are returned and the values are pointed in the distribution function of the observed values.
TRUE/FALSE, if TRUE the lattice interface should be used for plotting, default=FALSE
TRUE/FALSE, if TRUE a kernel density estimation should be added to the density plots, default=FALSE
TRUE/FALSE, if TRUE confidence intervals should be added to the density plots, default=TRUE
Main of the density plot, if NULL main contains settings 'K', 'AIC' and 'lambda0' of the estimation
sub of the density plot, if NULL sub contains settings used base 'base' and used order of B-Spline 'q'
xlab of the density plot, if NULL xlab contains 'y'
ylab of the density plot, if NULL ylab contains 'density'
TRUE/FALSE, if TRUE the weighted base should be added to the density plot, default=FALSE
lwd of the lines of density plot, if NULL lwd=3, the confidence bands are plotted with lwd=2
if FALSE no legend is plotted, legend.txt can get a vector of characters with length of the groupings. legend.txt works only for plot.val=1
TRUE/FALSE, if the estimated density should be plotted. Default=TRUE. Interesting for evaluating densities in values 'val', while this special plot is not needed.
further arguments
If the density function is plotted, function returns two values
Contains the constructed help values for the response, the corresponding values for the densities and if asked for the calculated confidence intervals
list of all combinations of the covariates
values at which the estimated density has been calculated
calculated density values in y
the values of the upper confidence interval of y
the values of the lower confidence interval of y
If the empirical distribution function is plotted, the function returns
containing the observed values y
containing the empirical distribution of each observation y
Each grouping of factors is plotted. Therefore, equidistant help values are constructed in the support of the response for each grouping of factors. Weighting these help values with knots weights ck results in the density estimation for each grouping of factors. If asked for, pointwise confidence intervals are computed and plotted.
Density Estimation with a Penalized Mixture Approach, Schellhase C. and Kauermann G. (2012), Computational Statistics 27 (4), p. 757-777.
# NOT RUN {
y <- rnorm(100)
test <- pendensity(y~1)
plot(test)
#distribution
plot(test,plot.val=2)
# }
Run the code above in your browser using DataLab