Learn R Programming

ForeCA (version 0.2.4)

sfa: Slow Feature Analysis

Description

sfa performs Slow Feature Analysis (SFA) on a \(K\)-dimensional time series with \(T\) observations.

Important: This implementation of SFA is just the most basic version; it is merely included here for convenience in initialize_weightvector. If you want to use SFA in R please use the rSFA package, which has many more advanced and efficient implementations of SFA. sfa() here corresponds to sfa1 in the rSFA package.

Usage

sfa(series, ...)

Arguments

series

a \(T \times K\) array with T observations from the \(K\)-dimensional time series \(\mathbf{X}_t\). Can be a matrix, data.frame, or a multivariate ts object.

...

additional arguments

Value

An object of class sfa which inherits methods from princomp. Signals are ordered from slowest to fastest.

Details

Slow Feature Analysis (SFA) finds slow signals (see References below), and can be quickly (and analytically) computed solving a generalized eigen-value problem. For ForeCA it is important to know that SFA is equivalent to finding the signal with largest lag \(1\) autocorrelation.

The disadvantage of SFA for forecasting is that, e.g., white noise (WN) is ranked higher than an AR(1) with negative autocorrelation coefficient \(\rho_1 < 0\). While it is true that WN is slower, it is not more forecastable. Thus we are also interested in the fastest signal, i.e., the last eigenvector. The so obtained fastest signal corresponds to minimizing the lag 1 auto-correlation (possibly \(\rho_1 < 0\)).

Note though that maximizing (or minimizing) the lag \(1\) auto-correlation does not necessarily yield the most forecastable signal (as measured by Omega), but it is a good start.

References

Laurenz Wiskott and Terrence J. Sejnowski (2002). “Slow Feature Analysis: Unsupervised Learning of Invariances”, Neural Computation 14:4, 715-770.

See Also

initialize_weightvector

Examples

Run this code
# NOT RUN {
XX <- diff(log(EuStockMarkets[-c(1:100),])) * 100
plot(ts(XX))
ss <- sfa(XX[,1:4])

summary(ss)
plot(ss)
plot(ts(ss$scores))
apply(ss$scores, 2, function(x) acf(x, plot = FALSE)$acf[2])
biplot(ss)

# }

Run the code above in your browser using DataLab