You are on page 1of 26

The aim of our project is to fit an appropriate ARIMA model onto the 2012 Straits Times Index

values.

State the background of the time series.

A stock index or stock market index is a method of measuring the value of a section of the
stock market. It is computed from the prices of selected stocks (sometimes a weighted average).
It is a tool used by investors and financial managers to describe the market, and to compare the
return on specific investments. http://en.wikipedia.org/wiki/Stock_market_index

The Straits Times Index STI has a history dating back to 1966. Following a major sectoral re-
classification of listed companies by the Singapore Exchange, which saw the removal of the
"industrials" category, the STI replaced the Straits Times Industrials Index (STII) and began
trading on 31 August 1998 at 885.26 points, in continuation of where the STII left off. At the
time, it represented 78% of the average daily traded value over a 12-month period and 61.2%
of total market capitalization on the exchange. The STI was constructed by SPH, the Singapore
Exchange and SPH's consultant, Professor Tse Yiu Kuen from the Singapore Management
University (formerly from the National University of Singapore). It came under formal review at
least once annually and was also reviewed on an ad-hoc basis when necessary.
http://en.wikipedia.org/wiki/Straits_Times_Index

How do you come up with an initial model (by looking at ACF, PACF, differencing,
transformation)?

After studying the ACF and PACF of our original data set, we observed that the ACF dies down
slowly. Hence the original data set is not stationary. We applied one time differencing and
observed that both the ACF and PACF of our differenced data set cut off after lag 9. We
conclude that AR(9) or MA(9) may be an appropriate model for our differenced data set.
Furthermore, since ACF and PACF is significant at lag 9 only, Special AR(9) model (where 1 =

2
=, ...,

= 8
= 0

) or Special MA(9) model (where 1 =
2
=, ...,

= 8
= 0

) could also be
appropriate models for our differenced data set as well.

AR(9):
(1 + 0.15573 B- 0.07098 B
2
- 0.06979 B
3
- 0.06655 B
4
- 0.03887 B
5
+ 0.06604 B
6
+ 0.02201 B
7
-
0.0854 B
8
- 0.2308 B
9
)X
t
= Z
t


MA(9) :
X
t
= ( 1 - 0.17472 B + 0.07831 B
2
+ 0.01724 B
3
+ 0.02087 B
4
+ 0.05457 B
5
- 0.01909 B
6
- 0.01998
B
7
+ 0.05289 B
8
+ 0.23791 B
9
)Z
t


Special AR(9): (1 - 0.21022 B
9
)X
t
= Z
t

Special MA(9): X
t
= (1 + 0.22238 B
9
)Z
t


How do you improve your model by considering ACFs in the residuals and using ARIMA
models?

All four models ( AR(9), MA(9), Special AR(9) and Special MA(9)) passed the ljung box test and
are appropriate models for our differnced data set.

When we compare the AIC of the four models ( AR(9), MA(9), Special AR(9) and Special MA(9)),
we see that Special MA(9) has the smallest AIC, hence it is the most appropriate model of the
four to be fitted to our differenced values.

Upon further observation, we see that both the residual ACF and PACF of Special MA(9) cut off
at lag 1. The residual Z
t
of Special MA(9) could either follow a model of AR(1) or MA(1). [Refer to
Lecture Notes Chapter 4 (part4), page 6] We would need to plot the sample ACF values using
SAS code to determine from the ljung box test and AIC the appropriateness and fit of the two
models respectively.

How do you arrive at the final model ?

Assuming both the AR(1) model and MA(1) models pass the ljung box test when fitted to the
residual values of Special MA(9) model and:

[Case 1]: the AR(1) model has an AIC smaller than that of MA(1),
We choose AR(1) to be a better fit for the residual values and fit the differenced values with
ARMA(1,9) model(to improve the model since the ACF of the residual has peaks, not WN, plot
of residual included below). The best fit model of our original data set will be special
ARIMA(1,1,9). [(1 + 0.1732 B)Y
t
= (1 + 0.24543 B
9
)Z
t
, where Y
t
= X
t
- X
t-1
= (1 - B)X
t
]
[Case 2]: the MA(1) model has an AIC smaller than that of AR(1),
We choose MA(1) to be a better fit for the residual values and fit the differenced values with
MA(10) model (to improve the model since the ACF of the residuals has peaks, not WN, ACF
plot of residual included below). The best fit model of our original data set will be special
ARIMA(0,1,10). [Y
t
= (1 - 0.15001 B + 0.24712 B
9
+ 0.04448 B
10
)Z
t
, where Y
t
= X
t
- X
t-1
= (1 - B)X
t
]


data work4;
/*plot original time series*/
proc gplot data=stock;
symbol i=spline c=red;
plot Adj_Close*ID;
run;




/*plot the ACF and PACF of original time series*/

proc arima data=stock;
identify var=Adj_Close nlag=30 outcov=exp1;
run;



The ARIMA Procedure

Name of Variable = Adj_Close

Mean of Working Series 2975.718
Standard Deviation 106.346
Number of Observations 253


Autocorrelations

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 11309.477 1.00000 | |********************| 0
1 10866.444 0.96083 | . |******************* | 0.062869
2 10485.753 0.92717 | . |******************* | 0.106068
3 10075.181 0.89086 | . |****************** | 0.134336
4 9653.982 0.85362 | . |***************** | 0.155948
5 9185.450 0.81219 | . |**************** | 0.173436
6 8728.255 0.77176 | . |*************** | 0.187869
7 8309.761 0.73476 | . |*************** | 0.200008
8 7890.652 0.69770 | . |************** | 0.210407
9 7502.768 0.66341 | . |************* | 0.219361
10 6985.098 0.61763 | . |************ | 0.227152
11 6531.153 0.57749 | . |************ | 0.233696
12 6048.025 0.53477 | . |*********** | 0.239270
13 5581.638 0.49354 | . |********** | 0.243948
14 5140.348 0.45452 | . |*********. | 0.247864
15 4704.111 0.41594 | . |******** . | 0.251136
16 4310.430 0.38113 | . |******** . | 0.253845
17 3957.379 0.34992 | . |******* . | 0.256096
Adj_Close
2600
2700
2800
2900
3000
3100
3200
ID
0 100 200 300
18 3603.108 0.31859 | . |****** . | 0.257979
19 3291.822 0.29107 | . |****** . | 0.259530
20 2974.525 0.26301 | . |***** . | 0.260817
21 2665.236 0.23566 | . |***** . | 0.261863
22 2370.327 0.20959 | . |**** . | 0.262700
23 2114.714 0.18699 | . |**** . | 0.263360
24 1860.333 0.16449 | . |*** . | 0.263884
25 1629.584 0.14409 | . |*** . | 0.264289
26 1408.572 0.12455 | . |** . | 0.264600
27 1234.630 0.10917 | . |** . | 0.264831
28 1109.667 0.09812 | . |** . | 0.265009
29 990.440 0.08758 | . |** . | 0.265153
30 872.198 0.07712 | . |** . | 0.265267

