Rev 7002 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{stl}\alias{stl}\alias{print.stl}\alias{plot.stl}\title{Seasonal Decomposition of Time Series by Loess}\usage{stl(x, s.window = NULL, s.degree = 0, t.window = NULL, t.degree = 1,robust = FALSE, na.action = na.fail)}\arguments{\item{x}{A univariate time series to be decomposed.This should be an object of class \code{"ts"} with a frequencygreater than one.}\item{s.window}{Either the string \code{"periodic"} or the span (inlags) of the loess window for seasonal extraction, which shouldbe odd. This has no default.}\item{s.degree}{Degree of locally-fitted polynomial in seasonalextraction. Should be zero or one.}\item{t.window}{The span (in lags) of the loess window for trendextraction, which should be odd. There is a reasonabledefault.}\item{t.degree}{Degree of locally-fitted polynomial in trendextraction. Should be zero or one.}\item{robust}{Should robust fitting be used in the \code{loess}procedure?}\item{na.action}{Action on missing values.}}\description{Decompose a time series into seasonal, trend and irregularcomponents.}\details{The seasonal component is found by \emph{loess} smoothing theseasonal sub-series (the series of all January values, \ldots); if\code{s.window = "periodic"} smoothing is effectively replaced bytaking the mean. The seasonal values are removed, and the remaindersmoothed to find the trend. The overall level is removed from theseasonal component and added to the trend component. This process isiterated a few times. The \code{remainder} component is theresiduals from the seasonal plus trend fit.}\value{An object of class \code{"stl"} with components\item{time.series}{a multiple time series with columns\code{seasonal}, \code{trend} and \code{remainder},}\item{weights}{the final robust weights (all one if fitting is notdone robustly,}\item{call}{the matched call.}}\references{R. B. Cleveland, W. S. Cleveland, J.E. McRae, and I. Terpenning(1990).STL: A Seasonal-Trend Decomposition Procedure Based on Loess.\emph{Journal of Official Statistics}, \bold{6}, 3-73.}\author{B.D. Ripley; Fortran code by Cleveland \emph{et al.} (1990) from\file{netlib}.}\note{This is similar to but not identical to the \code{stl} function inS-PLUS. The \code{remainder} component given by S-PLUS is the sum ofthe \code{trend} and \code{remainder} series from this function.}\seealso{\code{\link{loess}} in package \file{modreg} (which is notactually used in \code{stl}).}\examples{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))}\keyword{ts}