accessors: Accessor functions for elements of an stl and stlplus object

Description Usage Arguments Value Note References See Also Examples

Description

Retrieves the raw, seasonal, trend, remainder, or time components from an stlplus object. The methods seasonal.stl, ... also exist as a convenience for extracting components from R's stl().

Usage

 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
seasonal(object)

trend(object)

remainder(object)

getraw(object)

## S3 method for class 'stlplus'
remainder(object)

## S3 method for class 'stlplus'
fitted(object, ...)

## S3 method for class 'stlplus'
predict(object, ...)

## S3 method for class 'stlplus'
seasonal(object)

## S3 method for class 'stlplus'
trend(object)

fc(object, fcnum = 1)

## S3 method for class 'stlplus'
time(x, ...)

## S3 method for class 'stl'
remainder(object)

## S3 method for class 'stl'
seasonal(object)

## S3 method for class 'stl'
trend(object)

## S3 method for class 'stl'
time(x, ...)

## S3 method for class 'stl'
predict(object, ...)

## S3 method for class 'stl'
fitted(object, ...)

Arguments

fcnum

number of post-trend smoothing frequency component.

x, object

object of class "stl" or "stlplus".

...

additional parameters

Value

Returns a vector of either the getraw time series, the seasonal, trend, or remainder components, or the time values of the time series. If times are requested but were not supplied in the initial stlplus call, the 1:n vector is returned, where n is the number of data points. The fitted method returns the sum of the seasonal and trend.

Note

The fitted and predict methods are equivalent. For objects of class "stlplus", these functions return the sum of all components but the remainder, including post-trend smoothing components. Note also that the trend method for objects of class "stlplus" only returns the trend component from the STL iterations, even when post-trend smoothing is done.

References

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.

See Also

stlplus

Examples

1
2
3
4
co2.stl <- stlplus(co2, t = as.vector(stats::time(co2)), n.p=12, l.window=13,
t.window=19, s.window=35, s.degree=1, sub.labels = substr(month.name, 1, 3))

plot(seasonal(co2.stl))

stlplus documentation built on May 2, 2019, 6:10 a.m.