"." marks two standard errors




The ARIMA Procedure

Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 -0.47190 | *********| . |
2 -0.01676 | . | . |
3 0.00431 | . | . |
4 -0.07019 | . *| . |
5 0.04999 | . |* . |
6 0.02819 | . |* . |
7 -0.04010 | . *| . |
8 0.11484 | . |**. |
9 -0.21143 | ****| . |
10 0.15731 | . |*** |
11 -0.06601 | . *| . |
12 0.01331 | . | . |
13 0.02845 | . |* . |
14 -0.04155 | . *| . |
15 0.01637 | . | . |
16 0.04255 | . |* . |
17 -0.07605 | .**| . |
18 0.08337 | . |**. |
19 -0.07078 | . *| . |
20 0.02653 | . |* . |
21 -0.00458 | . | . |
22 0.01739 | . | . |
23 -0.01367 | . | . |
24 0.00226 | . | . |
25 -0.03087 | . *| . |
26 0.03889 | . |* . |
27 0.00010 | . | . |
28 0.00655 | . | . |
29 -0.02645 | . *| . |
30 0.01055 | . | . |


Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.96083 | . |******************* |
2 0.05179 | . |* . |
3 -0.04708 | . *| . |
4 -0.03581 | . *| . |
5 -0.07592 | .**| . |
6 -0.01650 | . | . |
7 0.02701 | . |* . |
8 -0.01435 | . | . |
9 0.01480 | . | . |
10 -0.16993 | ***| . |



The ARIMA Procedure

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

11 0.01941 | . | . |
12 -0.04443 | . *| . |
13 -0.00999 | . | . |
14 0.02182 | . | . |
15 -0.02391 | . | . |
16 0.01288 | . | . |
17 0.02824 | . |* . |
18 -0.03622 | . *| . |
19 0.04985 | . |* . |
20 -0.04472 | . *| . |
21 -0.00915 | . | . |
22 -0.00547 | . | . |
23 0.01542 | . | . |
24 -0.00606 | . | . |
25 -0.00335 | . | . |
26 -0.02004 | . | . |
27 0.04291 | . |* . |
28 0.02714 | . |* . |
29 0.01394 | . | . |
30 -0.02090 | . | . |



Autocorrelation Check for White Noise

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 1178.08 6 <.0001 0.961 0.927 0.891 0.854 0.812 0.772
12 1830.96 12 <.0001 0.735 0.698 0.663 0.618 0.577 0.535
18 2099.98 18 <.0001 0.494 0.455 0.416 0.381 0.350 0.319
24 2187.63 24 <.0001 0.291 0.263 0.236 0.210 0.187 0.164
30 2208.00 30 <.0001 0.144 0.125 0.109 0.098 0.088 0.077


/*From the ACF, we can infer that the data is not stationary, hence
differencing is needed.
our best guess is to try first order differencing*/


proc arima data=stock;
identify var=Adj_Close(1) nlag=30 outcov=exp2;
run;








The ARIMA Procedure

Name of Variable = Adj_Close

Period(s) of Differencing 1
Mean of Working Series 1.899683
Standard Deviation 20.32195
Number of Observations 252
Observation(s) eliminated by differencing 1


Autocorrelations

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 412.982 1.00000 | |********************| 0
1 -59.160544 -.14325 | ***| . | 0.062994
2 34.677066 0.08397 | . |**. | 0.064274
3 12.419977 0.03007 | . |* . | 0.064708
4 25.439203 0.06160 | . |* . | 0.064763
5 21.561830 0.05221 | . |* . | 0.064995
6 -20.122190 -.04872 | . *| . | 0.065161
7 6.304886 0.01527 | . | . | 0.065306
8 21.731745 0.05262 | . |* . | 0.065320
9 85.722637 0.20757 | . |**** | 0.065488
10 -6.478523 -.01569 | . | . | 0.068049
11 12.119983 0.02935 | . |* . | 0.068063
12 9.923122 0.02403 | . | . | 0.068113
13 33.774442 0.08178 | . |**. | 0.068147
14 -4.241604 -.01027 | . | . | 0.068535
15 -39.391957 -.09538 | .**| . | 0.068541
16 27.716807 0.06711 | . |* . | 0.069066
17 4.525703 0.01096 | . | . | 0.069324
18 -9.141073 -.02213 | . | . | 0.069331
19 -30.217333 -.07317 | . *| . | 0.069359
20 8.227113 0.01992 | . | . | 0.069665
21 0.260349 0.00063 | . | . | 0.069687
22 -18.925956 -.04583 | . *| . | 0.069688
23 16.901145 0.04092 | . |* . | 0.069807
24 6.330901 0.01533 | . | . | 0.069902
25 21.346249 0.05169 | . |* . | 0.069915
26 -17.803437 -.04311 | . *| . | 0.070067
27 -30.583081 -.07405 | . *| . | 0.070172
28 -29.167309 -.07063 | . *| . | 0.070482
29 23.411696 0.05669 | . |* . | 0.070762
30 -12.212801 -.02957 | . *| . | 0.070942

"." marks two standard errors



