50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


NlinTS (version 1.3.5)

varmlp: Artificial Neural Network VAR (Vector Auto-Regressive) model using a MultiLayer Perceptron.

Description

Artificial Neural Network VAR (Vector Auto-Regressive) model using a MultiLayer Perceptron.

Usage

varmlp(df, lag, sizeOfHLayers, iters, bias = TRUE)

Arguments

df

A numerical dataframe

lag

The lag parameter.

sizeOfHLayers

Integer vector that contains the size of hidden layers, where the length of this vector is the number of hidden layers, and the i-th element is the number of neurons in the i-th hidden layer.

iters

The number of iterations.

bias

Logical, true if the bias have to be used in the network.

Value

train (df): updates the model using the input dataframe.

forecast (df): returns the next row forecasts of an given dataframe.

Details

This function builds the model, and returns an object that can be used to make forecasts and can be updated using new data.

Examples

Run this code
# NOT RUN {
library (timeSeries) # to extract time series
library (NlinTS)
#load data
data = LPP2005REC
# Prepare data to make one forecasts
train_data = head (data, nrow (data) - 1)
test_data = tail (data, 1)
model = varmlp (train_data, 1, c(10,5), 200, TRUE)
predictions = model$forecast (train_data)
print (tail (predictions,1))
# Update the model (learning from new data)
model$train (test_data)
# }

Run the code above in your browser using DataLab