Data organisation for a Time Series Neural Network

Hi there,
I would like to use the Deep Learning Tool box on Matlab to train a time series neural network, mostly likely using NARX, however I am having trouble with the data organsation for my specific problem.
My input data consists of several years of daily weather in the form of 12 independant variables from a site. I also have satellite derived Soil Mositure data for the site, however, due to Ireland being cloudy at lot, I only have these date for 16 days over the same time period. I would like to train a NARX network to try to predict Soil mositure using weather data as input.
I have easily being able to do this for say a single day, using a Fitting Neural Network, however we don't think that this form of network correctly mirrors the physical world in terms of our problem as it's expected that soil moisture is a function of several days of previous weather due to poor drainage on our site.
Therefore I would like to use NARX. However I do not understand how I can organise my input data. Basically I want to be able to train a network with say 7 days of weather data, which would result in a particular target value of soil moisture, for each of my 16 measured soil moisture days. To start with I ahve extracted a single pixel of data from my satellite images to test the theory.
My question is, is this possible using NARX? To have 7 days of an input time series which results in a single target output. From my reading of the help documents, NARX requires that both the input data and the target data need to be in a similar time series step. Is this the case or have I misunderstood the data structures?
Any help would be much apprecaited!
Thanks,
Dave
Note, I do have some codes for this problem but they are used for a fitting neural network whereas I would like to use a timeseries.

 Accepted Answer

Hi,
You can train your NARX model with multi-dimensional input data. You can do this task in two ways, first using ‘narxnet’ function in MATLAB, you can follow the below link for reference:
Secondly, you can use Neural Time Series Tool in MATLAB. You can launch the tool by the following command
ntstool
Regarding dataset organization, you can create a cell array of (1XNumber of samples) where each cell will consist of (1XD) vector, where D is the number of dimensions in dataset. You can load the existing dataset of ‘Pollution Mortality’ from the app in order to understand the dataset format.

7 Comments

Mahesh,
Thanks, yes I understand all that and have looked at the pollution mortality dataset. That dataset has several dimensions as input and output, however unlike my time series, there is target data for each and every input data.
For me, I will have 7 days of weather data (Temp, humidity, solar radiation etc) but only with a single output data point.
Should I arrange all 7 days of 12 variables in a single 1 x D vector? Where D becomes 12(Variables) x 7 (number of days) ie a 1 x 84 vector?
I will have 16 of such cells then as my input to the NARX GUI and 16 (1 x 1) cells as Targets.
Will this data organisation maintain the "time series" nature of the neural network?
Thanks again,
Dave
Hi,
Your dataset will be arranged as 1X7 in the cell format, each cell will be a vector of 1X12. You can refer the dataset format in the workspace after importing ‘Pollution Mortality’ data.
Mahesh,
OK, understood. What about the target data? I will only have 1 day where the target data is valid (Day 7 for example). So I understand that I will have 1 x 7 cells, and 1 x 12 within each cell, however I will only have a single cell (1 x 1) as a target and (1 x 1) within this target cell
Should I create a 1 x 7 cell array for the target with dummy values (0 or NaN) from 1 x 1:6 and then the actual measured value in cell 7? How then would I train the network to use these 7 days of data to construct this single target value?
Cheers,
Dave
Hi,
You will require more targets to train any neural network. Creating dummy values will not work as model will get trained with false output, therefore its prediction will be incorrect. So collect sufficient data.
Thanks Mahresh,
It is as I thought. Would there be a Deep Learning Solution to my problem.
Basically I want to train a multi-step, multi-variable time series to produce a single variable output.
I have 16 such datasets from which to train a network.
What I am trying to achieve it to see how many steps back in time I need to go to predict the single variable output correctly for all 16 datasets.
Final question to you, is this possible in Matlab Deep Learning Toolbox?
Thanks,
Dave
Hi David,
If you have 16 labelled data, then you can use Neural Time Series tool. You should train your model with those data.
Regarding number of steps, it all depends on problem to problem. You can make it a hyperparameter and vary the number of steps and select the particular step which is giving more accurate result.
16 is very very less, try to increase your data if possible (atleast 200).
Mahesh,
Unfortunately my data is not category data, but numerical and so I need to do some form of regression.
I am having a go using LSTM networks at the moment with promising results, utilising the Sequence-to-one functions within the network structure.
Regardless, thanks, you have answered my question fully.
Cheers,
Dave

Sign in to comment.

More Answers (0)

Categories

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

Community Treasure Hunt

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

Start Hunting!