The ARIMA Procedure

Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.19486 | . |**** |
2 -0.10189 | .**| . |
3 -0.09142 | .**| . |
4 -0.04078 | . *| . |
5 -0.03066 | . *| . |
6 0.04418 | . |* . |
7 0.05151 | . |* . |
8 -0.07969 | .**| . |
9 -0.24040 | *****| . |
10 -0.09986 | .**| . |
11 -0.01536 | . | . |
12 -0.01524 | . | . |
13 -0.05440 | . *| . |
14 0.04872 | . |* . |
15 0.10342 | . |**. |
16 -0.02388 | . | . |
17 -0.04144 | . *| . |
18 0.02634 | . |* . |
19 0.05569 | . |* . |
20 0.04485 | . |* . |
21 0.06982 | . |* . |
22 0.04916 | . |* . |
23 -0.09061 | .**| . |
24 -0.10207 | .**| . |
25 -0.03212 | . *| . |
26 0.05952 | . |* . |
27 0.08664 | . |**. |
28 0.04202 | . |* . |
29 -0.04503 | . *| . |
30 -0.01740 | . | . |


Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 -0.14325 | ***| . |
2 0.06478 | . |* . |
3 0.05188 | . |* . |
4 0.06902 | . |* . |
5 0.06571 | . |* . |
6 -0.04551 | . *| . |
7 -0.01323 | . | . |
8 0.05214 | . |* . |
9 0.22805 | . |***** |
10 0.04709 | . |* . |



The ARIMA Procedure

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

11 -0.00050 | . | . |
12 -0.00755 | . | . |
13 0.05229 | . |* . |
14 -0.00658 | . | . |
15 -0.09704 | .**| . |
16 0.02966 | . |* . |
17 0.00637 | . | . |
18 -0.07592 | .**| . |
19 -0.09427 | .**| . |
20 -0.00487 | . | . |
21 -0.01111 | . | . |
22 -0.07107 | . *| . |
23 0.05740 | . |* . |
24 0.08539 | . |**. |
25 0.04078 | . |* . |
26 -0.04392 | . *| . |
27 -0.07080 | . *| . |
28 -0.06395 | . *| . |
29 0.04637 | . |* . |
30 0.02077 | . | . |


Autocorrelation Check for White Noise

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 9.57 6 0.1438 -0.143 0.084 0.030 0.062 0.052 -0.049
12 22.16 12 0.0358 0.015 0.053 0.208 -0.016 0.029 0.024
18 27.82 18 0.0648 0.082 -0.010 -0.095 0.067 0.011 -0.022
24 30.52 24 0.1680 -0.073 0.020 0.001 -0.046 0.041 0.015
30 35.96 30 0.2093 0.052 -0.043 -0.074 -0.071 0.057 -0.030



/*From the ACF and PACF of modified data, we know that the modified data is
stationary.
Now, we begin to predict the model of the modified data.
First prediction is AR(9)*/

estimate p=9 q=0 plot;
run;

The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx
Parameter Estimate Error t Value Pr > |t| Lag

MU 2.03858 1.79034 1.14 0.2560 0
AR1,1 -0.15573 0.06277 -2.48 0.0138 1
AR1,2 0.07098 0.06333 1.12 0.2635 2
AR1,3 0.06979 0.06348 1.10 0.2727 3
AR1,4 0.06655 0.06356 1.05 0.2962 4
AR1,5 0.03887 0.06367 0.61 0.5421 5
AR1,6 -0.06604 0.06361 -1.04 0.3002 6
AR1,7 -0.02201 0.06363 -0.35 0.7298 7
AR1,8 0.08540 0.06347 1.35 0.1797 8
AR1,9 0.23080 0.06293 3.67 0.0003 9


Constant Estimate 1.389074
Variance Estimate 390.5831
Std Error Estimate 19.76318
AIC 2228.787
SBC 2264.081
Number of Residuals 252
* AIC and SBC do not include log determinant.


Correlations of Parameter Estimates

Parameter MU AR1,1 AR1,2 AR1,3 AR1,4

MU 1.000 -0.007 -0.004 -0.001 0.004
AR1,1 -0.007 1.000 0.141 -0.070 -0.060
AR1,2 -0.004 0.141 1.000 0.130 -0.075
AR1,3 -0.001 -0.070 0.130 1.000 0.134
AR1,4 0.004 -0.060 -0.075 0.134 1.000
AR1,5 0.006 -0.078 -0.073 -0.069 0.141
AR1,6 0.002 -0.053 -0.090 -0.070 -0.063
AR1,7 0.003 0.049 -0.048 -0.092 -0.068
AR1,8 0.005 0.005 0.045 -0.048 -0.089
AR1,9 0.005 -0.052 0.005 0.048 -0.053

Correlations of Parameter Estimates

Parameter AR1,5 AR1,6 AR1,7 AR1,8 AR1,9

MU 0.006 0.002 0.003 0.005 0.005
AR1,1 -0.078 -0.053 0.049 0.005 -0.052
AR1,2 -0.073 -0.090 -0.048 0.045 0.005
AR1,3 -0.069 -0.070 -0.092 -0.048 0.048
AR1,4 0.141 -0.063 -0.068 -0.089 -0.053

The ARIMA Procedure

Correlations of Parameter Estimates

Parameter AR1,5 AR1,6 AR1,7 AR1,8 AR1,9

AR1,5 1.000 0.141 -0.069 -0.072 -0.078
AR1,6 0.141 1.000 0.132 -0.076 -0.059
AR1,7 -0.069 0.132 1.000 0.129 -0.071
AR1,8 -0.072 -0.076 0.129 1.000 0.140
AR1,9 -0.078 -0.059 -0.071 0.140 1.000


