Building times series forecasting using MLP

15 vues (au cours des 30 derniers jours)
Wissal Masmoudi
Wissal Masmoudi le 24 Juin 2022
Modifié(e) : Krishna le 12 Fév 2024
Hello every one,please help me building a code for time series forecasting(regression)using a feedforward neural network,i'm really confused how can i do that,i appreciate your help,thank you.

Réponses (1)

Krishna
Krishna le 3 Juil 2022
Modifié(e) : Krishna le 12 Fév 2024
Hi Wissal,
Time series forecasting can be conducted with a feedforward network in MATLAB.
Two cases can arise for time series forecasting using MATLAB.
  1. Univariate time series modelling: These models use a single variable, the time series data of interest, to make forecasts based on the historical values of that variable
  2. Multivariate time series modelling: Multivariate models analyse time series data involving multiple variables or series that interact with each other. These models can capture the relationships between different time series and how they influence each other.
If your goal is to perform univariate time series forecasting, for example, predicting the next day's stock price based on previous prices, you can achieve this with a feedforward network in MATLAB.
For preparing your data, decide on the number of past observations to use for predicting the current value, such as using the previous two or three steps. The optimal number of steps to use for forecasting can be determined through cross-validation, or alternatively, domain knowledge about the problem and an understanding of the underlying mathematical equations can also provide guidance. These precious steps are used as input and the next step as the target output for the feedforward network. The complexity of your problem will determine the network architecture. Generally, a straightforward architecture with two hidden layers is adequate for most non-linear problems. Testing should be conducted in a similar manner.
Feedforward networks are thus applicable for univariate time series modelling. This type of architectures is called as Auto regressive networks.
For multivariate time series modelling, the same approach can be applied, but with a key difference: the input will include additional variables that influence the output, in addition to the output variable's own past values. These types of networks are referred to as non-linear autoregressive networks. The relationship can be represented by an equation such as:
y = f(x1, x2 ,x3 ,…,y(-1))
Here, y is the output, which is dependent on both its own previous values (y(-1)) and the values of other influencing variables (x1 ,x2 ,x3 ,etc).
To implement feedforward network in MATLAB, you can utilize dlnetworks. Follow this link to learn more about dlnetworks,
You can use ‘fullyConnectedLayer’ to build your feedforward network. Follow this link to learn more on this layer and how to build networks using the layer,
Hope this helps.
  2 commentaires
Wissal Masmoudi
Wissal Masmoudi le 5 Juil 2022
Hello krishna, I appreciat your ansewer and thank you for the article,i know that the time series is used for reccurent neural network like NAR,NARx and elman etc,but i still confused how we can use them for a MLP. I want to forecast the wind speed,to do this i have a data from 1/01/2019 to 1/01/2022 and 4 inputs(humidite,pression,temperature,and the wind speed all that for (t-1)),the output is the value of wind speed at t. Now i don't know how to forecat with new inputs?! I means i don't know which inputs i have to use and at which time. Can you help me please if you have anny suggestion.thanks
Nurul Najihah
Nurul Najihah le 26 Sep 2023
Hello Wissal, do you getbto solve this problem? May i contact you on how to forecast using MLP?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by