decompose {ts} | R Documentation |
Classical Seasonal Decomposition by Moving Averages
Description
Decompose a time series into seasonal, trend and irregular components using moving averages. Deals with additive or multiplicative seasonal component.
Usage
decompose(x, type = c("additive", "multiplicative"))
Arguments
x |
A time series. |
type |
The type of seasonal component. |
Details
The additive model used is:
Y[t] = T[t] + S[t] + e[t]
The multiplicative model used is:
Y[t] = T[t] * S[t] + e[t]
Value
An object of class "decomposed.ts"
with following components:
seasonal |
The seasonal component (i.e., the repeated seasonal figure) |
figure |
The estimated seasonal figure only |
trend |
The trend component |
random |
The remainder part |
type |
The value of |
Note
The function stl
provides a much more sophisticated
decomposition.
Author(s)
David Meyer david.meyer@ci.tuwien.ac.at
See Also
stl
Examples
data(co2)
m <- decompose(co2)
m$figure
plot(m)