Autocorrelation Check of Residuals

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 . 0 . -0.011 -0.002 0.002 -0.010 -0.004 0.020
12 1.68 3 0.6422 -0.002 -0.010 0.016 0.072 -0.003 0.007
18 6.74 9 0.6638 0.071 -0.031 -0.090 0.041 0.004 -0.054
24 11.16 15 0.7410 -0.051 -0.015 -0.039 -0.040 0.087 0.048
30 15.01 21 0.8224 0.030 -0.047 -0.068 -0.029 0.064 -0.028
36 20.40 27 0.8134 -0.067 -0.004 0.068 0.001 0.008 -0.096
42 26.24 33 0.7921 -0.132 0.010 0.014 -0.028 -0.005 -0.031
48 27.92 39 0.9066 -0.034 -0.011 0.013 -0.052 -0.031 -0.020


Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 390.583 1.00000 | |********************| 0
1 -4.209177 -.01078 | . | . | 0.062994
2 -0.780602 -.00200 | . | . | 0.063001
3 0.923379 0.00236 | . | . | 0.063002
4 -3.938433 -.01008 | . | . | 0.063002
5 -1.679679 -.00430 | . | . | 0.063008
6 7.964565 0.02039 | . | . | 0.063010
7 -0.689568 -.00177 | . | . | 0.063036
8 -4.044645 -.01036 | . | . | 0.063036
9 6.328491 0.01620 | . | . | 0.063043
10 28.314461 0.07249 | . |* . | 0.063059
11 -1.251031 -.00320 | . | . | 0.063389
12 2.861593 0.00733 | . | . | 0.063390
13 27.820577 0.07123 | . |* . | 0.063393
14 -11.999885 -.03072 | . *| . | 0.063710
15 -35.332000 -.09046 | .**| . | 0.063769
16 15.971980 0.04089 | . |* . | 0.064276
17 1.504888 0.00385 | . | . | 0.064379
18 -20.944722 -.05362 | . *| . | 0.064380
19 -19.796349 -.05068 | . *| . | 0.064557


The ARIMA Procedure

Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

20 -5.846228 -.01497 | . | . | 0.064715
21 -15.338245 -.03927 | . *| . | 0.064728
22 -15.769069 -.04037 | . *| . | 0.064823
23 33.975576 0.08699 | . |**. | 0.064923
24 18.884379 0.04835 | . |* . | 0.065383
25 11.565357 0.02961 | . |* . | 0.065525
26 -18.441724 -.04722 | . *| . | 0.065578
27 -26.521192 -.06790 | . *| . | 0.065713
28 -11.487942 -.02941 | . *| . | 0.065991
29 25.048909 0.06413 | . |* . | 0.066043
30 -11.027101 -.02823 | . *| . | 0.066289

"." marks two standard errors


Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.02533 | . |* . |
2 -0.03822 | . *| . |
3 -0.00290 | . | . |
4 0.02388 | . | . |
5 -0.02089 | . | . |
6 -0.02543 | . *| . |
7 0.01980 | . | . |
8 0.00671 | . | . |
9 -0.04795 | . *| . |
10 -0.08399 | .**| . |
11 0.01306 | . | . |
12 0.00525 | . | . |
13 -0.06339 | . *| . |
14 0.02102 | . | . |
15 0.09870 | . |**. |
16 -0.03540 | . *| . |
17 -0.02223 | . | . |
18 0.05271 | . |* . |
19 0.06802 | . |* . |
20 0.01232 | . | . |
21 0.02802 | . |* . |
22 0.04662 | . |* . |
23 -0.06742 | . *| . |
24 -0.06343 | . *| . |
25 -0.04137 | . *| . |
26 0.06032 | . |* . |
27 0.05916 | . |* . |


The ARIMA Procedure

Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

28 0.00297 | . | . |
29 -0.05555 | . *| . |
30 0.03155 | . |* . |


Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 -0.01078 | . | . |
2 -0.00211 | . | . |
3 0.00232 | . | . |
4 -0.01004 | . | . |
5 -0.00451 | . | . |
6 0.02025 | . | . |
7 -0.00130 | . | . |
8 -0.01040 | . | . |
9 0.01581 | . | . |
10 0.07327 | . |* . |
11 -0.00135 | . | . |
12 0.00680 | . | . |
13 0.07188 | . |* . |
14 -0.02719 | . *| . |
15 -0.09225 | .**| . |
16 0.03673 | . |* . |
17 0.00753 | . | . |
18 -0.05505 | . *| . |
19 -0.06049 | . *| . |
20 -0.01824 | . | . |
21 -0.03542 | . *| . |
22 -0.05136 | . *| . |
23 0.07631 | . |**. |
24 0.06388 | . |* . |
25 0.04223 | . |* . |
26 -0.06061 | . *| . |
27 -0.06086 | . *| . |
28 -0.00673 | . | . |
29 0.06021 | . |* . |
30 -0.03344 | . *| . |



Model for variable Adj_Close

Estimated Mean 2.038583
Period(s) of Differencing 1



The ARIMA Procedure

Autoregressive Factors

Factor 1: 1 + 0.15573 B**(1) - 0.07098 B**(2) - 0.06979 B**(3) - 0.06655 B**(4) - 0.03887
B**(5) + 0.06604 B**(6) + 0.02201 B**(7) - 0.0854 B**(8) - 0.2308 B**(9)

/*Second prediction is MA(9)*/

estimate p=0 q=9 plot;
run;


The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx
Parameter Estimate Error t Value Pr > |t| Lag

MU 1.91649 1.53904 1.25 0.2142 0
MA1,1 0.17472 0.06263 2.79 0.0057 1
MA1,2 -0.07831 0.06356 -1.23 0.2191 2
MA1,3 -0.01724 0.06373 -0.27 0.7870 3
MA1,4 -0.02087 0.06375 -0.33 0.7437 4
MA1,5 -0.05457 0.06366 -0.86 0.3921 5
MA1,6 0.01909 0.06382 0.30 0.7651 6
MA1,7 0.01998 0.06384 0.31 0.7546 7
MA1,8 -0.05289 0.06367 -0.83 0.4070 8
MA1,9 -0.23791 0.06276 -3.79 0.0002 9


Constant Estimate 1.916492
Variance Estimate 391.3721
Std Error Estimate 19.78313
AIC 2229.295
SBC 2264.59
Number of Residuals 252
* AIC and SBC do not include log determinant.


Correlations of Parameter Estimates

Parameter MU MA1,1 MA1,2 MA1,3 MA1,4

MU 1.000 0.005 0.003 0.004 -0.001
MA1,1 0.005 1.000 -0.197 0.086 0.021
MA1,2 0.003 -0.197 1.000 -0.205 0.082
MA1,3 0.004 0.086 -0.205 1.000 -0.204
MA1,4 -0.001 0.021 0.082 -0.204 1.000
MA1,5 -0.002 0.007 0.014 0.086 -0.203
MA1,6 0.003 0.055 -0.004 0.018 0.086
MA1,7 0.003 -0.026 0.058 -0.006 0.020
MA1,8 0.003 -0.039 -0.026 0.058 -0.006
MA1,9 0.003 0.101 -0.039 -0.025 0.055

