Forecast Matlab ARIMA
Forecast Matlab ARIMA
forecast
F
9(3%!((3%!(G
Syntax
[Y,YMSE] = forecast(Mdl,numPeriods)
[Y,YMSE,V] = forecast(Mdl,numPeriods)
[Y,YMSE,V] = forecast(Mdl,numPeriods,Name,Value)
Description
[Y,YMSE] = forecast(Mdl,numPeriods)77
(3%!(
$
8
8<$YMSE&
[Y,YMSE,V] = forecast(Mdl,numPeriods,Name,Value)87
7
6Name,Value8&
Input Arguments
Mdl — ARIMA or ARIMAX model
arima
7MdlNaN&
9F$7 8&
D8AA
forecast
D8AD
9 Functions — Alphabetical List
D8DE
forecast
Notes
I %77E0$V0$Y0numPathsc,$
numPaths$ &9C$7Y0
Output Arguments
Y — Minimum mean square error forecasts of response data
C
D8D
9 Functions — Alphabetical List
<7YMSE 777Y&
V — Minimum mean square error forecasts of conditional variances of future model innovations
C
Examples
Forecast the Conditional Mean Response
Mdl = arima('MA',{0.5,-0.3},'SMA',0.4,'SMALags',12,...
D8D$
forecast
'Constant',0.04,'Variance',0.2);
rng(200);
Y = simulate(Mdl,130);
ToEstMdl = arima('MALags',1:2,'SMALags',12);
EstMdl = estimate(ToEstMdl,Y(1:100));
Standard t
Parameter Value Error Statistic
----------- ----------- ------------ -----------
Constant 0.20403 0.0690637 2.95424
MA{1} 0.502116 0.0972984 5.16058
MA{2} -0.20174 0.104466 -1.93115
SMA{12} 0.27028 0.109071 2.47803
Variance 0.18681 0.0327319 5.70728
figure
h1 = plot(Y,'Color',[.7,.7,.7]);
hold on
h2 = plot(101:130,YF,'b','LineWidth',2);
h3 = plot(101:130,YF + 1.96*sqrt(YMSE),'r:',...
'LineWidth',2);
plot(101:130,YF - 1.96*sqrt(YMSE),'r:','LineWidth',2);
legend([h1 h2 h3],'Observed','Forecast',...
'95% Confidence Interval','Location','NorthWest');
title(['30-Period Forecasts and Approximate 95% '...
'Confidence Intervals'])
hold off
D8D2
9 Functions — Alphabetical List
load Data_EquityIdx
nasdaq = DataTable.NASDAQ(1:1500);
nasdaqModel = arima(1,1,1);
nasdaqFit = estimate(nasdaqModel,nasdaq);
D8D8
forecast
ARIMA(1,1,1) Model:
--------------------
Conditional Probability Distribution: Gaussian
Standard t
Parameter Value Error Statistic
----------- ----------- ------------ -----------
Constant 0.430311 0.185555 2.31905
AR{1} -0.0743926 0.0819849 -0.907394
MA{1} 0.311259 0.0772656 4.02843
Variance 27.826 0.636248 43.7346
[Y,YMSE] = forecast(nasdaqFit,500,'Y0',nasdaq);
lower = Y - 1.96*sqrt(YMSE);
upper = Y + 1.96*sqrt(YMSE);
figure
plot(nasdaq,'Color',[.7,.7,.7]);
hold on
h1 = plot(1501:2000,lower,'r:','LineWidth',2);
plot(1501:2000,upper,'r:','LineWidth',2)
h2 = plot(1501:2000,Y,'k','LineWidth',2);
legend([h1 h2],'95% Interval','Forecast',...
'Location','NorthWest')
title('NASDAQ Composite Index Forecast')
hold off
D8D<
9 Functions — Alphabetical List
D8D>
forecast
References
S,T=$3&$
&=&J
*!
*
0
A&K5
&A&-$,..-$&.,5,,'&
S'T=$&J(0
)#
!
7
373&K
!2$ &A&.$,. $
&-5 &
See Also
QQ7QQ7QQ
More About
I J!!:9870
!!
K8,,
I J!09870
!!
K8,
D8D?