NVAR {NVAR} | R Documentation |
Fit a nonlinear vector autoregression model
Description
Described by Gauthier et al. (2021), also known as the "next generation reservoir computing" (NG-RC).
Usage
NVAR(data, vars, s, k, p, constant = TRUE, alpha = 0.05)
Arguments
data |
A |
vars |
A character vector of the variable names used in the model. |
s |
The number of time steps skipped between each two used time steps. |
k |
The number of time steps used for constructing features. |
p |
The order of polynomial feature vector. |
constant |
Whether there should be a constant value (1) in the feature set? Default is |
alpha |
The |
Details
The feature vector is as follows (from the reference):
\mathbb{O}_{\text {total }}=\mathbb{O}_{\text {lin }} \oplus \mathbb{O}_{\text {nonlinear }}^{(p)}
\mathbb{O}_{\operatorname{lin}, i}=\mathbf{X}_i \oplus \mathbf{X}_{i-s} \oplus \mathbf{X}_{i-2 s} \oplus \ldots \oplus \mathbf{X}_{i-(k-1) s}
\mathbb{O}_{\text {nonlinear }}^{(p)}=\mathbb{O}_{\text {lin }}\lceil\otimes\rceil \mathbb{O}_{\text {lin }}\lceil\otimes\rceil \ldots\lceil\otimes\rceil \mathbb{O}_{\text {lin }}
The feature vector \mathbb{O}_{\text {total }}
is then used as input for a ridge regression with alpha
.
Value
An NVAR
object that contains data
, data_td
(a tidy form of tibble
that contains the training data), W_out
(the fitted coefficients), and parameters
.
References
Gauthier, D. J., Bollt, E., Griffith, A., & Barbosa, W. A. S. (2021). Next generation reservoir computing. Nature Communications, 12(1), 5564. https://doi.org/10.1038/s41467-021-25801-2
See Also
sim_NVAR()
for simulating the NVAR model.
Examples
# generate test data from the Lorenz system
testdata <- nonlinearTseries::lorenz()
testdata <- tibble::as_tibble(testdata)
# fit an NVAR model for the Lorenz system
t1 <- NVAR(data = testdata, vars = c("x", "y", "z"), s = 2, k = 2, p = 2, alpha = 1e-3)
# simulate the NVAR model
t1_sim <- sim_NVAR(t1, length = 5000)
# (also see README for the plots of the results and the comparison with the true model)