Correlations of Parameter Estimates

Parameter MA1,5 MA1,6 MA1,7 MA1,8 MA1,9

MU -0.002 0.003 0.003 0.003 0.003
MA1,1 0.007 0.055 -0.026 -0.039 0.101
MA1,2 0.014 -0.004 0.058 -0.026 -0.039
MA1,3 0.086 0.018 -0.006 0.058 -0.025
MA1,4 -0.203 0.086 0.020 -0.006 0.055
MA1,5 1.000 -0.203 0.085 0.015 0.007
MA1,6 -0.203 1.000 -0.204 0.083 0.022


The ARIMA Procedure

Correlations of Parameter Estimates

Parameter MA1,5 MA1,6 MA1,7 MA1,8 MA1,9

MA1,7 0.085 -0.204 1.000 -0.206 0.086
MA1,8 0.015 0.083 -0.206 1.000 -0.197
MA1,9 0.007 0.022 0.086 -0.197 1.000


Autocorrelation Check of Residuals

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 . 0 . 0.008 0.013 0.017 0.024 -0.008 -0.028
12 1.44 3 0.6966 0.010 0.027 -0.003 0.005 0.032 0.041
18 7.74 9 0.5602 0.093 -0.023 -0.105 0.044 0.031 -0.018
24 11.24 15 0.7353 -0.072 -0.008 -0.015 -0.046 0.054 0.046
30 14.88 21 0.8289 0.042 -0.049 -0.064 -0.035 0.051 -0.027
36 19.33 27 0.8577 -0.055 -0.002 0.063 -0.001 -0.007 -0.090
42 23.80 33 0.8800 -0.113 0.004 -0.003 -0.032 -0.011 -0.031
48 25.14 39 0.9581 -0.027 -0.023 -0.009 -0.043 -0.018 -0.029


Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 391.372 1.00000 | |********************| 0
1 3.149001 0.00805 | . | . | 0.062994
2 4.953927 0.01266 | . | . | 0.062998
3 6.474995 0.01654 | . | . | 0.063008
4 9.496673 0.02427 | . | . | 0.063025
5 -3.181975 -.00813 | . | . | 0.063063
6 -11.069498 -.02828 | . *| . | 0.063067
7 4.018638 0.01027 | . | . | 0.063117
8 10.450316 0.02670 | . |* . | 0.063124
9 -1.209690 -.00309 | . | . | 0.063168
10 1.780698 0.00455 | . | . | 0.063169
11 12.345174 0.03154 | . |* . | 0.063170
12 16.007940 0.04090 | . |* . | 0.063233
13 36.226116 0.09256 | . |**. | 0.063338
14 -8.922122 -.02280 | . | . | 0.063872
15 -41.124110 -.10508 | .**| . | 0.063905
16 17.360529 0.04436 | . |* . | 0.064587
17 12.191241 0.03115 | . |* . | 0.064707
18 -7.137362 -.01824 | . | . | 0.064767
19 -28.368083 -.07248 | . *| . | 0.064787
20 -3.243665 -.00829 | . | . | 0.065108
21 -5.754024 -.01470 | . | . | 0.065112
22 -17.814209 -.04552 | . *| . | 0.065126
23 21.006306 0.05367 | . |* . | 0.065252


The ARIMA Procedure

Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

24 18.005885 0.04601 | . |* . | 0.065427
25 16.255105 0.04153 | . |* . | 0.065555
26 -19.068616 -.04872 | . *| . | 0.065659
27 -25.197150 -.06438 | . *| . | 0.065803
28 -13.685256 -.03497 | . *| . | 0.066052
29 19.808825 0.05061 | . |* . | 0.066125
30 -10.720517 -.02739 | . *| . | 0.066279

"." marks two standard errors


Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.00559 | . | . |
2 -0.05030 | . *| . |
3 -0.03519 | . *| . |
4 -0.01643 | . | . |
5 0.01551 | . | . |
6 0.03176 | . |* . |
7 -0.00923 | . | . |
8 -0.03185 | . *| . |
9 0.00032 | . | . |
10 -0.01266 | . | . |
11 -0.02124 | . | . |
12 -0.01448 | . | . |
13 -0.08255 | .**| . |
14 0.00277 | . | . |
15 0.10479 | . |**. |
16 -0.03283 | . *| . |
17 -0.04208 | . *| . |
18 0.00297 | . | . |
19 0.05727 | . |* . |
20 0.01802 | . | . |
21 0.03367 | . |* . |
22 0.03734 | . |* . |
23 -0.06468 | . *| . |
24 -0.04006 | . *| . |
25 -0.03200 | . *| . |
26 0.04885 | . |* . |
27 0.05852 | . |* . |
28 0.01939 | . | . |
29 -0.04668 | . *| . |
30 0.02729 | . |* . |



The ARIMA Procedure

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.00805 | . | . |
2 0.01259 | . | . |
3 0.01635 | . | . |
4 0.02386 | . | . |
5 -0.00892 | . | . |
6 -0.02905 | . *| . |
7 0.01014 | . | . |
8 0.02703 | . |* . |
9 -0.00240 | . | . |
10 0.00486 | . | . |
11 0.02976 | . |* . |
12 0.03862 | . |* . |
13 0.09269 | . |**. |
14 -0.02485 | . | . |
15 -0.11213 | .**| . |
16 0.04213 | . |* . |
17 0.03452 | . |* . |
18 -0.01268 | . | . |
19 -0.07000 | . *| . |
20 -0.01824 | . | . |
21 -0.02166 | . | . |
22 -0.03548 | . *| . |
23 0.06286 | . |* . |
24 0.03567 | . |* . |
25 0.03139 | . |* . |
26 -0.05159 | . *| . |
27 -0.06003 | . *| . |
28 -0.02235 | . | . |
29 0.04909 | . |* . |
30 -0.02871 | . *| . |


Model for variable Adj_Close

Estimated Mean 1.916492
Period(s) of Differencing 1


Moving Average Factors

