home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / density < prev    next >
Encoding:
Text File  |  1997-04-23  |  4.2 KB  |  129 lines

  1.     
  2.     _K_e_r_n_e_l _D_e_n_s_i_t_y _E_s_t_i_m_a_t_i_o_n
  3.     
  4.          density(x, n=512, kernel="gaussian", bw, adjust=1, width,
  5.                  from, to, cut=3)
  6.     
  7.          bw.ucv(x, samples=100)
  8.          bw.bcv(x, samples=100)
  9.          bw.sj(x, samples=100)
  10.     
  11.          print(dobj)
  12.          plot(dobj, ...)
  13.     
  14.     _A_r_g_u_m_e_n_t_s:
  15.     
  16.                x : the values for which the estimate is to be
  17.                    computed.
  18.     
  19.                n : the number of equally spaced points at which
  20.                    the density is to be estimated.  This is
  21.                    rounded up to the next power of 2, with a
  22.                    minimum value of 512.
  23.     
  24.           kernel : a character string giving the smoothing ker-
  25.                    nel to be used.  This must be one of "gaus-
  26.                    sian", "rectangular", "triangular", or
  27.                    "cosine", and may be abbrevited to a single
  28.                    letter.
  29.     
  30.               bw : the smoothing bandwith to be used.  This is
  31.                    the standard deviation of the smoothing ker-
  32.                    nel.  It defaults to 1.06 times the minimum
  33.                    of the standard deviation and the interquar-
  34.                    tile range divided by 1.34 times the sample
  35.                    size to the negative one fifth power.  The
  36.                    specified value of bw is multiplied by
  37.                    adjust.
  38.     
  39.           adjust : the bandwith used is actually adjust*bw.
  40.                    This makes it easy to specify values like
  41.                    ``half the default'' bandwidth.
  42.     
  43.            width : this exists for compatibility with S.
  44.     
  45.          from,to : the left and right-most points of the grid at
  46.                    which the density is to be estimated.
  47.     
  48.              cut : by default, the values of left and right are
  49.                    cut bandwiths beyond the extremes of the
  50.                    data.
  51.     
  52.          samples : the sample size to take in the bandwidth
  53.                    selection functions. If samples is non-
  54.                    positive, the entire data set is used.
  55.     
  56.             dobj : a ``density'' object.
  57.     
  58.              ... : plotting parameters.
  59.     
  60.     _D_e_s_c_r_i_p_t_i_o_n:
  61.     
  62.          The function density computes kernel density estimates
  63.          with the given kernel and bandwidth (which is the stan-
  64.          dard deviation of the kernel).
  65.     
  66.          The functions bw.ucv, bw.bcv and bw.sj provide
  67.          automated ways of selecting a bandwith for density
  68.          estimates (assuming a Gaussian kernel).  The techniques
  69.          used are as follows; bw.ucv uses unbiased cross-
  70.          validation, bw.bcv uses biased cross-validation and
  71.          bw.sj uses the technique of Sheather and Jones.  These
  72.          cross-validation techniques are based on code from the
  73.          Venables and Ripley MASS library.
  74.     
  75.          The generic functions plot and print have methods den-
  76.          sity objects.
  77.     
  78.          The algorithm used in density disperses the mass of the
  79.          empirical distribution function over a regular grid and
  80.          then uses the fast Fourier transform to convolve this
  81.          approximation with a discretized version of the kernel.
  82.     
  83.     _V_a_l_u_e_s:
  84.     
  85.          An object with class ``density''.  The underlying
  86.          structure is a list containing the following com-
  87.          ponents.
  88.     
  89.           x : the coordinates of the points where the density is
  90.               estimated.
  91.     
  92.           y : the estimated density values.
  93.     
  94.          bw : the bandwidth used.
  95.     
  96.        call : the call which produced the result.
  97.     
  98.        name : the deparsed name of the x argument.
  99.     
  100.     _R_e_f_e_r_e_n_c_e_s:
  101.     
  102.          Silverman, B. W. (1986).  Density Estimation.  London:
  103.          Chapman and Hall.
  104.     
  105.          Venables, W. N. and B. D. Ripley (1994).  Modern
  106.          Applied Statistics with S-Plus.  New York: Springer.
  107.     
  108.          Scott, D. W. (1992).  Multivariate Density Estimation.
  109.          Theory, Practice and Visualization.  New York: Wiley.
  110.     
  111.          Sheather, S. J. and M. C. Jones (1991).  ``A reliable
  112.          data-based bandwidth selection method for kernel den-
  113.          sity estimation.  J. Roy. Statist. Soc. B, 683-690.
  114.     
  115.     _S_e_e _A_l_s_o:
  116.     
  117.          convolve, hist.
  118.     
  119.     _E_x_a_m_p_l_e_s:
  120.     
  121.          # The Old Faithful geyser data
  122.          data(faithful)
  123.          d <- density(faithful$eruptions, bw=0.15)
  124.          plot(d)
  125.     
  126.          plot(d, type="n")
  127.          polygon(d, col="wheat")
  128.     
  129.