Train NARX with multiple time series in ntstool

Dear all
I have three time series of experimental data. Each time series includes 3 input variables and one output variable. Using the catsamples command I turn the 3 input and outpup data series into two proper cell arrays Input and Output (uploaded in here).
In ntstool, choosing the option cell I can introduce my Output cell array. The tool succesfully recognizes that it includes 3 time series with 5598 timesteps of 1 element with 5
as shown below: Targets 'Output' is a 1x5598 cell array of 1x3 matrices, representing dynamic data: 3 series of 5598 timesteps of 1 element.
Nevertheless there is not an option to introduce the Input cell array, sine it has dimensions of 3x5598.
Is this a limitation of the tool? Is there another way to train the NARX? Could you please send me a script that fixes this problem?

5 Comments

Hi Georgios,
Did you find an answer to your question?
I'm wondering exactly the same here: it seems you can't train the NARX using multiple obervations like we could do with lstm for example.
Hello Arthur
Yes there is a way of doing so!
Lets say you have multiple input time series then you can use catsamples as follows:
Input = catsamples(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,...
c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,'pad');
Then you need to turn the multydimensional training input cell aray into a cell row as follows:
for i=1:sizets % the size of your longest timeseries
TrainingInput(i).train=[cell2mat(Input(1,i));cell2mat(Input(2,i));cell2mat(Input(3,i))];
end
TrainingInput=TrainingInput';
TrainingInput = struct2cell(TrainingInput);
This way I made sure that the tool was reading a totak of 22 timesries of 3 elements (my independent variables) with multiple steps 9time series observations)
-------------------------------------------------------------------------------------------------------------------------------------------------
In this link (GitHub) I have a project of mine where I use NARX to make time-series prediction.
The DataPreProcessingBus2.m contains the actual lines of code to papproprietly pre-process multiple time-series so that they can be used with the ntstool.
I hope this helps.
All best
Georgios Etsias
Hello, I have some question on using NARX.
After training is done, the NARX can only predict the future output just after given input.
I found that the network needs not only the input but the data of just before.
Is there a way to predict output at other unrelated time?
Hello
With a closed-loop NARX prediction you just need the 1st value or so.
I think my answer to this question could be what you need..
I hope this helps.
multiple outputs are not possible?

Sign in to comment.

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 16 Mar 2020

Edited:

on 26 Jan 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!