train_esn | R Documentation |
Train an Echo State Network (ESN) to a univariate time series. The function automatically manages data pre-processing, reservoir generation (i.e., internal states) and model estimation and selection.
train_esn(
y,
lags = 1,
inf_crit = "bic",
n_diff = NULL,
n_states = NULL,
n_models = NULL,
n_initial = NULL,
n_seed = 42,
alpha = 1,
rho = 0.95,
density = 0.5,
lambda = c(1e-04, 2),
scale_win = 0.5,
scale_wres = 0.5,
scale_inputs = c(-0.5, 0.5)
)
y |
Numeric vector containing the response variable. |
lags |
Integer vector with the lag(s) associated with the input variable. |
inf_crit |
Character value. The information criterion used for variable selection |
n_diff |
Integer vector. The nth-differences of the response variable. |
n_states |
Integer value. The number of internal states per reservoir. |
n_models |
Integer value. The maximum number of (random) models to train for model selection. |
n_initial |
Integer value. The number of observations of internal states for initial drop out (throw-off). |
n_seed |
Integer value. The seed for the random number generator (for reproducibility). |
alpha |
Numeric value. The leakage rate (smoothing parameter) applied to the reservoir. |
rho |
Numeric value. The spectral radius for scaling the reservoir weight matrix. |
density |
Numeric value. The connectivity of the reservoir weight matrix (dense or sparse). |
lambda |
Numeric vector. Lower and upper bound of lambda sequence for ridge regression. |
scale_win |
Numeric value. The lower and upper bound of the uniform distribution for scaling the input weight matrix. |
scale_wres |
Numeric value. The lower and upper bound of the uniform distribution for scaling the reservoir weight matrix. |
scale_inputs |
Numeric vector. The lower and upper bound for scaling the time series data. |
A list
containing:
actual
: Numeric vector containing the actual values.
fitted
: Numeric vector containing the fitted values.
resid
: Numeric vector containing the residuals.
states_train
: Numeric matrix containing the internal states.
method
: A list
containing several objects and meta information of the trained ESN (weight matrices, hyperparameters, model metrics, etc.).
xdata <- as.numeric(AirPassengers)
xmodel <- train_esn(y = xdata)
summary(xmodel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.