Simulate Multiplicative ARIMA Models
This example shows how to simulate sample paths from a multiplicative seasonal ARIMA model usingsimulate
。时间序列是1949年至1960年的月度国际航空公司客机数量。
Load the Data and Estimate a Model.
加载数据集Data_Airline
。
load('Data_Airline.mat'); y = log(Data); T = length(y); Mdl = arima('持续的',0,'D',1,'Seasonality',12,。。。'MALags',1,'SMALags',12); EstMdl = estimate(Mdl,y);
ARIMA(0,1,1) Model Seasonally Integrated with Seasonal MA(12) (Gaussian Distribution): Value StandardError TStatistic PValue _________ _____________ __________ __________ Constant 0 0 NaN NaN MA{1} -0.37716 0.066794 -5.6466 1.6364e-08 SMA{12} -0.57238 0.085439 -6.6992 2.0952e-11 Variance 0.0012634 0.00012395 10.193 2.1406e-24
res = infer(EstMdl,y);
Simulate Airline Passenger Counts.
Use the fitted model to simulate 25 realizations of airline passenger counts over a 60-month (5-year) horizon. Use the observed series and inferred residuals as presample data.
rng('默认') Ysim =模拟(EstMdl 60'NumPaths',25,'Y0',是的,'E0'res);mn = (Ysim意思,2); figure plot(y,'k') hold在情节(t+1:t+60,ysim,'Color',[.85,.85,.85]); h = plot(T+1:T+60,mn,'k--','LineWidth',2); xlim([0,T+60]) title('Simulated Airline Passenger Counts') legend(h,'Simulation Mean','地点','NorthWest') holdoff
The simulated forecasts show growth and seasonal periodicity similar to the observed series.
Estimate the Probability of a Future Event.
Use simulations to estimate the probability that log airline passenger counts will meet or exceed the value 7 sometime during the next 5 years. Calculate the Monte Carlo error associated with the estimated probability.
rngdefaultYsim = simulate(EstMdl,60,'NumPaths',1000,'Y0',是的,'E0'res);g7 = sum(Ysim >= 7) > 0; phat = mean(g7)
phat = 0.3910
err = sqrt(phat*(1-phat)/1000)
err = 0.0154
在未来5年内,(日志)航空公司乘客的数量将大约有39%的可能性。估计值的蒙特卡洛标准误差约为0.02。
Plot the Distribution of Passengers at a Future Time.
Use the simulations to plot the distribution of (log) airline passenger counts 60 months into the future.
figure histogram(Ysim(60,:),10) title('Distribution of Passenger Counts in 60 months')
See Also
Related Examples
- Specify Multiplicative ARIMA Model
- Estimate Multiplicative ARIMA Model
- Forecast Multiplicative ARIMA Model
- Check Fit of Multiplicative ARIMA Model