Factor 1: 1 - 0.17472 B**(1) + 0.07831 B**(2) + 0.01724 B**(3) + 0.02087 B**(4) + 0.05457
B**(5) - 0.01909 B**(6) - 0.01998 B**(7) + 0.05289 B**(8) + 0.23791 B**(9)

/*Special AR(9)*/
estimate p=(9) q=0 plot;


The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx
Parameter Estimate Error t Value Pr > |t| Lag

MU 1.95747 1.57454 1.24 0.2150 0
AR1,1 0.21022 0.06224 3.38 0.0008 9


Constant Estimate 1.545972
Variance Estimate 398.1214
Std Error Estimate 19.95298
AIC 2225.8
SBC 2232.859
Number of Residuals 252
* AIC and SBC do not include log determinant.


Correlations of Parameter
Estimates

Parameter MU AR1,1

MU 1.000 0.001
AR1,1 0.001 1.000


Autocorrelation Check of Residuals

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 10.26 5 0.0682 -0.164 0.082 0.038 0.039 0.045 -0.039
12 12.67 11 0.3156 -0.017 0.086 0.014 0.030 0.009 0.019
18 19.15 17 0.3201 0.086 -0.031 -0.097 0.058 0.011 -0.052
24 21.83 23 0.5306 -0.062 0.003 0.001 -0.053 0.050 0.023
30 25.20 29 0.6676 0.044 -0.045 -0.055 -0.035 0.053 -0.029
36 29.05 35 0.7500 -0.051 -0.016 0.060 -0.023 -0.001 -0.079
42 32.76 41 0.8170 -0.099 0.014 -0.014 -0.039 -0.008 -0.025
48 33.70 47 0.9274 -0.010 -0.032 -0.008 -0.038 -0.012 -0.016



The ARIMA Procedure

Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 398.121 1.00000 | |********************| 0
1 -65.366374 -.16419 | ***| . | 0.062994
2 32.603933 0.08189 | . |**. | 0.064670
3 14.940745 0.03753 | . |* . | 0.065080
4 15.381681 0.03864 | . |* . | 0.065166
5 17.991398 0.04519 | . |* . | 0.065257
6 -15.451303 -.03881 | . *| . | 0.065381
7 -6.639673 -.01668 | . | . | 0.065472
8 34.107442 0.08567 | . |**. | 0.065489
9 5.584597 0.01403 | . | . | 0.065932
10 11.951682 0.03002 | . |* . | 0.065944
11 3.522713 0.00885 | . | . | 0.065998
12 7.632738 0.01917 | . | . | 0.066003
13 34.269625 0.08608 | . |**. | 0.066025
14 -12.323899 -.03096 | . *| . | 0.066469
15 -38.722491 -.09726 | .**| . | 0.066526
16 23.217002 0.05832 | . |* . | 0.067088
17 4.196816 0.01054 | . | . | 0.067289
18 -20.594806 -.05173 | . *| . | 0.067296
19 -24.644566 -.06190 | . *| . | 0.067453
20 1.259091 0.00316 | . | . | 0.067678
21 0.482492 0.00121 | . | . | 0.067679
22 -21.116842 -.05304 | . *| . | 0.067679
23 19.794871 0.04972 | . |* . | 0.067844
24 9.230394 0.02318 | . | . | 0.067988
25 17.370086 0.04363 | . |* . | 0.068019
26 -17.996147 -.04520 | . *| . | 0.068130
27 -21.822135 -.05481 | . *| . | 0.068249
28 -13.932749 -.03500 | . *| . | 0.068424
29 21.116544 0.05304 | . |* . | 0.068495
30 -11.658968 -.02928 | . *| . | 0.068658

"." marks two standard errors


Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.17113 | . |*** |
2 -0.10290 | .**| . |
3 -0.08439 | .**| . |
4 -0.05480 | . *| . |
5 -0.03403 | . *| . |
6 0.04889 | . |* . |
7 0.02735 | . |* . |
8 -0.06199 | . *| . |



The ARIMA Procedure

Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

9 -0.05651 | . *| . |
10 -0.06404 | . *| . |
11 -0.02105 | . | . |
12 -0.01325 | . | . |
13 -0.06337 | . *| . |
14 0.02765 | . |* . |
15 0.10443 | . |**. |
16 -0.02950 | . *| . |
17 -0.04429 | . *| . |
18 0.04107 | . |* . |
19 0.06490 | . |* . |
20 0.03732 | . |* . |
21 0.05904 | . |* . |
22 0.02865 | . |* . |
23 -0.09052 | .**| . |
24 -0.08107 | .**| . |
25 -0.03768 | . *| . |
26 0.06187 | . |* . |
27 0.08018 | . |**. |
28 0.02427 | . | . |
29 -0.04660 | . *| . |
30 -0.00557 | . | . |


Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 -0.16419 | ***| . |
2 0.05646 | . |* . |
3 0.06133 | . |* . |
4 0.05096 | . |* . |
5 0.05371 | . |* . |
6 -0.03351 | . *| . |
7 -0.04181 | . *| . |
8 0.07745 | . |**. |
9 0.04603 | . |* . |
10 0.03334 | . |* . |
11 0.01185 | . | . |
12 0.00735 | . | . |
13 0.07713 | . |**. |
14 -0.00684 | . | . |
15 -0.12081 | .**| . |
16 0.01251 | . | . |
17 0.03209 | . |* . |
18 -0.05060 | . *| . |
19 -0.07543 | .**| . |


The ARIMA Procedure

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

20 -0.01168 | . | . |
21 -0.01384 | . | . |
22 -0.05157 | . *| . |
23 0.06517 | . |* . |
24 0.05686 | . |* . |
25 0.04720 | . |* . |
26 -0.04250 | . *| . |
27 -0.06681 | . *| . |
28 -0.04394 | . *| . |
29 0.05005 | . |* . |
30 0.00625 | . | . |


Model for variable Adj_Close

Estimated Mean 1.957466
Period(s) of Differencing 1


Autoregressive Factors

Factor 1: 1 - 0.21022 B**(9)



/Special *MA(9)*/
estimate p=0 q=(9) plot;


Conditional Least Squares Estimation

Standard Approx
Parameter Estimate Error t Value Pr > |t| Lag

