

bkde(KernSmooth)                             R Documentation

_C_o_m_p_u_t_e _a _B_i_n_n_e_d _K_e_r_n_e_l _D_e_n_s_i_t_y _E_s_t_i_m_a_t_e

_D_e_s_c_r_i_p_t_i_o_n_:

     Returns x and y coordinates of the binned kernel den-
     sity estimate of the probability density of the data.

_U_s_a_g_e_:

     bkde (x,kernel="normal",canonical=F,bandwidth,
           gridsize=401,range.x=range(x),truncate=T)

_A_r_g_u_m_e_n_t_s_:

       x: vector of observations from the distribution whose
          density is to be estimated.  Missing values are
          not allowed.

bandwidth: the kernel bandwidth smoothing parameter.  Larger
          values of `bandwidth' make smoother estimates,
          smaller values of `bandwidth' make less smooth
          estimates.

  kernel: character string which determines the smoothing
          kernel.  `kernel' can be: `"normal"' - the Gaus-
          sian density function (the default).  `"box"' - a
          rectangular box.  `"epanech"' - the centred
          beta(2,2) density.  `"biweight"' - the centred
          beta(3,3) density.  `"triweight"' - the centred
          beta(4,4) density.

canonical: logical flag: if TRUE, canonically scaled kernels
          are used.

gridsize: the number of equally spaced points at which to
          estimate the density.

 range.x: vector containing the minimum and maximum values
          of `x' at which to compute the estimate.  The
          default is the minimum and maximum data values.

truncate: logical flag: if `TRUE', data with `x' values out-
          side the range specified by `range.x' are ignored.

_V_a_l_u_e_:

     a list containing the following components:

       x: vector of sorted `x' values at which the estimate
          was computed.

       y: vector of density estimates at the corresponding
          `x'.

_D_e_t_a_i_l_s_:

     This is the binned approximation to the ordinary kernel
     density estimate.  Linear binning is used to obtain the
     bin counts.  For each `x' value in the sample, the ker-
     nel is centered on that `x' and the heights of the ker-
     nel at each datapoint are summed.  This sum, after a
     normalization, is the corresponding `y' value in the
     output.

_B_A_C_K_G_R_O_U_N_D_:

     Density estimation is a smoothing operation.
     Inevitably there is a trade-off between bias in the
     estimate and the estimate's variability: large band-
     widths will produce smooth estimates that may hide
     local features of the density; small bandwidths may
     introduce spurious bumps into the estimate.

_R_e_f_e_r_e_n_c_e_s_:

     Wand, M. P. and Jones, M. C. (1995).  Kernel Smoothing.
     Chapman and Hall, London.

_S_e_e _A_l_s_o_:

     `density', `dpik', `hist', `ksmooth'.

_E_x_a_m_p_l_e_s_:

     data(geyser)
     x <- geyser$duration
     est <- bkde(x,bandwidth=0.25)
     plot(est,type="l")

