initialize_weightvector {ForeCA} | R Documentation |
Initialize weightvector for iterative ForeCA algorithms
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
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 |
f.U |
multivariate spectrum of class |
num.series |
positive integer; number of time series |
method |
string; which heuristics should be used to generate a good starting |
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
:
"max"
vector with all0
s, but a1
at the position of the maximum forecastable series inU
."rcauchy"
random start usingrcauchy(k)
."rnorm"
random start usingrnorm(k, 0, 1)
."runif"
random start usingrunif(k, -1, 1)
."PCA.large"
first eigenvector of PCA (largest variance signal)."PCA.small"
last eigenvector of PCA (smallest variance signal)."PCA"
checks both small and large, and chooses the one with higher forecastability as computed byOmega
.."SFA.fast"
last eigenvector of SFA (fastest signal)."SFA.slow"
first eigenvector of SFA (slowest signal)."SFA"
checks both slow and fast, and chooses the one with higher forecastability as computed byOmega
.
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
XX <- diff(log(EuStockMarkets))
## Not run:
initialize_weightvector(U = XX, method = "SFA")
## End(Not run)
initialize_weightvector(num.series = ncol(XX), method = "rnorm")