decompose: Decompose a time series object

Description Usage Arguments Value Methods (by generic) References Examples

View source: R/decomposition.R

Description

Decompose a time series object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
decompose(
  obj,
  multiplicative = FALSE,
  t = 10,
  model.lim = NULL,
  data.name = NULL,
  ...
)

## S3 method for class 'inzdecomp'
plot(
  x,
  recompose.progress = c(0, 0),
  recompose = any(recompose.progress > 0),
  ylab = x$currVar,
  xlab = "Date",
  title = NULL,
  xlim = c(NA, NA),
  colour = c("#1B9E46", "#45a8ff", "orangered"),
  ...
)

Arguments

obj

an iNZightTS object

multiplicative

fit a multiplicative time series model?

t

the smoothing parameter

model.lim

limits for the time series model

data.name

the name of the data

...

additional arguments (ignored)

x

an inzdecomp object (from decompose(ts))

recompose.progress

if recompose is TRUE, this shows how much to show (for animation!). Length 2 numeric: the first is 0 for seasonal, and 1 for residual; second component is how many observations have been recomposed so far

recompose

logical as to whether the recomposition is shown or not

ylab

the label for the y axis

xlab

the label for the x axis

title

the title for the plot

xlim

the x axis limits

colour

vector of three colours for trend, seasonal, and residuals, respectively

Value

an inzdecomp object (this is the original object with an additional decompVars component)

Invisibly returns the original decomposition object. Mainly called to plot the decomposition.

Methods (by generic)

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, 3iV73.

Examples

1
2
3
t <- iNZightTS(visitorsQ)
decomp.ts <- decompose(t, data.name = "Visitors")
plot(decomp.ts)

iNZightTS documentation built on Feb. 1, 2022, 1:08 a.m.