MU 1.90525 1.52299 1.25 0.2121 0
MA1,1 -0.22238 0.06193 -3.59 0.0004 9


Constant Estimate 1.905255
Variance Estimate 396.8763
Std Error Estimate 19.92175
AIC 2225.01
SBC 2232.069
Number of Residuals 252
* AIC and SBC do not include log determinant.




The ARIMA Procedure

Correlations of Parameter
Estimates

Parameter MU MA1,1

MU 1.000 0.004
MA1,1 0.004 1.000


Autocorrelation Check of Residuals

To Chi- Pr >
Lag Square DF ChiSq --------------------Autocorrelations--------------------

6 10.76 5 0.0564 -0.169 0.085 0.034 0.033 0.052 -0.036
12 13.25 11 0.2771 -0.016 0.088 -0.000 0.035 0.010 0.016
18 18.87 17 0.3360 0.086 -0.032 -0.093 0.061 0.002 -0.009
24 22.10 23 0.5142 -0.075 0.007 0.002 -0.054 0.052 0.020
30 25.33 29 0.6610 0.042 -0.043 -0.055 -0.033 0.052 -0.029
36 29.09 35 0.7485 -0.049 -0.017 0.062 -0.019 -0.002 -0.077
42 32.94 41 0.8109 -0.101 0.013 -0.013 -0.040 -0.006 -0.026
48 33.86 47 0.9246 -0.011 -0.031 -0.009 -0.037 -0.011 -0.017


Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

0 396.876 1.00000 | |********************| 0
1 -67.081734 -.16902 | ***| . | 0.062994
2 33.810903 0.08519 | . |**. | 0.064769
3 13.424455 0.03383 | . |* . | 0.065212
4 13.141605 0.03311 | . |* . | 0.065282
5 20.501082 0.05166 | . |* . | 0.065348
6 -14.423539 -.03634 | . *| . | 0.065510
7 -6.349037 -.01600 | . | . | 0.065590
8 34.744757 0.08755 | . |**. | 0.065605
9 -0.045870 -.00012 | . | . | 0.066067
10 14.000886 0.03528 | . |* . | 0.066067
11 3.781957 0.00953 | . | . | 0.066142
12 6.297616 0.01587 | . | . | 0.066148
13 34.214659 0.08621 | . |**. | 0.066163
14 -12.525273 -.03156 | . *| . | 0.066607
15 -36.842747 -.09283 | .**| . | 0.066666
16 24.187405 0.06094 | . |* . | 0.067177
17 0.797138 0.00201 | . | . | 0.067396
18 -3.621449 -.00912 | . | . | 0.067396
19 -29.641861 -.07469 | . *| . | 0.067401
20 2.733820 0.00689 | . | . | 0.067729
21 0.835777 0.00211 | . | . | 0.067732
22 -21.475741 -.05411 | . *| . | 0.067732
The ARIMA Procedure

Autocorrelation Plot of Residuals

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error

23 20.587592 0.05187 | . |* . | 0.067903
24 8.036447 0.02025 | . | . | 0.068060
25 16.567370 0.04174 | . |* . | 0.068084
26 -17.090045 -.04306 | . *| . | 0.068186
27 -21.908089 -.05520 | . *| . | 0.068294
28 -13.224902 -.03332 | . *| . | 0.068471
29 20.686524 0.05212 | . |* . | 0.068535
30 -11.690233 -.02946 | . *| . | 0.068692

"." marks two standard errors


Inverse Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 0.16976 | . |*** |
2 -0.10170 | .**| . |
3 -0.08918 | .**| . |
4 -0.05809 | . *| . |
5 -0.03009 | . *| . |
6 0.05150 | . |* . |
7 0.02915 | . |* . |
8 -0.05943 | . *| . |
9 -0.04581 | . *| . |
10 -0.06193 | . *| . |
11 -0.02244 | . | . |
12 -0.01428 | . | . |
13 -0.05972 | . *| . |
14 0.02865 | . |* . |
15 0.10378 | . |**. |
16 -0.02895 | . *| . |
17 -0.05070 | . *| . |
18 0.00714 | . | . |
19 0.06524 | . |* . |
20 0.03831 | . |* . |
21 0.05890 | . |* . |
22 0.03033 | . |* . |
23 -0.08714 | .**| . |
24 -0.08003 | .**| . |
25 -0.03874 | . *| . |
26 0.06441 | . |* . |
27 0.08262 | . |**. |
28 0.02781 | . |* . |
29 -0.04461 | . *| . |
30 -0.00457 | . | . |



The ARIMA Procedure

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1

1 -0.16902 | ***| . |
2 0.05829 | . |* . |
3 0.05912 | . |* . |
4 0.04440 | . |* . |
5 0.05898 | . |* . |
6 -0.02756 | . *| . |
7 -0.04022 | . *| . |
8 0.07944 | . |**. |
9 0.03170 | . |* . |
10 0.03171 | . |* . |
11 0.01592 | . | . |
12 0.00755 | . | . |
13 0.07713 | . |**. |
14 -0.00650 | . | . |
15 -0.11858 | .**| . |
16 0.01601 | . | . |
17 0.02686 | . |* . |
18 -0.01084 | . | . |
19 -0.07494 | . *| . |
20 -0.01517 | . | . |
21 -0.01474 | . | . |
22 -0.05286 | . *| . |
23 0.06136 | . |* . |
24 0.05411 | . |* . |
25 0.04822 | . |* . |
26 -0.04540 | . *| . |
27 -0.06856 | . *| . |
28 -0.04729 | . *| . |
29 0.04802 | . |* . |
30 0.00510 | . | . |


Model for variable Adj_Close

Estimated Mean 1.905255
Period(s) of Differencing 1


Moving Average Factors

Factor 1: 1 + 0.22238 B**(9)

/*From the observations, all four models passed the ljung box test (using m=
48, the closest to 50).
However, the AIC of Special MA(9)(= 2225.01) is the smallest by a slight margin.
Hence, Special MA(9)is likely to be better than the other three models.*/


forecast lead=60 interval=daily id=date out=exp3;
run;
/*exp2 is the differenced data*/
/* We forecast the Straits Times Index over the next 2 months*/


The ARIMA Procedure

Forecasts for variable Adj_Close

