decomp: Decomposition of series

Description Usage Arguments Value Author(s) Examples

View source: R/decomp.R

Description

Decompose series into its components.

Usage

1
2
3
decomp(y,m=NULL,s=NULL,trend=NULL,outplot=c(FALSE,TRUE),
       decomposition=c("multiplicative","additive"),
       h=0,type=c("mean","median","pure.seasonal"),w=NULL)

Arguments

y

Vector of target data, can be ts object.

m

Seasonal period. If y is a ts object then the default is its frequency.

s

Starting period in the season. If y is a ts object then default is read.

trend

Vector of level/trend of the time series. If NULL then it is calculated using CMA.

outplot

If TRUE provide a plot of the decomposed components.

decomposition

Type of seasonal decomposition: "multiplicative" or "additive".

h

Forecast horizon for seasonal component.

type

Type of calculation for seasonal component: "mean" - The mean of each seasonal period; "median" - The median of each seasonal period; "pure.seasonal" - Model using a pure seasonal model.

w

Percentage or number of observations to winsorise in the calculation of mean seasonal indices. If w>1 then it is the number of observations, otherwise it is a percentage. If type != "mean" then this is ignored.

Value

trend

Trend component.

season

Seasonal component.

irregular

Irregular component.

f.season

Forecasted seasonal component if h>0.

g

Purse seasonal model parameters.

Author(s)

Nikolaos Kourentzes

Examples

1

trnnick/TStools documentation built on Aug. 12, 2018, 4:31 a.m.