

nkden(funfits)                               R Documentation

_N_o_r_m_a_l _k_e_r_n_e_l _d_e_n_s_i_t_y _e_s_t_i_m_a_t_e

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

     nkden(data, bandwidth, n.points, grid)

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

    data: A vector or matrix of oberservations. Rows are
          considerd to be independent random samples from a
          continous distribution.

bandwidth: The bandwidht for the kernels estimates in the
          scale of standard deviation for the normal den-
          sity.

n.points: Number of equally spaced points to evaluate a uni-
          variate density estimate.

    grid: A vector or matrix of values to evaluate the esti-
          mate.The defautl is to use the data.

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

     A list where x is the points used for evaluation, y the
     density estimates at these points and bandwidths and h
     the vector of bandwidths. If more than one bandwidth is
     given then the estimates are arranged as columns in the
     matrix y.

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

     nkreg, nkden.cv, ksmooth

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

     # univariate estimate with several bandwidths

     nkden( minitri$swim, c(2.0,4.0,6.0),n.points=150)-> look
     matplot( look$x, look$y, type="l") # plot all of them togther

     # a bivariate estimate

     nkden( minitri[,1:2], 2.0) -> look2
     # create gridded surface from values at data points.

     interp( look2$x[,1], look2$x[,2], look2$y) -> surface
     persp(surface, xlab="swim", ylab="bike")

