

stl {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 irreg-
     ular 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 fre-
          quency greater than one.

s.window: Either the 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 rea-
          sonable 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' pro-
          cedure?

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 effec-
     tively 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 pro-
     cess is iterated a few times.  The `remainder' compo-
     nent 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' func-
     tion 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  Decomposi-
     tion  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))

