This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Forecast IGD Rate Using ARIMAX Model

This example shows how to forecast an ARIMAX model two ways.

Step 1. Load the data.

Load the Credit Defaults data set, assign the response IGD to Y and the predictors AGE, CPF, and SPR to the matrix X, and obtain the sample size T. To avoid distraction from the purpose of this example, assume that all predictors are stationary.

load Data_CreditDefaults
X = Data(:,[1 3:4]);
T = size(X,1);
Y = Data(:,5);

Step 2. Process response and predictor data.

Divide the response and predictor data into estimation and holdout series. Assume that each predictor series is AR(1), and fit each one to that model. Forecast the predictor series over a 10-year horizon.

Yest = Y(2:(T-10)) % Response data for estimation;
Yest = 


Xest = X(1:(T-10),:) % Predictor data for estimation;
Xest = 

    3.6184   -0.0571    1.9700
    6.2827    3.4798    2.3100
    8.3958    3.5782    2.9000
    5.4114   -0.8488    2.4100
   13.1429    3.2469    1.5000
    7.8093   -4.1607    1.9200
    7.5535   -6.3518    2.3200
    7.7062    6.6135    2.2800
    5.4306    9.7126    2.0700
    5.3236    6.5485    1.9400

modelX = arima(1,0,0); % Model for the predictors
X1fit = estimate(modelX,Xest(:,1),'print',false);
X2fit = estimate(modelX,Xest(:,2),'print',false);
X3fit = estimate(modelX,Xest(:,3),'print',false);

X1fore = forecast(X1fit,10,'Y0',Xest(:,1));
X2fore = forecast(X2fit,10,'Y0',Xest(:,2));
X3fore = forecast(X3fit,10,'Y0',Xest(:,3));
XF = [X1fore X2fore X3fore];

XF holds the forecasts for the three predictor series.

Step 3. Estimate response model and infer residuals.

Assume that the response series is ARX(1), and fit it to that model including the predictor series. Infer the residuals Eest from the fitted response model Yfit.

modelY = arima(1,0,0);
Yfit = estimate(modelY,Yest,'X',Xest,...
Eest = infer(Yfit,Yest,'Y0',Y(1),'X',Xest);

Step 5. MMSE forecast responses.

Forecast responses using the MMSE method at a 10-year horizon. Calculate prediction intervals for the forecasts assuming that they are normally distributed.

[Yfore,YMSE] = forecast(Yfit,10,'Y0',Y(1:(T-10)),...
cil = Yfore - 1.96*sqrt(YMSE);
ciu = Yfore + 1.96*sqrt(YMSE);

Step 6. Plot MMSE forecasted responses.

Plot the response series using their MMSE forecasts and prediction intervals.

l1 = plot(dates,Y,'ko-','LineWidth',2);
ylabel('IGD (%)')
hold on
l2 = plot(dates((T-9):T),cil,'r:','LineWidth',2);
l3 = plot(dates((T-9):T),Yfore,'k:','LineWidth',2);

plot(dates([T-10 T-9]),[Y(T-10) Yfore(1)],'k:')
plot(dates([T-10 T-9]),[Y(T-10) cil(1)],'r:')
plot(dates([T-10 T-9]),[Y(T-10) ciu(1)],'r:')
legend([l1 l2 l3],'Observed Time Series','95% Interval',...
title('Default Rate of Investment Grade Corporate Bonds:,MMSE Forecasts')
axis tight
hold off

The forecasts seem reasonable, but there are outlying observations in 2000 and 2001.

Step 7. Monte Carlo forecast responses.

Forecast responses using the Monte Carlo method at a 10-year horizon by simulating 100 paths using the model Yfit. Set the estimation responses to Y0 and the inferred residuals to E0 as preforecast data. Set the forecasted predictors (XF) to X. Calculate simulation statistics.

nsim = 100;
Ymcfore = simulate(Yfit,10,'NumPaths',nsim,'Y0',...
Ymcforebar = mean(Ymcfore,2);
mc_cil = quantile(Ymcfore',0.025);
mc_ciu = quantile(Ymcfore',0.975);

Step 8. Plot Monte Carlo forecasted responses.

Plot the response series with their MMSE forecasts and prediction intervals.

ylabel('IGD (%)')

hold on
l4 = plot(dates((T-9):T),Ymcfore(:,1),'Color',[0.7 0.7 0.7]);
plot(dates((T-9):T),Ymcfore,'Color',[0.7 0.7 0.7]);
l2 = plot(dates((T-9):T),mc_cil,'r:','LineWidth',3);
l3 = plot(dates((T-9):T),Ymcforebar,'c:','LineWidth',3);

plot(dates([T-10 T-9]),[repmat(Y(T-10),1,nsim);...
			Ymcfore(1,:)],'Color',[0.7 0.7 0.7])
plot(dates([T-10 T-9]),[Y(T-10) Ymcforebar(1)],'c:',...
plot(dates([T-10 T-9]),[Y(T-10) mc_cil(1)],'r:','LineWidth',3)
plot(dates([T-10 T-9]),[Y(T-10) mc_ciu(1)],'r:','LineWidth',3)
l1 = plot(dates,Y,'ko-','LineWidth',2);

legend([l1 l2 l3 l4],'Observed Series','95% MC Interval',...
			'MC Mean Forecast','Simulated Forecasts','Location',...
title('Default Rate of Investment Grade Corporate Bonds: Monte Carlo Forecasts')
axis tight
hold off

The Monte Carlo forecasts and prediction intervals resemble those from the MMSE forecasting.


Helwege, J., and P. Kleiman. "Understanding Aggregate Default Rates of High Yield Bonds." Current Issues in Economics and Finance. Vol. 2, Number. 6, 1996, pp. 1-6.

Loeffler, G., and P. N. Posch. Credit Risk Modeling Using Excel and VBA. West Sussex, England: Wiley Finance, 2007.

See Also

| | | |

Related Examples

More About

Was this topic helpful?