sst: Singular Spectrum Trendline

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/sst.R

Description

Computes a trendline for univariate time series data using singular spectrum analysis.

Usage

1
sst(y, l = "automatic", m = "automatic")

Arguments

y

tsframe format data containing univariate time series data. More appropriate method for multivariate time series is msst.

l

window length; the string "automatic" automatic sets the default option
l = ceiling(y$n + 1) / 2.

m

number of leading eigentriples; the string "automatic" yields an automatic criterion for choosing m based on the cumulative periodogram of the residuals; see details.

Details

Singular spectrum analysis decompose time series data (y) into principal components, and a cumulative periodogram-based criterion learn about elementary reconstructed components (erc) that contribute to the signal. The trendline results from adding principal components selected by a cumulative periodogram-based criteria; see de Carvalho and Martos (2018, Section 4.1). The plot method yields the resulting trendlines along with the data; options for the plot method are give by a list including the strings "trendline", "components", "cpgram", and "screeplot", along with a set of values (ncomp) indicating the components on which these diagnostics are to be depicted (e.g. plot(fit, options = list(type = "components", ncomp = 1:3)).

Value

trendline

tsframe object with trendline estimation from targeted grouping based on a cumulative periodogram criterion (or according to the number of components specified in m).

l

window length.

m

number of leading eigentriples. An automatic criterion based on the cumulative periodogram of the residuals is provided by default by using the string "automatic".

residuals

tsframe object with the residuals from targeted grouping based on a cumulative periodogram criterion (or according to the number of components specified in m).

svd

Singular value decomposition corresponding to the trajectory matrix.

erc

elementary reconstructed components.

observations

tsframe object with the raw data.

Author(s)

Gabriel Martos and Miguel de Carvalho

References

de Carvalho, M. and Martos, G. (2020). Brexit: Tracking and disentangling the sentiment towards leaving the EU. International Journal of Forecasting, 36, 1128–1137.

See Also

See msst for a version of the routine for multivariate time series, and see msstc for a version of the routine for multivariate time series of compositional data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## BREXIT DATA EXAMPLE
data(brexit); attach(brexit)
l <- tsframe(date, brexit[, 1] / 100) # l = leave
fit <- sst(l); 
fit$m; fit$l # Number of ERC and parameter l in the model.
plot(fit, col = "red", lwd = 3, xlab = 'Time', ylab = 'Leave')
points(date, brexit[, 1] / 100, pch = 20)

## Scree-plot
plot(fit, options = list(type = "screeplot", ncomp = 1:10,
                         series.names = c('Leave')), type = "b", pch = 20, lwd = 2)


## Plot cumulative periodogram
par(mfrow=c(1,1), mar=c(4,2,1,1))
plot(fit, options = list(type = "cpgram", series.names = c('Leave')) )

## Elementary Reconstructed Components (ERC) plot:
plot(fit, options = list(type = "components", ncomp = 1:2))

ASSA documentation built on Nov. 20, 2020, 5:10 p.m.

Related to sst in ASSA...