Description Usage Arguments Details Value Examples

View source: R/initialize_weightvector.R

`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.

1 2 3 |

`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 |

The `method`

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

`"max"`

vector with all*0*s, but a*1*at the position of the maximum forecastable series in`U`

.`"rcauchy"`

random start using`rcauchy(k)`

.`"rnorm"`

random start using`rnorm(k, 0, 1)`

.`"runif"`

random start using`runif(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 by`Omega`

..`"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 by`Omega`

.

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.

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

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 May 29, 2017, 9:09 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.