home *** CD-ROM | disk | FTP | other *** search
-
- _K_e_r_n_e_l _D_e_n_s_i_t_y _E_s_t_i_m_a_t_i_o_n
-
- density(x, n=512, kernel="gaussian", bw, adjust=1, width,
- from, to, cut=3)
-
- bw.ucv(x, samples=100)
- bw.bcv(x, samples=100)
- bw.sj(x, samples=100)
-
- print(dobj)
- plot(dobj, ...)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : the values for which the estimate is to be
- computed.
-
- n : the number of equally spaced points at which
- the density is to be estimated. This is
- rounded up to the next power of 2, with a
- minimum value of 512.
-
- kernel : a character string giving the smoothing ker-
- nel to be used. This must be one of "gaus-
- sian", "rectangular", "triangular", or
- "cosine", and may be abbrevited to a single
- letter.
-
- bw : the smoothing bandwith to be used. This is
- the standard deviation of the smoothing ker-
- nel. It defaults to 1.06 times the minimum
- of the standard deviation and the interquar-
- tile range divided by 1.34 times the sample
- size to the negative one fifth power. The
- specified value of bw is multiplied by
- adjust.
-
- adjust : the bandwith used is actually adjust*bw.
- This makes it easy to specify values like
- ``half the default'' bandwidth.
-
- width : this exists for compatibility with S.
-
- from,to : the left and right-most points of the grid at
- which the density is to be estimated.
-
- cut : by default, the values of left and right are
- cut bandwiths beyond the extremes of the
- data.
-
- samples : the sample size to take in the bandwidth
- selection functions. If samples is non-
- positive, the entire data set is used.
-
- dobj : a ``density'' object.
-
- ... : plotting parameters.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- The function density computes kernel density estimates
- with the given kernel and bandwidth (which is the stan-
- dard deviation of the kernel).
-
- The functions bw.ucv, bw.bcv and bw.sj provide
- automated ways of selecting a bandwith for density
- estimates (assuming a Gaussian kernel). The techniques
- used are as follows; bw.ucv uses unbiased cross-
- validation, bw.bcv uses biased cross-validation and
- bw.sj uses the technique of Sheather and Jones. These
- cross-validation techniques are based on code from the
- Venables and Ripley MASS library.
-
- The generic functions plot and print have methods den-
- sity objects.
-
- The algorithm used in density disperses the mass of the
- empirical distribution function over a regular grid and
- then uses the fast Fourier transform to convolve this
- approximation with a discretized version of the kernel.
-
- _V_a_l_u_e_s:
-
- An object with class ``density''. The underlying
- structure is a list containing the following com-
- ponents.
-
- x : the coordinates of the points where the density is
- estimated.
-
- y : the estimated density values.
-
- bw : the bandwidth used.
-
- call : the call which produced the result.
-
- name : the deparsed name of the x argument.
-
- _R_e_f_e_r_e_n_c_e_s:
-
- Silverman, B. W. (1986). Density Estimation. London:
- Chapman and Hall.
-
- Venables, W. N. and B. D. Ripley (1994). Modern
- Applied Statistics with S-Plus. New York: Springer.
-
- Scott, D. W. (1992). Multivariate Density Estimation.
- Theory, Practice and Visualization. New York: Wiley.
-
- Sheather, S. J. and M. C. Jones (1991). ``A reliable
- data-based bandwidth selection method for kernel den-
- sity estimation. J. Roy. Statist. Soc. B, 683-690.
-
- _S_e_e _A_l_s_o:
-
- convolve, hist.
-
- _E_x_a_m_p_l_e_s:
-
- # The Old Faithful geyser data
- data(faithful)
- d <- density(faithful$eruptions, bw=0.15)
- plot(d)
-
- plot(d, type="n")
- polygon(d, col="wheat")
-
-