MATLAB 1

 

>> help narxnet
 narxnet Nonlinear auto-associative time-series network with external input.
 
   For an introduction use the Neural Time Series app ntstool.
   Click here to launch it.
 
   Nonlinear autoregressive networks with an external (exogenous) input,
   can learn to predict a time series Y given past values of Y and another
   time series X (the external/exogenous) input.
 
   narxnet(inputDelays,feedbackDelays,hiddenSizes,feedbackMode,trainFcn)
   takes row vectors of input delays, output-to-input feedback delays, a
   row vector of N hidden layer sizes, an 'open' or 'closed' feedback mode
   and a backpropagation training function, and returns a NARX network.
 
   Input, output and output layers sizes are set to 0.  These sizes will
   automatically be configured to match particular data by train. Or the
   user can manually configure inputs and outputs with configure.
 
   Defaults are used if narxnet is called with fewer arguments.
   The default arguments are (1:2,1:2,10,'open','trainlm').
 
   Here a NARX network is designed. The NARX network has a standard input
   and an open loop feedback output to an associated feedback input.
 
     [x,t] = simplenarx_dataset;
     net = narxnet(1:2,1:2,10);
     [X,Xi,Ai,T] = preparets(net,x,{},t);
     net = train(net,X,T,Xi,Ai);
     view(net)
     Y = net(X,Xi,Ai)
     perf = perform(net,Y,T)
 
   Closed-loop Form
 
   Once designed the dynamic network can be converted to closed loop with
   closeloop and simulated.
 
     netc = closeloop(net);
     view(netc)
     [Xc,Xic,Aic,Tc] = preparets(netc,x,{},t);
     Yc = netc(Xc,Xic,Aic);
 
   The function closeloop reversed this transform.
 
   Step-Ahead Form
 
   The open-loop neural network is by default in model form, which means it outputs
   values at the same time as the real system would.  Note that in the network diagram
   the minimum delay between inputs and outputs is one.  This delay can be eliminated
   if we would like predictions of the next output to be returned a timestep ahead
   of the actual system being modelled.
 
     nets = removedelay(net);
     view(net)
     [Xs,Xis,Ais,Ts] = preparets(nets,x,{},t);
     Ys = nets(Xs,Xis,Ais);
 
   The function adddelay reversed this transform.
 
   Multistep Prediction
 
   Sometimes it is useful to simulate a network in open-loop form for as long as there
   is known output data T, and then switch to closed-loop form to perform multistep
   prediction while providing only the external input.
 
   Here we use the training data to demonstrate this technique.  It is broken up
   into a segment where we will provide the known target/outputs and a second
   segment where only external inputs are known for 5 timesteps.
 
     numTimesteps = size(x,2);\n" +
     knownOutputTimesteps = 1:(numTimesteps-5);\n" +
     predictOutputTimesteps = (numTimesteps-4:):numTimesteps;\n" +
     x1 = x(1,knownOutputTimesteps);
     t1 = t(1,knownOutputTimesteps);
     x2 = x(1,predictOutputTimesteps);
 
   The open-loop network is simulated on the first segment, then the network and
   its current delay states are converted to closed-loop form to simulate on the
   second time segment.
 
     [Xo,Xio,Aio,To] = preparets(net,x1,{},t1);
     [Y1,Xfo,Afo] = net(Xo,Xio,Aio);
     [netc,Xic,Aic] = closeloop(net,Xfo,Afo);
     [Y2,Xfc,Afc] = netc(x2,Xic,Aic);
 
   Alternate predictions can be made for different values of X2, or further
   predictions can be made by continuing simulation with Xfc and Afc.
 
   Simulink Diagram
 
   A Simulink can be produced for any neural networks using the function gensim.
 
     gensim(net)
 
   See also preparets, closeloop, removedelay, narnet, timedelaynet, gensim.

    Reference page for narxnet


>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

