Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NARX network in R

I've tried to find a package in R to train and implement a nonlinear autoregressive model with exogenous inputs (NARX) network with no success.

I want to use it for time series forecasting as it is more powerful than an ordinary feedforward network. MATLAB is not free and I did not like its NARX toolbox as I checked online.

What functions or package are there in R for such networks?

Edit: I have found tsDyn so far. MATLAB is not free and I did not like its NARX toolbook as I checked online. I prefer R as there are more resources out there

like image 428
HoumanR Avatar asked Mar 04 '15 17:03

HoumanR


People also ask

What is a Narx neural network?

and returns a NARX neural network. NARX (Nonlinear autoregressive with external input) networks can learn to predict one time series given past values of the same time series, the feedback input, and another time series called the external (or exogenous) time series.

How do you create a Narx network?

Create a NARX network. Define the input delays, feedback delays, and size of the hidden layers. Prepare the time series data using preparets. This function automatically shifts input and target time series by the number of steps needed to fill the initial input and layer delay states.

What is Narx model?

NARX model is a dynamic recurrent neural network that encloses several layers with feedback connections, Hayken. It has previously been applied by many researchers to model nonlinear processes, Coruh et al. applied NARX to predict the adsorption efficiency percentage for the removal of zinc ions from waste water.

What is Narx (nonlinear autoregressive with external input)?

NARX (Nonlinear autoregressive with external input) networks can learn to predict one time series given past values of the same time series, the feedback input, and another time series called the external (or exogenous) time series. Train a nonlinear autoregressive with external input (NARX) neural network and predict on new time series data.


2 Answers

You might want to look at this: http://cran.r-project.org/web/packages/tsDyn/vignettes/tsDyn.pdf

like image 108
Rick Avatar answered Sep 26 '22 00:09

Rick


Type this:

install.packages("tsDyn");    
library(tsDyn);
nnetTs(TimeSeriesObject,m=pvalue,size=20)  

nnetTS in R is equivalent to NARX in Matlab. Here, pvalue is to be used for AR(p) model. Size also can be varied, default is 20. Choose 'm=pvalue' and 'size=j' in such a way that your RMSE is minimised. RMSE is given by,

rmse= mean((residuals(nnetTs(TimeSeriesObject,m=pvalue,size=j)))^2,na.rm=T)^0.5
like image 37
Anurag Gupta Avatar answered Sep 23 '22 00:09

Anurag Gupta