Obs Forecast Std Error 95% Confidence Limits

254 3167.8120 19.9218 3128.7661 3206.8579
255 3169.6930 28.1736 3114.4737 3224.9123
256 3173.7574 34.5055 3106.1278 3241.3869
257 3172.4467 39.8435 3094.3548 3250.5385
258 3175.0070 44.5464 3087.6977 3262.3164
259 3178.5079 48.7981 3082.8654 3274.1505
260 3180.2651 52.7080 3076.9593 3283.5709
261 3182.9325 56.3472 3072.4940 3293.3711
262 3179.4147 59.7653 3062.2769 3296.5525
263 3181.3199 64.5361 3054.8315 3307.8083
264 3183.2252 68.9777 3048.0313 3318.4191
265 3185.1305 73.1502 3041.7588 3328.5021
266 3187.0357 77.0971 3035.9281 3338.1433
267 3188.9410 80.8516 3030.4747 3347.4072
268 3190.8462 84.4394 3025.3481 3356.3443
269 3192.7515 87.8807 3020.5084 3364.9946
270 3194.6567 91.1924 3015.9230 3373.3905
271 3196.5620 94.3878 3011.5652 3381.5588
272 3198.4672 97.4786 3007.4126 3389.5219
273 3200.3725 100.4744 3003.4463 3397.2987
274 3202.2777 103.3834 2999.6500 3404.9055
275 3204.1830 106.2127 2996.0099 3412.3561
276 3206.0883 108.9686 2992.5137 3419.6629
277 3207.9935 111.6565 2989.1507 3426.8363
278 3209.8988 114.2812 2985.9116 3433.8859
279 3211.8040 116.8470 2982.7881 3440.8199
280 3213.7093 119.3576 2979.7726 3447.6459
281 3215.6145 121.8165 2976.8586 3454.3705
282 3217.5198 124.2267 2974.0399 3460.9997
283 3219.4250 126.5911 2971.3111 3467.5390
284 3221.3303 128.9121 2968.6673 3473.9933
285 3223.2355 131.1920 2966.1039 3480.3672
286 3225.1408 133.4330 2963.6170 3486.6646
287 3227.0461 135.6369 2961.2025 3492.8896
288 3228.9513 137.8057 2958.8572 3499.0455
289 3230.8566 139.9408 2956.5777 3505.1354
290 3232.7618 142.0438 2954.3611 3511.1626
291 3234.6671 144.1161 2952.2046 3517.1295
292 3236.5723 146.1591 2950.1058 3523.0389
293 3238.4776 148.1739 2948.0621 3528.8931
294 3240.3828 150.1616 2946.0714 3534.6943
295 3242.2881 152.1234 2944.1316 3540.4446
296 3244.1934 154.0602 2942.2408 3546.1459
297 3246.0986 155.9730 2940.3971 3551.8001
298 3248.0039 157.8626 2938.5989 3557.4089
299 3249.9091 159.7298 2936.8444 3562.9738
300 3251.8144 161.5755 2935.1322 3568.4965



The ARIMA Procedure

Forecasts for variable Adj_Close

Obs Forecast Std Error 95% Confidence Limits

301 3253.7196 163.4003 2933.4609 3573.9783
302 3255.6249 165.2050 2931.8291 3579.4206
303 3257.5301 166.9901 2930.2355 3584.8247
304 3259.4354 168.7564 2928.6790 3590.1918
305 3261.3406 170.5044 2927.1582 3595.5231
306 3263.2459 172.2346 2925.6723 3600.8195
307 3265.1512 173.9476 2924.2201 3606.0822
308 3267.0564 175.6439 2922.8006 3611.3122
309 3268.9617 177.3240 2921.4129 3616.5104
310 3270.8669 178.9884 2920.0562 3621.6777
311 3272.7722 180.6374 2918.7295 3626.8149
312 3274.6774 182.2714 2917.4320 3631.9229
313 3276.5827 183.8910 2916.1630 3637.0024


Complete SAS Code:

data work4;
/*plot original time series*/
proc gplot data=stock;
symbol i=spline c=red;
plot Adj_Close*ID;
run;
proc arima data=stock;
identify var=Adj_Close nlag=30 outcov=exp1;
run;
proc arima data=stock;
identify var=Adj_Close(1) nlag=30 outcov=exp2;
run;
/*AR(9)*/
estimate p=9 q=0 plot;
/*MA(9)*/
estimate p=0 q=9 plot;
/*Special AR(9)*/
estimate p=(9) q=0 plot;
/*Special MA(9)*/
estimate p=0 q=(9) plot;
/*Special MA(9)forecast*/
forecast lead=60 interval=daily id=date out=exp3;
/*exp2 is the differenced data*/
run;
quit;













Using Time Series Forecasting System:

Graph of predicted values using AR(9) ) [for reference]:

Graph of predicted values using MA(9) [for reference]:
Graph of predicted values using Special AR(9) ) [for reference]:




Graph of Special MA(9):



Plot of ACF and PACF of residual, model = SMA(9)

Based on the plot, the ACF and PACF both cut off at lag 1, hence, we can improve the model
by fitting the residual as MA(1) or AR(1), which respectively change the model to special
ARIMA(0,1,10) and special ARIMA(1,1,9)

SAS Code (for improved models)
data work4;
/*plot original time series*/
proc gplot data=stock;
symbol i=spline c=red;
plot Adj_Close*ID;
run;
proc arima data=stock;
identify var=Adj_Close nlag=30 outcov=exp1;
run;
proc arima data=stock;
identify var=Adj_Close(1) nlag=30 outcov=exp2;
run;
/*Special ARMA(1,9)*/
estimate p=(1) q=(9) plot;
/*Special MA(10)*/
estimate p=0 q=(1)(9)(10) plot;
run;
quit;


Result for improved model of ARIMA (1,1,9)












Result for improved model of ARIMA (0,1,10)

Both Special ARIMA (1,1,9) and Special ARIMA (0,1,10) passed the ljung box test.
Comparing Special ARIMA (1,1,9) and Special ARIMA (0,1,10), the AICs are 2219.524 and
2222.096 respectively. Hence we choose special ARIMA (1,1,9) which has the smaller AIC.

You might also like