seasonal

0th

Percentile

Extract components from a time series decomposition

Returns a univariate time series equal to either a seasonal component, trend-cycle component or remainder component from a time series decomposition.

Keywords
ts
Usage
seasonal(object)

trendcycle(object)

remainder(object)

Arguments
object

Object created by decompose, stl or tbats.

Value

Univariate time series.

See Also

stl, decompose, tbats, seasadj.

Aliases
  • seasonal
  • trendcycle
  • remainder
Examples
# NOT RUN {
plot(USAccDeaths)
fit <- stl(USAccDeaths, s.window="periodic")
lines(trendcycle(fit),col="red")

library(ggplot2)
autoplot(cbind(
	    Data=USAccDeaths,
	    Seasonal=seasonal(fit),
  	  Trend=trendcycle(fit),
	    Remainder=remainder(fit)),
    facets=TRUE) +
  ylab("") + xlab("Year")

# }
Documentation reproduced from package forecast, version 8.3, License: GPL-3

Community examples

Looks like there are no examples yet.