stl                    package:ts                    R Documentation

_S_e_a_s_o_n_a_l _D_e_c_o_m_p_o_s_i_t_i_o_n _o_f _T_i_m_e _S_e_r_i_e_s _b_y _L_o_e_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     Decompose a time series into seasonal, trend and irregular
     components.

_U_s_a_g_e:

     stl(x, s.window = NULL, s.degree = 0, t.window = NULL, t.degree = 1,
         robust = FALSE, na.action = na.fail)

_A_r_g_u_m_e_n_t_s:

       x: A univariate time series to be decomposed. This should be an
          object of class `"ts"' with a frequency greater than one.

s.window: Either the character string `"periodic"' or the span (in
          lags) of the loess window for seasonal extraction, which
          should be odd.  This has no default.

s.degree: Degree of locally-fitted polynomial in seasonal extraction. 
          Should be zero or one.

t.window: The span (in lags) of the loess window for trend extraction,
          which should be odd.  There is a reasonable default.

t.degree: Degree of locally-fitted polynomial in trend extraction. 
          Should be zero or one.

  robust: Should robust fitting be used in the `loess' procedure?

na.action: Action on missing values.

_D_e_t_a_i_l_s:

     The seasonal component is found by loess smoothing the seasonal
     sub-series (the series of all January values, ...); if `s.window =
     "periodic"' smoothing is effectively replaced by taking the mean.
     The seasonal values are removed, and the remainder smoothed to
     find the trend. The overall level is removed from the seasonal
     component and added to the trend component. This process is
     iterated a few times.  The `remainder' component is the residuals
     from the seasonal plus trend fit.

_V_a_l_u_e:

     An object of class `"stl"' with components 

time.series: a multiple time series with columns `seasonal', `trend'
          and `remainder'.

 weights: the final robust weights (all one if fitting is not done
          robustly).

    call: the matched call.

_N_o_t_e:

     This is similar to but not identical to the `stl' function in
     S-PLUS. The `remainder' component given by S-PLUS is the sum of
     the `trend' and `remainder' series from this function.

_A_u_t_h_o_r(_s):

     B.D. Ripley; Fortran code by Cleveland et al. (1990) from
     `netlib'.

_R_e_f_e_r_e_n_c_e_s:

     R. B. Cleveland, W. S. Cleveland, J.E.  McRae, and I. Terpenning
     (1990). STL:  A  Seasonal-Trend  Decomposition  Procedure Based on
     Loess. Journal of Official Statistics, 6, 3-73.

_S_e_e _A_l_s_o:

     `loess' in package `modreg' (which is not actually used in `stl').

_E_x_a_m_p_l_e_s:

     data(nottem)
     plot(stl(nottem, "per"))
     data(co2)
     plot(stl(log(co2), s.window=21))
     ## linear trend, strict period.
     plot(stl(log(co2), s.window="per", t.window=1000))

