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 local polynomials
     with Epanechnikov weight function.

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

     lpepa(x, y, bandwidth, deriv = 0, n.out = 200, x.out = NULL,
           order = NULL, 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 reference SBE&G below.  In the
     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.

_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()