>> help nndatasets
  Neural Network Datasets
  -----------------------
 
  Function Fitting, Function approximation and Curve fitting.
 
  Function fitting is the process of training a neural network on a
  set of inputs in order to produce an associated set of target outputs.
  Once the neural network has fit the data, it forms a generalization of
  the input-output relationship and can be used to generate outputs for
  inputs it was not trained on.
 
   simplefit_dataset     - Simple fitting dataset.
   abalone_dataset       - Abalone shell rings dataset.
   bodyfat_dataset       - Body fat percentage dataset.
   building_dataset      - Building energy dataset.
   chemical_dataset      - Chemical sensor dataset.
   cho_dataset           - Cholesterol dataset.
   engine_dataset        - Engine behavior dataset.
   vinyl_dataset         - Vinyl bromide dataset.
 
  ----------
 
  Pattern Recognition and Classification
 
  Pattern recognition is the process of training a neural network to assign
  the correct target classes to a set of input patterns.  Once trained the
  network can be used to classify patterns it has not seen before.
 
   simpleclass_dataset     - Simple pattern recognition dataset.
   cancer_dataset          - Breast cancer dataset.
   crab_dataset            - Crab gender dataset.
   glass_dataset           - Glass chemical dataset.
   iris_dataset            - Iris flower dataset.
   ovarian_dataset         - Ovarian cancer dataset.
   thyroid_dataset         - Thyroid function dataset.
   wine_dataset            - Italian wines dataset.
   digitTrain4DArrayData   - Synthetic handwritten digit dataset for
                             training in form of 4-D array.
   digitTrainCellArrayData - Synthetic handwritten digit dataset for
                             training in form of cell array.
   digitTest4DArrayData    - Synthetic handwritten digit dataset for
                             testing in form of 4-D array.
   digitTestCellArrayData  - Synthetic handwritten digit dataset for
                             testing in form of cell array.
   digitSmallCellArrayData - Subset of the synthetic handwritten digit
                             dataset for training in form of cell array.
 
  ----------
 
  Clustering, Feature extraction and Data dimension reduction
 
  Clustering is the process of training a neural network on patterns
  so that the network comes up with its own classifications according
  to pattern similarity and relative topology.  This is useful for gaining
  insight into data, or simplifying it before further processing.
 
   simplecluster_dataset - Simple clustering dataset.
 
  The inputs of fitting or pattern recognition datasets may also clustered.
 
  ----------
 
  Input-Output Time-Series Prediction, Forecasting, Dynamic modeling
  Nonlinear autoregression, System identification and Filtering
 
  Input-output time series problems consist of predicting the next value
  of one time-series given another time-series. Past values of both series
  (for best accuracy), or only one of the series (for a simpler system)
  may be used to predict the target series.
 
   simpleseries_dataset  - Simple time-series prediction dataset.
   simplenarx_dataset    - Simple time-series prediction dataset.
   exchanger_dataset     - Heat exchanger dataset.
   maglev_dataset        - Magnetic levitation dataset.
   ph_dataset            - Solution PH dataset.
   pollution_dataset     - Pollution mortality dataset.
   refmodel_dataset      - Reference model dataset
   robotarm_dataset      - Robot arm dataset
   valve_dataset         - Valve fluid flow dataset.
 
  ----------
 
  Single Time-Series Prediction, Forecasting, Dynamic modeling,
  Nonlinear autoregression, System identification, and Filtering
 
  Single time-series prediction involves predicting the next value of
  a time-series given its past values.
 
   simplenar_dataset     - Simple single series prediction dataset.
   chickenpox_dataset    - Monthly chickenpox instances dataset.
   ice_dataset           - Global ice volume dataset.
   laser_dataset         - Chaotic far-infrared laser dataset.
   oil_dataset           - Monthly oil price dataset.
   river_dataset         - River flow dataset.
   solar_dataset         - Sunspot activity dataset
 
  See also nndemos, nntextdemos.

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

https://www.mathworks.com/matlabcentral/answers/302908-narxnet-with-multi-input