predict.loess             package:stats             R Documentation

_P_r_e_d_i_c_t _L_o_e_s_s _C_u_r_v_e _o_r _S_u_r_f_a_c_e

_D_e_s_c_r_i_p_t_i_o_n:

     Predictions from a 'loess' fit, optionally with standard errors.

_U_s_a_g_e:

     ## S3 method for class 'loess':
     predict(object, newdata = NULL, se = FALSE, ...)

_A_r_g_u_m_e_n_t_s:

  object: an object fitted by 'loess'.

 newdata: an optional data frame specifying points at which to do the
          predictions. If missing, the original data points are used.

      se: should standard errors be computed?

     ...: arguments passed to or from other methods.

_D_e_t_a_i_l_s:

     The standard errors calculation is slower than prediction.

     When the fit was made using 'surface="interpolate"' (the default),
     'predict.loess' will not extrapolate - so points outside an
     axis-aligned hypercube enclosing the original data will have
     missing ('NA') predictions and standard errors.

_V_a_l_u_e:

     If 'se = FALSE', a vector giving the prediction for each row of
     'newdata' (or the original data). If 'se = TRUE', a list
     containing components 

     fit: the predicted values.

      se: an estimated standard error for each predicted value.

residual.scale: the estimated scale of the residuals used in computing
          the standard errors.

      df: an estimate of the effective degrees of freedom used in
          estimating the residual scale, intended for use with t-based
          confidence intervals. 

     If 'newdata' was the result of a call to 'expand.grid', the
     predictions (and s.e.'s if requested) will be an array of the
     appropriate dimensions.

_A_u_t_h_o_r(_s):

     B.D. Ripley, based on the 'cloess' package of Cleveland, Grosse
     and Shyu.

_S_e_e _A_l_s_o:

     'loess'

_E_x_a_m_p_l_e_s:

     data(cars)
     cars.lo <- loess(dist ~ speed, cars)
     predict(cars.lo, data.frame(speed=seq(5, 30, 1)), se=TRUE)
     # to get extrapolation
     cars.lo2 <- loess(dist ~ speed, cars,
       control=loess.control(surface="direct"))
     predict(cars.lo2, data.frame(speed=seq(5, 30, 1)), se=TRUE)

