nkreg                 package:fields                 R Documentation

_N_o_r_m_a_l _k_e_r_n_e_l _r_e_g_r_e_s_s_i_o_n _e_s_t_i_m_a_t_e

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

     Estimates a univariate or multivariate regression surface  using a
     normal kernel function and a fixed bandwidth.

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

     nkreg(data.x, data.y, bandwidth, n.points=50, grid=NULL, grid.list=NULL)

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

 data.x : a matrix of data locations 

 data.y : a vector of values for smoothing  

bandwidth: bandwidth for kernel if a vector then an estimate will be be
          found for each  bandwidth.  

n.points : Number of equally spaced points to evaluate a univariate
          estimate  estimate or a 2-d estimate on a regular grid.  

    grid: matrix of locations to evaluate the kernel estimate 

grid.list : A grid.list that describes the regular grid to evaluate the
          estimate. If it is missing the default for 2-d is to create a
          grid  

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

       x: Points for evaluation 

       y: estimate of curve or surface. If more than one bandwidth is
          supplied then  y is matrix with columns indexed by the
          bandwidth values 

       h: bandwidths used.  

grid.list: grid.list that was either passed or created.  

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

     Tps, Krig, sreg, smooth.2d, image.smooth

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

     out<- nkreg( rat.diet$t, rat.diet$con, bandwidth=3, n.points=100)
     plot( rat.diet$t, rat.diet$con)
     lines( out$x, out$y)

     # 2-d example evaluate at 40 points
     out<- nkreg( precip$x, precip$y, bandwidth=.5, n.points=64)
     image.plot( as.surface(out$x, out$y))

