kde3d                 package:misc3d                 R Documentation

_C_o_m_p_u_t_e _a _T_h_r_e_e _D_i_m_e_n_s_i_o_n _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:

     Evaluates a three dimensional kernel density estimate using a
     Gaussian kernel with diagonal covariance matrix on a regular grid.

_U_s_a_g_e:

        kde3d(x, y, z, h, n = 20, lims = c(range(x), range(y), range(z)))

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

   x,y,z: 'x', 'y', and 'z' coordinates of the data.

       h: vector of three bandwidths for the density estimate; recycled
          if length is less than three; default is based on the normal
          reference bandwidth (see 'bandwidth.nrd').

       n: numbers of grid points to use for each dimension; recycled if
          length is less than three.

    lims: lower and upper limits on the region for which the density
          estimate is to be computed, provides as a vector of length 6,
          corresponding to low and high values of 'x', 'y', and 'z';
          recycled if only two values are supplied.

_V_a_l_u_e:

     A list of four components, 'x', 'y', 'z', and 'd'. 'x', 'y', and
     'z' are the coordinates of the grid points at which the density
     estimate has been evaluated, and 'd' is a three dimensional array
     of the estimated density values.

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

     Based on the function 'kde2d' in package 'MASS'.

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

     'kde2d'.

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

       with(quakes, {
           d <- kde3d(long, lat, -depth, n = 40)
           contour3d(d$d, exp(-12), d$x/22, d$y/28, d$z/640,
                     color = "green", color2 = "gray", scale=FALSE,
                     engine = "standard")
       })

