loessFit                package:limma                R Documentation

_F_a_s_t _S_i_m_p_l_e _L_o_e_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     A fast version of locally weighted regression when there is only
     one x-variable and only the fitted values and residuals are
     required.

_U_s_a_g_e:

     loessFit(y, x, weights=NULL, span=0.3, bin=0.01/(2-is.null(weights)), iterations=4)

_A_r_g_u_m_e_n_t_s:

       y: numeric vector of response values.  Missing values are
          allowed.

       x: numeric vector of predictor values  Missing values are
          allowed.

 weights: numeric vector of non-negative weights.  Missing values are
          allowed.

    span: numeric parameter between 0 and 1 specifying proportion of
          data to be used in the local regression moving window. Larger
          numbers give smoother fits.

     bin: numeric value between 0 and 1 giving the proportion of the
          data which can be grouped in a single bin when doing local
          regression fit. 'bin=0' forces an exact local regression fit
          with no interpolation.

iterations: number of iterations of loess fit

_D_e_t_a_i_l_s:

     This function is a low-level equivalent to 'lowess' in the base
     library if 'weights' is null and to 'loess' in the modreg package
     otherwise. It is used by 'normalizeWithinArrays'. The parameters
     'span', 'cell' and 'iterations' have the same meaning as in
     'loess'. 'span' is equivalent to the argument 'f' to 'lowess' and
     'iterations' is equivalent to 'iter+1'. Unlike 'lowess' this
     function returns values in original rather than sorted order.

     The parameter 'bin' is equivalent to 'delta=bin*diff(range(x))' in
     a call to 'lowess' when 'weights=NULL' or to 'cell=bin/span' in a
     call to 'loess' when 'weights' are given.

     The treatment of missing values is analogous to 'na.exclude'.

_V_a_l_u_e:

     A list with components 

  fitted: numeric vector of same length as 'y' giving the loess fit

residuals: numeric vector of same length as 'x' giving residuals from
          the fit

_A_u_t_h_o_r(_s):

     Gordon Smyth

_S_e_e _A_l_s_o:

     An overview of LIMMA functions for normalization is given in
     4.Normalization.

     See also 'lowess' in the base library and 'loess' in the modreg
     package.

_E_x_a_m_p_l_e_s:

     y <- rnorm(1000)
     x <- rnorm(1000)
     w <- rep(1,1000)
     # The following are equivalent apart from execution time
     system.time(fit <- loessFit(y,x)$fitted)
     system.time(fit <- loessFit(y,x,w)$fitted)
     system.time(fit <- fitted(loess(y~x,weights=w,span=0.3,family="symmetric",iterations=4)))
     # Similar but with sorted x-values
     system.time(fit <- lowess(x,y,f=0.3)$y)

