How to forecast a multi step ahead time series?

1 回表示 (過去 30 日間)
Atreyee Mondal
Atreyee Mondal 2020 年 6 月 11 日
回答済み: Jaynik 2024 年 7 月 24 日
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.

回答 (1 件)

Jaynik
Jaynik 2024 年 7 月 24 日
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!

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by