sst {ASSA} | R Documentation |
Singular Spectrum Trendline
Description
Computes a trendline for univariate time series data using singular spectrum analysis.
Usage
sst(y, l = "automatic", m = "automatic")
Arguments
y |
tsframe format data containing univariate time series data.
More appropriate method for multivariate time series is |
l |
window length; the string |
m |
number of leading eigentriples; the string |
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 |
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 |
residuals |
tsframe object with the residuals from targeted
grouping based on a cumulative periodogram criterion (or according
to the number of components specified in |
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
## 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))