stl(time.series, ss.window = NULL, ss.degree = 0, ss.robust = F, s.window = NULL, s.degree = 2, fc.window = NULL, fc.degree = 2, control, ...)
"periodic"
, an exactly periodic seasonal
component is returned. If the argument is numeric, it specifies the
length of the window in the loess smoothing for each seasonal subseries
in phase one of the decomposition. This must be an odd integer. A seasonal subseries consists of the
values of the seasonal component at a given position in
the seasonal cycle (e.g., January values of a
monthly series with a yearly cycle); the number of subseries
is
frequency(time.series)
.
As
ss.window
increases, each subseries becomes smoother.
If missing, no seasonal component is computed.
TRUE
, a robust fitting procedure is used in phase one.
time.series
; if not, the
procedure begins with
time.series
. A frequency component
is computed by a loess fit with the window length
equal to the first element of
fc.window
, the component is removed,
another component is computed with
the window length equal to the second element of
fc.window
, and
so forth. In most cases, the values of the argument should be decreasing,
that is, the frequency bands of the fitted components should increase.
If the argument
ss.robust
is
TRUE
, the robustness weights from the phase one
seasonal fit are used as weights in the loess fitting.
fc.window
.
Values of 1 and 2 are allowed.
If the length of
fc.degree
is less than that of
fc.window
, the former is expanded to
the length of the latter using
rep
; thus, giving the value 1 specifies
a degree of 1 for all components.
stl.control
, whose
documentation describes the options. Most users do not need to alter the
default values for these parameters.
stl.control
can also be specified
directly in the call to
stl
without using the argument
control
.
See help file for
stl.control
for details.
"stl"
representing the fitted model.
There are methods for these objects including
print.stl
,
plot.stl
,
and
specs.stl
. The object is a list whose components include
the computed frequency components as time series with the same
attributes as
time.series
. The names of these components are
included in the printing of
print.stl
, and the components together
with the series are graphed by
plot.stl
.
specs.stl
can be used to recall the specifications used to compute an
object of class
stl
. Some of these values may be slightly different
from the input values given the algorithm requirements.
stl
carries out a decomposition of a time series into frequency components
of variation by a sequence of loess smoothings. In phase one, the backfitting
algorithm produces a seasonal component with a period equal to that
of
frequency(time.series)
. The subseries of this component are smooth
though time; that is, for a monthly series with period 12, the January
values are smooth, the February values are smooth and so forth. But the
values by design do not have to be smooth from one month to the next.
If this is desired, the phase-one seasonal is replaced by a smoothing of it in
the first step of phase two. The seasonal
is subtracted from
time.series
and other
frequency components are computed sequentially.
stl
is a replacement
for the
sabl
procedure.
Cleveland, R. B., Cleveland, W. S., McRae, J. E. and Terpening, I. (1990). STL: A Seasonal-Trend Decomposition Procedure Based on Loess. Journal of Official Statistics, 6, 3-73.
stl(co2, ss.window = 17, fc.window = c(101, 25), fc.degree = c(1, 2)) # produces the following output: Call: stl(time.series = co2, ss.window = 17, fc.window = c(101, 25), fc.degree = c(1, 2)) Frequency components of stl object: fc.101 fc.25 seasonal remainder