How to forecast a multi step ahead time series?

12 visualizaciones (últimos 30 días)
Atreyee Mondal
Atreyee Mondal el 11 de Jun. de 2020
Respondida: Jaynik el 24 de Jul. de 2024
Hello all,
I'm doing a new project on MATLAB. I got stuck in a step where I have to forecast a multi step ahead time series.
Any code snippet will be very helpful for me to proceed. Kindly help.
Problem :
I have a time series data of 578 points and I need to forcast next 144 points which are unknown to me. These 144 points will be multi step ahead forecast points.
The problem can be seen as I have 80 percent data with me and rest unknown 20 percent I need to predict. (Any relevant approach is great for me)
Thanks in advanced.

Respuestas (1)

Jaynik
Jaynik el 24 de Jul. de 2024
Hi Atreyee,
The predict function from the "System Identificatoin Toolbox" can be used to perform multi-step ahead forecasting. This function computes the K-step-ahead output of an identified model using measured input-output data. Here is a sample code for the same:
% Assuming 'data' is your time series data
% Estimate an AR model from the data
Mdl = ar(data, 2);
% Perform the K-step ahead prediction
K = 144;
yp = predict(Mdl, data, K);
% Plotting the original data and the prediction
figure
plot(data.OutputData)
hold on
plot(yp.OutputData, 'r')
hold off
Here, ar is a model used to estimate an autoregressive model of order 2 from the data. The choice of model depends on the characteristics of your data and the specific requirements of your forecasting task. It is always a good idea to try multiple models and choose the one that gives the best performance on your validation data.
Refer to the following documentation to learn more about these functions:
Here are some examples for time-series prediction which might be useful:
Hope this helps!

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by