Title: | Nonlinear Vector Autoregression Models |
---|---|
Description: | Estimate nonlinear vector autoregression models (also known as the next generation reservoir computing) for nonlinear dynamic systems. The algorithm was described by Gauthier et al. (2021) <doi:10.1038/s41467-021-25801-2>. |
Authors: | Jingmeng Cui [aut, cre] |
Maintainer: | Jingmeng Cui <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-02-12 05:26:39 UTC |
Source: | https://github.com/Sciurus365/NVAR |
Described by Gauthier et al. (2021), also known as the "next generation reservoir computing" (NG-RC).
NVAR(data, vars, s, k, p, constant = TRUE, alpha = 0.05)
NVAR(data, vars, s, k, p, constant = TRUE, alpha = 0.05)
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 |
The feature vector is as follows (from the reference):
The feature vector is then used as input for a ridge regression with
alpha
.
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
.
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
sim_NVAR()
for simulating the NVAR model.
# 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)
# 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)
Time series simulation with an NVAR model
sim_NVAR( model, init = NULL, length = 1000, noise = 0, upper_lim = Inf, lower_lim = -Inf )
sim_NVAR( model, init = NULL, length = 1000, noise = 0, upper_lim = Inf, lower_lim = -Inf )
model |
An |
init |
A |
length |
How many time steps should be simulated? |
noise |
A number indicating the standard deviation of the Gaussian noise
added to each time step. |
upper_lim , lower_lim
|
The upper and lower limit for the simulation. Once the simulated value is out of the limits, it will be taken back to avoid instability of the simulation. Both should either be a single number or a numeric vector with the same length as the number of variables in the model. |
A tibble
with the simulated time series.