Description Usage Arguments Value Warning References Examples

`foreca`

performs Forecastable Component Analysis (ForeCA) on
*\mathbf{X}_t* – a *K*-dimensional time series with *T*
observations. Users should only call
`foreca`

, rather than `foreca.one_weightvector`

or
`foreca.multiple_weightvectors`

.

`foreca.one_weightvector`

is a wrapper around several algorithms that
solve the ForeCA optimization problem for a single weightvector *\mathbf{w}_i*
and whitened time series *\mathbf{U}_t*.

`foreca.multiple_weightvectors`

applies `foreca.one_weightvector`

iteratively to *\mathbf{U}_t* in order to obtain multiple weightvectors
that yield most forecastable, uncorrelated signals.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
foreca(series, n.comp = 2, algorithm.control = list(type = "EM"), ...)
foreca.one_weightvector(
U,
f.U = NULL,
spectrum.control = list(),
entropy.control = list(),
algorithm.control = list(),
keep.all.optima = FALSE,
dewhitening = NULL,
...
)
foreca.multiple_weightvectors(
U,
spectrum.control = list(),
entropy.control = list(),
algorithm.control = list(),
n.comp = 2,
plot = FALSE,
dewhitening = NULL,
...
)
``` |

`series` |
a |

`n.comp` |
positive integer; number of components to be extracted.
Default: |

`algorithm.control` |
list; control settings for any |

`...` |
additional arguments passed to available ForeCA algorithms. |

`U` |
a |

`f.U` |
multivariate spectrum of class |

`spectrum.control` |
list; control settings for spectrum estimation.
See |

`entropy.control` |
list; control settings for entropy estimation.
See |

`keep.all.optima` |
logical; if |

`dewhitening` |
optional; if provided (returned by |

`plot` |
logical; if |

An object of class `foreca`

, which is similar to the output from `princomp`

,
with the following components (amongst others):

`center`

: sample mean*\widehat{μ}_X*of each`series`

,`whitening`

: whitening matrix of size*K \times K*from`whiten`

:*\mathbf{U}_t = (\mathbf{X}_t - \widehat{μ}_X) \cdot whitening*; note that*\mathbf{X}_t*is centered prior to the whitening transformation,`weightvectors`

: orthonormal matrix of size*K \times n.comp*, which converts whitened data to`n.comp`

forecastable components (ForeCs)*\mathbf{F}_t = \mathbf{U}_t \cdot weightvectors*,`loadings`

: combination of whitening*\times*weightvectors to obtain the final loadings for the original data:*\mathbf{F}_t = (\mathbf{X}_t - \widehat{μ}_X) \cdot whitening \cdot weightvectors*; again, it centers*\mathbf{X}_t*first,`loadings.normalized`

: normalized loadings (unit norm). Note though that if you use these normalized loadings the resulting signals do not have variance 1 anymore.`scores`

:`n.comp`

forecastable components*\mathbf{F}_t*. They have mean 0, variance 1, and are uncorrelated.`Omega`

: forecastability score of each ForeC of*\mathbf{F}_t*.

ForeCs are ordered from most to least forecastable (according to
`Omega`

).

Estimating Omega directly from the ForeCs *\mathbf{F}_t* can be different
to the reported `$Omega`

estimates from `foreca`

. Here is why:

In theory *f_y(λ)* of a linear combination
*y_t = \mathbf{X}_t \mathbf{w}* can be analytically computed from
the multivariate spectrum *f_{\mathbf{X}}(λ)* by the
quadratic form
*f_y(λ) = \mathbf{w}' f_{\mathbf{X}}(λ) \mathbf{w}* for all
*λ* (see `spectrum_of_linear_combination`

).

In practice, however, this identity does not hold always exactly since
(often data-driven) control setting for spectrum estimation are not identical
for the high-dimensional, noisy
*\mathbf{X}_t* and the combined univariate time series *y_t*
(which is usually more smooth, less variable). Thus estimating
*\widehat{f}_y* directly from *y_t* can give slightly different
estimates to computing it as *\mathbf{w}'\widehat{f}_{\mathbf{X}}\mathbf{w}*. Consequently also `Omega`

estimates
can be different.

In general, these differences are small and have no relevant implications
for estimating ForeCs. However, in rare occasions the obtained ForeCs can have
smaller `Omega`

than the maximum `Omega`

across all original series.
In such a case users should not re-estimate *Ω* from the resulting
ForeCs *\mathbf{F}_t*, but access them via `$Omega`

provided
by `'foreca'`

output (the univariate estimates are stored in `$Omega.univ`

).

Goerg, G. M. (2013). “Forecastable Component Analysis”. Journal of Machine Learning Research (JMLR) W&CP 28 (2): 64-72, 2013. Available at http://jmlr.org/proceedings/papers/v28/goerg13.html.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ```
XX <- diff(log(EuStockMarkets)) * 100
plot(ts(XX))
## Not run:
ff <- foreca(XX[,1:4], n.comp = 4, plot = TRUE, spectrum.control=list(method="pspectrum"))
ff
summary(ff)
plot(ff)
## End(Not run)
## Not run:
PW <- whiten(XX)
one.weight.em <- foreca.one_weightvector(U = PW$U,
dewhitening = PW$dewhitening,
algorithm.control =
list(num.starts = 2,
type = "EM"),
spectrum.control =
list(method = "mvspec"))
plot(one.weight.em)
## End(Not run)
## Not run:
PW <- whiten(XX)
ff <- foreca.multiple_weightvectors(PW$U, n.comp = 2,
dewhitening = PW$dewhitening)
ff
plot(ff$scores)
## End(Not run)
``` |

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.