-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathstl.doc
62 lines (62 loc) · 3.53 KB
/
stl.doc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
PURPOSE
STL decomposes a time series into seasonal and trend components.
It returns the components and robustness weights.
SYNOPSIS
stl(y, n, np, ns, nt, nl, isdeg, itdeg, ildeg, nsjump, ntjump,
nljump, ni, no, rw, season, trend, work)
integer n, np, ns, nt, nl, isdeg, itdeg, ildeg, nsjump, ntjump,
nljump, ni, no
real y(n), rw(n), season(n), trend(n), work(n+2*np,5)
ARGUMENTS
y input, time series to be decomposed.
n input, number of values in y.
np input, the period of the seasonal component. For example,
if the time series is monthly with a yearly cycle, then
np=12.
ns input, length of the seasonal smoother. The value of ns
should be an odd integer greater than or equal to 3; ns>6
is recommended. As ns increases the values of the
seasonal component at a given point in the seasonal cycle
(e.g., January values of a monthly series with a yearly
cycle) become smoother.
nt input, length of the trend smoother. The value of nt
should be an odd integer greater than or equal to 3; a
value of nt between 1.5*np and 2*np is recommended. As
nt increases the values of the trend component become
smoother.
nl input, length of the low-pass filter. The value of nl
should be an odd integer greater than or equal to 3; the
smallest odd integer greater than or equal to np is
recommended.
isdeg input, degree of locally-fitted polynomial in seasonal
smoothing. The value is 0 or 1.
itdeg input, degree of locally-fitted polynomial in trend
smoothing. The value is 0 or 1.
ildeg input, degree of locally-fitted polynomial in low-pass
smoothing. The value is 0 or 1.
nsjump input, skipping value for seasonal smoothing. The
seasonal smoother skips ahead nsjump points and then
linearly interpolates in between. The value of nsjump
should be a positive integer; if nsjump=1, a seasonal
smooth is calculated at all n points. To make the
procedure run faster, a reasonable choice for nsjump is
10%-20% of ns.
ntjump input, skipping value for trend smoothing.
nljump input, skipping value for the low-pass filter.
ni input, number of loops for updating the seasonal and
trend components. The value of ni should be a positive
integer. See the next argument for advice on the choice
of ni.
no input, number of iterations of robust fitting. The value
of no should be a nonnegative integer. If the data are
well behaved without outliers, then robustness iterations
are not needed. In this case set no=0, and set ni=2 to 5
depending on how much security you want that the
seasonal-trend looping converges. If outliers are
present then no=3 is a very secure value unless the
outliers are radical, in which case no=5 or even 10 might
be better. If no>0 then set ni to 1 or 2.
rw output, final robustness weights. All rw are 1 if no=0.
season output, seasonal component.
trend output, trend component.
work workspace of (n+2*np)*5 locations.