請問建立ARIMA model時 文中使用
spec= garchset('R',i,'M',j,'Display','off'); %指定模型的结构
[coeffX,errorsX,LLFX] = garchfit(spec,da); %拟合参数
我看 Matlab官網之範例,為使用 arima function,程式碼如下:
Forecast the daily NASDAQ Composite Index over a 500-day horizon.
Load the NASDAQ data included with the toolbox, and extract the first 1500 observations.
load Data_EquityIdx
nasdaq = Dataset.NASDAQ(1:1500);
Fit an ARIMA(1,1,1) model to the data.
nasdaqModel = arima(1,1,1);
nasdaqFit = estimate(nasdaqModel,nasdaq);
Forecast the Composite Index for 500 days using the fitted model. Use the observed data as presample data.
[Y,YMSE] = forecast(nasdaqFit,500,'Y0',nasdaq);
Plot the forecasts and 95% forecast intervals.
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
請問 使用arima 及 garchfit 建立 arimal model有何不同?