How to Predict Timeseries data using Neural Network in Matlab
Afficher commentaires plus anciens
I've timeseries (past 31 years ) dataset of 41 independent variables. I want to predict my three dependent variables (These depends on rest 41 variables) using Neural Network in Matlab. I want to trained my ANN model using 80% timeseries dataset and 20% dataset for testing model. Then I want to predict (or forecaste) for two years (NAN values in excel file) my 3 dependent variables using my best trained model. I google about the problem, but not able to understand provided codes as mostly practice on images not excel dataset. How can I do that In Matlab?
I've attached my sample dataset which describe my problem well in excel with this question. A timely reply will be highly appriciated.
Réponses (1)
Muhammad Usman Saleem
le 28 Mai 2022
Modifié(e) : Muhammad Usman Saleem
le 18 Fév 2023
0 votes
2 commentaires
Ieuan Evans
le 21 Juin 2022
Hi Muhammad,
Thanks for the message. This is an interesting task!
Forecasting is not the correct approach for this task. Forecasting is best suited for scenarios where you have an incomplete time series, and you want to predict the next values of the sequence. For example, you have measure that correspond to time steps 1,2,...,T and you want to predict the same measurement for times T+1,T+2,...
It seems that you want to instead do something like predicting values [y1, y2, y3] given a sequence [x_Nov, ..., x_Apr], where x_i are vectors of size 7. You should be able to use sequence-to-one regression for this. That is, given a sequence, predict a single vector.
This example may help better: https://www.mathworks.com/help/deeplearning/ug/sequence-to-one-regression-using-deep-learning.html This example takes a sequence as input and predict a single *value*. You can adapt this example such that it outputs a single vector instead of a single number.
The strategy would be to formulate your training data such that XTrain is a cell array of 31 sequences, that correspond to each year 1991-2020. Each sequence is of length 6 with time steps corresponding to each month used, and each time step is a vector of length 7, where 7 is the number of variables for each month. In the above example, numChannels = 7.
The targets TTrain should be a matrix of size 31-by-3, where the 3 columns are the three values that you would like to predict. In the above example, this would mean that numResponses = 3.
When making predictions, use the predict function. The input data would be a cell array of two observations, where the sequences have the same layout as those in XTrain.
Hope this helps.
Ieuan
Muhammad Usman Saleem
le 25 Juin 2022
Modifié(e) : Muhammad Usman Saleem
le 25 Juin 2022
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!