ssa: Fit SSA model to a time series

Description Usage Arguments Value Author(s) Examples

Description

Fit a Singular Spectrum Analysis (SSA) model to a univariate time series. This function provides options for interactively choosing the number of components to retain, controlling verbosity of the output, and producing diagnostic and other plots.

Usage

1
2
3
ssa(tsdata, window, train.periods,
    q = NULL, prop.var.exp = NULL,
    verbose = FALSE, plot = FALSE)

Arguments

tsdata

A vector containing univariate time series data.

window

Window length for the SSA model. Should be a value between 2 and half the length of the time series.

train.periods

Number of data points (at the start of the time series) used for training the SSA model.

q

Number of SSA components to retain for modelling purposes, if known in advance. Ignored if prop.var.exp is specified.

prop.var.exp

Required minimum proportion of variation accounted for by the SSA model. Should be a value in the range (0, 1].

verbose

Logical (TRUE/FALSE). Should modelling statistics be shown in the console?

plot

Logical (TRUE/FALSE). Should modelling related plots be shown?

Value

Returns a list with the components:

tsdata

Original time series data.

fitted

Fitted/predicted values from the SSA model.

values

Singular values.

vectors

Singular vectors.

q

Number of components retained in SSA model.

projmat

Projection matrix for the SSA model.

rowmeans

Row means of the training data trajectory matrix.

Author(s)

Theo Pepler

Examples

1
2
3
4
5
x <- rpois(n = 120, lambda = 20)
ssa(tsdata = x, window = 12, train.periods = 60, verbose = TRUE, plot = TRUE)

# NOT RUN --- Example where proportion variation is specified
# ssa(tsdata = x, window = 12, train.periods = 60, prop.var.exp = 0.8, verbose = TRUE, plot = TRUE)

tpepler/ssaCUSUM documentation built on May 31, 2019, 6:48 p.m.