Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 Quantlet: denxest Description: estimates a univariate density by kernel density estimation.

 Usage: fh = denxest(x {,h {,K} {,v} }) 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). K string, kernel function on [-1,1] or Gaussian kernel "gau". If not given, the Quartic kernel "qua" is used. v m x 1, values of the independent variable on which to compute the density estimate. If not given, x is used. Output: fh n x 2 or m x 2 matrix, the first column is the sorted first column of x or the sorted v, the second column contains the density estimate on on the values of the first column.

Note:
This function does an exact computation, i.e. requires O(n^2) operations for estimating the regression function on all observations. For exploratory purposes, the macro "denest" is recommended, which uses the faster WARPing method.

Example:
```library("smoother")
library("plot")
;
mu = 10
si = 5
x  = si*normal(200)+mu          ; generate data
;
fh = denxest(x)                  ; estimate density
f  = sort(x~pdfn((x-mu)/si)/si) ; true density                   ;             ;
plot(f,fh)                      ; graph functions

```
Result:
```The density estimate (blue) for a normal distribution
with mean mu=10, standard deviation si=5 is pictured
using Quartic kernel (default) and Silverman's
rule-of-thumb bandwidth (default), together with
the true density (thin black).
```
Example:
```library("smoother")
library("plot")
;
mu = 10
si = 5
x  = si*normal(200)+mu           ; generate data
;
fhe= denxest(x,3,"epa")           ; estimate density
fhu= denxest(x,3,"uni")           ; estimate density
f  = sort(x~pdfn((x-mu)/si)/si)  ; true density
;
plot(f,fhu,fhe)                  ; graph functions

```
Result:
```The density estimate using the Epanechnikov kernel
(green) is compared to the density estimate using
the Uniform kernel (red) and the true density (thin
black). In both cases, bandwidth h=3 is used.
```

Author: Marlene Mueller, 990413
(C) MD*TECH Method and Data Technologies, 05.02.2006