lpepa                package:lpridge                R Documentation

_L_o_c_a_l _p_o_l_y_n_o_m_i_a_l _r_e_g_r_e_s_s_i_o_n _f_i_t_t_i_n_g _w_i_t_h _E_p_a_n_e_c_h_n_i_k_o_v _w_e_i_g_h_t_s

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

     Fast and stable algorithm for nonparametric estimation of
     regression functions and their derivatives via *l*ocal
     *p*olynomials with *Epa*nechnikov weight function.

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

     lpepa(x, y, bandwidth, deriv = 0, n.out = 200, x.out = NULL,
           order = deriv+1, mnew = 100, var = FALSE)

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

       x: vector of design points, not necessarily ordered.

       y: vector of observations of the same length as 'x'.

bandwidth: bandwidth(s) for nonparametric estimation.  Either a number
          or a vector of the same length as 'x.out'.

   deriv: order of derivative of the regression function to be
          estimated; defaults to 'deriv = 0'.

   n.out: number of output design points where the function has to be
          estimated.  The default is 'n.out=200'.

   x.out: vector of output design points where the function has to be
          estimated.  The default value is an equidistant grid of
          'n.out' points from min(x) to max(x).

   order: integer, order of the polynomial used for local polynomials. 
          Must be <= 10 and defaults to 'order = deriv+1'.

    mnew: integer forcing to restart the algorithm after 'mnew'
          updating steps. The default is 'mnew = 100'.  For 'mnew = 1'
          you get a numerically ``super-stable'' algorithm (see
          reference SBE&G below).

     var: logical flag: if 'TRUE', the variance of the estimator
          proportional to the residual variance is computed (see
          details).

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

     More details are described in the first reference SBE&G (1994)
     below.  In S&G, a bad finite sample behaviour of local polynomials
     for random designs was found. For practical use, we therefore
     propose local polynomial regression fitting with ridging, as
     implemented in the function 'lpridge'.  In 'lpepa', several
     parameters described in SBE&G are fixed either in the fortran
     routine or in the R-function.  There, you find comments how to
     change them.

     For 'var=TRUE', the variance of the estimator proportional to the
     residual variance is computed, i.e., the exact finite sample
     variance of the regression estimator is 'var(est) = est.var *
     sigma^2'.

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

     a list including used parameters and estimator. 

       x: vector of ordered design points.

       y: vector of observations ordered according to x.

bandwidth: vector of bandwidths actually used for nonparametric
          estimation.

   deriv: order of derivative of the regression function estimated.

   x.out: vector of ordered output design points.

   order: order of the polynomial used for local polynomials.

    mnew: force to restart the algorithm after mnew updating steps.

     var: logical flag: whether the variance of the estimator was
          computed.

     est: estimator of the derivative of order deriv of the regression
          function.

 est.var: estimator of the variance of est (proportional to residual
          variance).

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

     See also <URL: http://www.unizh.ch/biostat/> under 'Manuscripts'
     etc.

     - Numerical stability and computational speed: 
      B. Seifert, M. Brockmann, J. Engel and T. Gasser (1994) Fast
     algorithms for nonparametric curve estimation. _J. Computational
     and Graphical Statistics_ *3*, 192-213.

     - Statistical properties: 
      Seifert, B. and Gasser, T. (1996) Finite sample variance of local
     polynomials: Analysis and solutions. _J. American Statistical
     Association_ *91*(433), 267-275.

     Seifert, B. and Gasser, T. (2000) Data adaptive ridging in local
     polynomial regression.  _J. Computational and Graphical
     Statistics_ *9*, 338-360.

     Seifert, B. and Gasser, T. (1998) Ridging Methods in Local
     Polynomial Regression. in: S. Weisberg (ed), _Dimension Reduction,
     Computational Complexity, and Information_, Vol.*30* of Computing
     Science & Statistics, Interface Foundation of North America,
     467-476.

     Seifert, B. and Gasser, T. (1998) Local polynomial smoothing. in:
     _Encyclopedia of Statistical Sciences_, Update Vol.*2*, Wiley,
     367-372.

     Seifert, B., and Gasser, T. (1996) Variance properties of local
     polynomials and ensuing modifications. in: _Statistical Theory and
     Computational Aspects of Smoothing_, W. Hrdle, M. G. Schimek
     (eds), Physica, 50-127.

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

     'lpridge', and also 'lowess' and 'loess' (in package *modreg*)
     which do local linear and quadratic regression quite a bit
     differently.

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

     data(cars)
     attach(cars)

     epa.sd <- lpepa(speed,dist, bandw=5)            # local polynomials

     plot(speed, dist, main = "data(cars) & lp epanechnikov regression")
     lines(epa.sd$x.out, epa.sd$est,  col="red")
     lines(lowess(speed,dist, f= .5), col="orange")
     detach()

