Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSun, 20 Dec 2009 05:44:22 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/20/t1261313406uuv4dfz0zcq5cs4.htm/, Retrieved Sat, 27 Apr 2024 12:59:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69864, Retrieved Sat, 27 Apr 2024 12:59:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsshwpaper31
Estimated Impact96
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-20 12:44:22] [4407d6264e55b051ec65750e6dca2820] [Current]
Feedback Forum

Post a new message
Dataseries X:
14497
14398,3
16629,6
16670,7
16614,8
16869,2
15663,9
16359,9
18447,7
16889
16505
18320,9
15052,1
15699,8
18135,3
16768,7
18883
19021
18101,9
17776,1
21489,9
17065,3
18690
18953,1
16398,9
16895,6
18553
19270
19422,1
17579,4
18637,3
18076,7
20438,6
18075,2
19563
19899,2
19227,5
17789,6
19220,8
21968,9
21131,5
19484,6
22168,7
20866,8
22176,2
23533,8
21479,6
24347,7
22751,6
20328,3
23650,4
23335,7
19614,9
18042,3
17282,5
16847,2
18159,5
16540,9
15952,7
18357,8
16394,3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69864&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69864&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69864&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[49])
3719227.5-------
3817789.6-------
3919220.8-------
4021968.9-------
4121131.5-------
4219484.6-------
4322168.7-------
4420866.8-------
4522176.2-------
4623533.8-------
4721479.6-------
4824347.7-------
4922751.6-------
5020328.320821.914618706.578122937.25110.32370.03690.99750.0369
5123650.423256.752421138.869825374.63510.35780.99660.99990.6799
5223335.725270.522522946.810327594.23470.05130.91410.99730.9832
5319614.924614.169821992.122927236.21661e-040.83040.99540.9181
5418042.323192.009820525.686425858.33331e-040.99570.99680.6269
5517282.525550.590422676.22428424.9568010.98940.9718
5616847.224450.754921442.753727458.7562010.99020.8659
5718159.525737.639322638.06428837.2147010.98780.9705
5816540.927006.020623752.039430260.0019010.98180.9948
5915952.725053.739421697.056628410.4222010.98160.9106
6018357.827869.004924404.723531333.2862010.97680.9981
6116394.326269.49522686.158829852.8312010.97280.9728

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[49]) \tabularnewline
37 & 19227.5 & - & - & - & - & - & - & - \tabularnewline
38 & 17789.6 & - & - & - & - & - & - & - \tabularnewline
39 & 19220.8 & - & - & - & - & - & - & - \tabularnewline
40 & 21968.9 & - & - & - & - & - & - & - \tabularnewline
41 & 21131.5 & - & - & - & - & - & - & - \tabularnewline
42 & 19484.6 & - & - & - & - & - & - & - \tabularnewline
43 & 22168.7 & - & - & - & - & - & - & - \tabularnewline
44 & 20866.8 & - & - & - & - & - & - & - \tabularnewline
45 & 22176.2 & - & - & - & - & - & - & - \tabularnewline
46 & 23533.8 & - & - & - & - & - & - & - \tabularnewline
47 & 21479.6 & - & - & - & - & - & - & - \tabularnewline
48 & 24347.7 & - & - & - & - & - & - & - \tabularnewline
49 & 22751.6 & - & - & - & - & - & - & - \tabularnewline
50 & 20328.3 & 20821.9146 & 18706.5781 & 22937.2511 & 0.3237 & 0.0369 & 0.9975 & 0.0369 \tabularnewline
51 & 23650.4 & 23256.7524 & 21138.8698 & 25374.6351 & 0.3578 & 0.9966 & 0.9999 & 0.6799 \tabularnewline
52 & 23335.7 & 25270.5225 & 22946.8103 & 27594.2347 & 0.0513 & 0.9141 & 0.9973 & 0.9832 \tabularnewline
53 & 19614.9 & 24614.1698 & 21992.1229 & 27236.2166 & 1e-04 & 0.8304 & 0.9954 & 0.9181 \tabularnewline
54 & 18042.3 & 23192.0098 & 20525.6864 & 25858.3333 & 1e-04 & 0.9957 & 0.9968 & 0.6269 \tabularnewline
55 & 17282.5 & 25550.5904 & 22676.224 & 28424.9568 & 0 & 1 & 0.9894 & 0.9718 \tabularnewline
56 & 16847.2 & 24450.7549 & 21442.7537 & 27458.7562 & 0 & 1 & 0.9902 & 0.8659 \tabularnewline
57 & 18159.5 & 25737.6393 & 22638.064 & 28837.2147 & 0 & 1 & 0.9878 & 0.9705 \tabularnewline
58 & 16540.9 & 27006.0206 & 23752.0394 & 30260.0019 & 0 & 1 & 0.9818 & 0.9948 \tabularnewline
59 & 15952.7 & 25053.7394 & 21697.0566 & 28410.4222 & 0 & 1 & 0.9816 & 0.9106 \tabularnewline
60 & 18357.8 & 27869.0049 & 24404.7235 & 31333.2862 & 0 & 1 & 0.9768 & 0.9981 \tabularnewline
61 & 16394.3 & 26269.495 & 22686.1588 & 29852.8312 & 0 & 1 & 0.9728 & 0.9728 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69864&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[49])[/C][/ROW]
[ROW][C]37[/C][C]19227.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17789.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19220.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21968.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]21131.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]19484.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]22168.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]20866.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]22176.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]23533.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]21479.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]24347.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22751.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]20328.3[/C][C]20821.9146[/C][C]18706.5781[/C][C]22937.2511[/C][C]0.3237[/C][C]0.0369[/C][C]0.9975[/C][C]0.0369[/C][/ROW]
[ROW][C]51[/C][C]23650.4[/C][C]23256.7524[/C][C]21138.8698[/C][C]25374.6351[/C][C]0.3578[/C][C]0.9966[/C][C]0.9999[/C][C]0.6799[/C][/ROW]
[ROW][C]52[/C][C]23335.7[/C][C]25270.5225[/C][C]22946.8103[/C][C]27594.2347[/C][C]0.0513[/C][C]0.9141[/C][C]0.9973[/C][C]0.9832[/C][/ROW]
[ROW][C]53[/C][C]19614.9[/C][C]24614.1698[/C][C]21992.1229[/C][C]27236.2166[/C][C]1e-04[/C][C]0.8304[/C][C]0.9954[/C][C]0.9181[/C][/ROW]
[ROW][C]54[/C][C]18042.3[/C][C]23192.0098[/C][C]20525.6864[/C][C]25858.3333[/C][C]1e-04[/C][C]0.9957[/C][C]0.9968[/C][C]0.6269[/C][/ROW]
[ROW][C]55[/C][C]17282.5[/C][C]25550.5904[/C][C]22676.224[/C][C]28424.9568[/C][C]0[/C][C]1[/C][C]0.9894[/C][C]0.9718[/C][/ROW]
[ROW][C]56[/C][C]16847.2[/C][C]24450.7549[/C][C]21442.7537[/C][C]27458.7562[/C][C]0[/C][C]1[/C][C]0.9902[/C][C]0.8659[/C][/ROW]
[ROW][C]57[/C][C]18159.5[/C][C]25737.6393[/C][C]22638.064[/C][C]28837.2147[/C][C]0[/C][C]1[/C][C]0.9878[/C][C]0.9705[/C][/ROW]
[ROW][C]58[/C][C]16540.9[/C][C]27006.0206[/C][C]23752.0394[/C][C]30260.0019[/C][C]0[/C][C]1[/C][C]0.9818[/C][C]0.9948[/C][/ROW]
[ROW][C]59[/C][C]15952.7[/C][C]25053.7394[/C][C]21697.0566[/C][C]28410.4222[/C][C]0[/C][C]1[/C][C]0.9816[/C][C]0.9106[/C][/ROW]
[ROW][C]60[/C][C]18357.8[/C][C]27869.0049[/C][C]24404.7235[/C][C]31333.2862[/C][C]0[/C][C]1[/C][C]0.9768[/C][C]0.9981[/C][/ROW]
[ROW][C]61[/C][C]16394.3[/C][C]26269.495[/C][C]22686.1588[/C][C]29852.8312[/C][C]0[/C][C]1[/C][C]0.9728[/C][C]0.9728[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69864&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69864&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[49])
3719227.5-------
3817789.6-------
3919220.8-------
4021968.9-------
4121131.5-------
4219484.6-------
4322168.7-------
4420866.8-------
4522176.2-------
4623533.8-------
4721479.6-------
4824347.7-------
4922751.6-------
5020328.320821.914618706.578122937.25110.32370.03690.99750.0369
5123650.423256.752421138.869825374.63510.35780.99660.99990.6799
5223335.725270.522522946.810327594.23470.05130.91410.99730.9832
5319614.924614.169821992.122927236.21661e-040.83040.99540.9181
5418042.323192.009820525.686425858.33331e-040.99570.99680.6269
5517282.525550.590422676.22428424.9568010.98940.9718
5616847.224450.754921442.753727458.7562010.99020.8659
5718159.525737.639322638.06428837.2147010.98780.9705
5816540.927006.020623752.039430260.0019010.98180.9948
5915952.725053.739421697.056628410.4222010.98160.9106
6018357.827869.004924404.723531333.2862010.97680.9981
6116394.326269.49522686.158829852.8312010.97280.9728







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0518-0.02370243655.372200
510.04650.01690.0203154958.4113199306.8918446.438
520.0469-0.07660.03913743538.04041380717.27461175.0393
530.0543-0.20310.080124992698.4377283712.56522698.8354
540.0587-0.2220.108526519511.486911130872.34963336.2962
550.0574-0.32360.144368361318.555420669280.05064546.348
560.0628-0.3110.168157814047.669425975675.42475096.6337
570.0614-0.29440.183957428195.894429907240.48345468.7513
580.0615-0.38750.2065109518749.45638752963.70266225.1878
590.0684-0.36330.222282828918.150943160559.14746569.6696
600.0634-0.34130.23390463018.237347460782.7016889.1787
610.0696-0.37590.244997519475.640951632340.4467185.5647

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0518 & -0.0237 & 0 & 243655.3722 & 0 & 0 \tabularnewline
51 & 0.0465 & 0.0169 & 0.0203 & 154958.4113 & 199306.8918 & 446.438 \tabularnewline
52 & 0.0469 & -0.0766 & 0.0391 & 3743538.0404 & 1380717.2746 & 1175.0393 \tabularnewline
53 & 0.0543 & -0.2031 & 0.0801 & 24992698.437 & 7283712.5652 & 2698.8354 \tabularnewline
54 & 0.0587 & -0.222 & 0.1085 & 26519511.4869 & 11130872.3496 & 3336.2962 \tabularnewline
55 & 0.0574 & -0.3236 & 0.1443 & 68361318.5554 & 20669280.0506 & 4546.348 \tabularnewline
56 & 0.0628 & -0.311 & 0.1681 & 57814047.6694 & 25975675.4247 & 5096.6337 \tabularnewline
57 & 0.0614 & -0.2944 & 0.1839 & 57428195.8944 & 29907240.4834 & 5468.7513 \tabularnewline
58 & 0.0615 & -0.3875 & 0.2065 & 109518749.456 & 38752963.7026 & 6225.1878 \tabularnewline
59 & 0.0684 & -0.3633 & 0.2222 & 82828918.1509 & 43160559.1474 & 6569.6696 \tabularnewline
60 & 0.0634 & -0.3413 & 0.233 & 90463018.2373 & 47460782.701 & 6889.1787 \tabularnewline
61 & 0.0696 & -0.3759 & 0.2449 & 97519475.6409 & 51632340.446 & 7185.5647 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69864&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]50[/C][C]0.0518[/C][C]-0.0237[/C][C]0[/C][C]243655.3722[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0465[/C][C]0.0169[/C][C]0.0203[/C][C]154958.4113[/C][C]199306.8918[/C][C]446.438[/C][/ROW]
[ROW][C]52[/C][C]0.0469[/C][C]-0.0766[/C][C]0.0391[/C][C]3743538.0404[/C][C]1380717.2746[/C][C]1175.0393[/C][/ROW]
[ROW][C]53[/C][C]0.0543[/C][C]-0.2031[/C][C]0.0801[/C][C]24992698.437[/C][C]7283712.5652[/C][C]2698.8354[/C][/ROW]
[ROW][C]54[/C][C]0.0587[/C][C]-0.222[/C][C]0.1085[/C][C]26519511.4869[/C][C]11130872.3496[/C][C]3336.2962[/C][/ROW]
[ROW][C]55[/C][C]0.0574[/C][C]-0.3236[/C][C]0.1443[/C][C]68361318.5554[/C][C]20669280.0506[/C][C]4546.348[/C][/ROW]
[ROW][C]56[/C][C]0.0628[/C][C]-0.311[/C][C]0.1681[/C][C]57814047.6694[/C][C]25975675.4247[/C][C]5096.6337[/C][/ROW]
[ROW][C]57[/C][C]0.0614[/C][C]-0.2944[/C][C]0.1839[/C][C]57428195.8944[/C][C]29907240.4834[/C][C]5468.7513[/C][/ROW]
[ROW][C]58[/C][C]0.0615[/C][C]-0.3875[/C][C]0.2065[/C][C]109518749.456[/C][C]38752963.7026[/C][C]6225.1878[/C][/ROW]
[ROW][C]59[/C][C]0.0684[/C][C]-0.3633[/C][C]0.2222[/C][C]82828918.1509[/C][C]43160559.1474[/C][C]6569.6696[/C][/ROW]
[ROW][C]60[/C][C]0.0634[/C][C]-0.3413[/C][C]0.233[/C][C]90463018.2373[/C][C]47460782.701[/C][C]6889.1787[/C][/ROW]
[ROW][C]61[/C][C]0.0696[/C][C]-0.3759[/C][C]0.2449[/C][C]97519475.6409[/C][C]51632340.446[/C][C]7185.5647[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69864&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69864&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0518-0.02370243655.372200
510.04650.01690.0203154958.4113199306.8918446.438
520.0469-0.07660.03913743538.04041380717.27461175.0393
530.0543-0.20310.080124992698.4377283712.56522698.8354
540.0587-0.2220.108526519511.486911130872.34963336.2962
550.0574-0.32360.144368361318.555420669280.05064546.348
560.0628-0.3110.168157814047.669425975675.42475096.6337
570.0614-0.29440.183957428195.894429907240.48345468.7513
580.0615-0.38750.2065109518749.45638752963.70266225.1878
590.0684-0.36330.222282828918.150943160559.14746569.6696
600.0634-0.34130.23390463018.237347460782.7016889.1787
610.0696-0.37590.244997519475.640951632340.4467185.5647



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')