initialize_weightvector: Initialize weightvector for iterative ForeCA algorithms

Description Usage Arguments Details Value Examples

View source: R/initialize_weightvector.R

Description

initialize_weightvector returns a unit norm (in \ell^2) vector \mathbf{w}_0 \in R^K that can be used as the starting point for any iterative ForeCA algorithm, e.g., foreca.EM.one_weightvector. Several quickly computable heuristics are available via the method argument.

Usage

1
2
3
4
5
6
7
8
9
initialize_weightvector(
  U = NULL,
  f.U = NULL,
  num.series = ncol(U),
  method = c("rnorm", "max", "SFA", "PCA", "rcauchy", "runif", "SFA.slow", "SFA.fast",
    "PCA.large", "PCA.small"),
  seed = sample(1e+06, 1),
  ...
)

Arguments

U

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

f.U

multivariate spectrum of class 'mvspectrum' with normalize = TRUE.

num.series

positive integer; number of time series K (determines the length of the weightvector). If num.series = 1 it simply returns a 1 \times 1 array equal to 1.

method

string; which heuristics should be used to generate a good starting \mathbf{w}_0? Default: "rnorm"; see Details.

seed

non-negative integer; seed for random initialization which will be returned for reproducibility. By default it sets a random seed.

...

additional arguments

Details

The method argument specifies the heuristics that is used to get a good starting vector \mathbf{w}_0:

Each vector has length K and is automatically normalized to have unit norm in \ell^2.

For the 'SFA*' methods see sfa. Note that maximizing (or minimizing) the lag 1 auto-correlation does not necessarily yield the most forecastable signal, but it's a good start.

Value

numeric; a vector of length K with unit norm in \ell^2.

Examples

1
2
3
4
5
6
XX <- diff(log(EuStockMarkets))
## Not run: 
initialize_weightvector(U = XX, method = "SFA")

## End(Not run)
initialize_weightvector(num.series = ncol(XX), method = "rnorm")

ForeCA documentation built on July 1, 2020, 7:50 p.m.