ewmaSmooth                package:qcc                R Documentation

_E_W_M_A _s_m_o_o_t_h_i_n_g _f_u_n_c_t_i_o_n

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

     Compute Exponential Weighted Moving Average.

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

     ewmaSmooth(x, y, lambda = 0.2, start, ...)

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

       x: a vector of x-values.

       y: a vector of y-values.

  lambda: the smoothing parameter.

   start: the starting value.

     ...: 

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

     EWMA function smooths a series of data based on a moving average
     with weights which decay exponentially.

     For each y_t value the smoothed value is computed as

                z_t = lambda y_t + (1-lambda) z_{t-1}

     where 0 <= lambda <= 1 is the parameter which controls the weights
     applied.

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

     Returns a list with elements: 

       x: ordered x-values

       y: smoothed y-values

  lambda: the smoothing parameter

   start: the starting value

_A_u_t_h_o_r(_s):

     Luca Scrucca luca@stat.unipg.it

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

     Montgomery, D.C. (2000) _Introduction to Statistical Quality
     Control_, 4th ed. New York: John Wiley & Sons. 
      Wetherill, G.B. and Brown, D.W. (1991) _Statistical Process
     Control_. New York: Chapman & Hall.

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

     'qcc', 'cusum'

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

     x <- 1:50
     y <- rnorm(50, sin(x/5), 0.5)
     plot(x,y)
     lines(ewmaSmooth(x,y,lambda=0.1), col="red")

