| Library: | smoother |
| See also: | denest dencb denxest denxci denxcb |
| Macro: | denci | |
| Description: | computes pointwise confidence intervals with prespecified confidence level for univariate density estimation. The computation uses WARPing. |
Haerdle (1991): Smoothing Techniques
| Usage: | {fh, clo, cup} = denci(x {,h {,alpha {,K} {,d}}}) | |
| Input: | ||
| x | n x 1 vector, the data. | |
| h | scalar, bandwidth. If not given, the rule of thumb bandwidth computed by denrot is used (Silverman's rule of thumb). | |
| alpha | confidence level, If not given, 0.05 is used. | |
| K | string, kernel function on [-1,1]. If not given, the Quartic kernel "qua" is used. | |
| d | scalar, discretization binwidth. d must be smaller than h. If not given, the minimum of h/3 and (max(x)-min(x))/100 is used. | |
| Output: | ||
| fh | m x 2 matrix, the first column is a grid and the second column contains the density estimate on that grid. | |
| clo | m x 2 matrix, the first column is a grid and the second column contains the lower confidence bounds for that grid. | |
| cup | m x 2 matrix, the first column is a grid and the second column contains the upper confidence bounds for that grid. | |
library("smoother")
library("plot")
x = 5*normal(200)+10
{fh, clo, cup} = denci(x,3)
;
fh=setmask(fh,"line","blue")
clo=setmask(clo,"line","blue","thin","dashed")
cup=setmask(cup,"line","blue","thin","dashed")
plot(fh,clo,cup)
Pointwise confidence intervals at confidence level alpha = 0.05 for a normal density from N(10,25) are pictured using Quartic kernel (default) and bandwidth h=3.
| Library: | smoother |
| See also: | denest dencb denxest denxci denxcb |