Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 08 Dec 2007 03:53:48 -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/2007/Dec/08/t11971104980odk908vngez31s.htm/, Retrieved Mon, 29 Apr 2024 06:37:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2908, Retrieved Mon, 29 Apr 2024 06:37:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact227
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [extrapolation for...] [2007-12-08 10:53:48] [887c58ec85a2f7f96f5a0ba18e7ae311] [Current]
Feedback Forum

Post a new message
Dataseries X:
33259
33250
32875
32424
31867
31871
33140
33555
33324
32358
31857
32101
32810
32057
31663
31325
31103
31012
32511
33677
32213
31635
31043
31303
31899
31384
30650
30400
30003
29896
31557
31883
30830
30354
29756
29934
30599
30378
29925
29471
29567
29419
30796
31475
31708
31917
30871
31512
32362
31928
31699
30363
30386
30364
32806
33423
33071
33888
34805
35489
37259
37722
38764
39594
40004
40715
44028
45564
44277
44976
45406
47379
49200
50221
51573
53091
53337
54978
57885
67099
67169
69796
70600
71982
73957
75273
76322
77078
77954
79238
82179
83834
83744
84861
86478
88290
90287
91230
92380
92506
94172
94728
96581
97344
98346
98214
98366
98768





Summary of compuational 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 compuational 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=2908&T=0

[TABLE]
[ROW][C]Summary of compuational 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=2908&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2908&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 compuational 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[96])
8471982-------
8573957-------
8675273-------
8776322-------
8877078-------
8977954-------
9079238-------
9182179-------
9283834-------
9383744-------
9484861-------
9586478-------
9688290-------
979028790464.811688420.970492508.65290.43230.981510.9815
989123091405.589988223.129294588.05060.45690.754610.9725
999238092339.383587730.152196948.61490.49310.681410.9575
1009250692980.656887090.378898870.93480.43730.579210.9407
1019417293472.716186301.4152100644.0170.42420.604210.9217
1029472894372.333486007.4872102737.17950.46680.51870.99980.9229
1039658197020.107887513.3757106526.83980.46390.68170.99890.9641
1049734499868.607989287.8803110449.33550.320.72870.99850.984
1059834699535.722987936.0791111135.36680.42030.64440.99620.9713
10698214100507.726887944.2809113071.17260.36020.6320.99270.9717
10798366101115.329587636.2851114594.37390.34470.66340.98330.9689
10898768102377.718488028.1062116727.33060.3110.70810.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[96]) \tabularnewline
84 & 71982 & - & - & - & - & - & - & - \tabularnewline
85 & 73957 & - & - & - & - & - & - & - \tabularnewline
86 & 75273 & - & - & - & - & - & - & - \tabularnewline
87 & 76322 & - & - & - & - & - & - & - \tabularnewline
88 & 77078 & - & - & - & - & - & - & - \tabularnewline
89 & 77954 & - & - & - & - & - & - & - \tabularnewline
90 & 79238 & - & - & - & - & - & - & - \tabularnewline
91 & 82179 & - & - & - & - & - & - & - \tabularnewline
92 & 83834 & - & - & - & - & - & - & - \tabularnewline
93 & 83744 & - & - & - & - & - & - & - \tabularnewline
94 & 84861 & - & - & - & - & - & - & - \tabularnewline
95 & 86478 & - & - & - & - & - & - & - \tabularnewline
96 & 88290 & - & - & - & - & - & - & - \tabularnewline
97 & 90287 & 90464.8116 & 88420.9704 & 92508.6529 & 0.4323 & 0.9815 & 1 & 0.9815 \tabularnewline
98 & 91230 & 91405.5899 & 88223.1292 & 94588.0506 & 0.4569 & 0.7546 & 1 & 0.9725 \tabularnewline
99 & 92380 & 92339.3835 & 87730.1521 & 96948.6149 & 0.4931 & 0.6814 & 1 & 0.9575 \tabularnewline
100 & 92506 & 92980.6568 & 87090.3788 & 98870.9348 & 0.4373 & 0.5792 & 1 & 0.9407 \tabularnewline
101 & 94172 & 93472.7161 & 86301.4152 & 100644.017 & 0.4242 & 0.6042 & 1 & 0.9217 \tabularnewline
102 & 94728 & 94372.3334 & 86007.4872 & 102737.1795 & 0.4668 & 0.5187 & 0.9998 & 0.9229 \tabularnewline
103 & 96581 & 97020.1078 & 87513.3757 & 106526.8398 & 0.4639 & 0.6817 & 0.9989 & 0.9641 \tabularnewline
104 & 97344 & 99868.6079 & 89287.8803 & 110449.3355 & 0.32 & 0.7287 & 0.9985 & 0.984 \tabularnewline
105 & 98346 & 99535.7229 & 87936.0791 & 111135.3668 & 0.4203 & 0.6444 & 0.9962 & 0.9713 \tabularnewline
106 & 98214 & 100507.7268 & 87944.2809 & 113071.1726 & 0.3602 & 0.632 & 0.9927 & 0.9717 \tabularnewline
107 & 98366 & 101115.3295 & 87636.2851 & 114594.3739 & 0.3447 & 0.6634 & 0.9833 & 0.9689 \tabularnewline
108 & 98768 & 102377.7184 & 88028.1062 & 116727.3306 & 0.311 & 0.7081 & 0.9728 & 0.9728 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2908&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[96])[/C][/ROW]
[ROW][C]84[/C][C]71982[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]73957[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]75273[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]76322[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]77078[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]77954[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]79238[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]82179[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]83834[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]83744[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]84861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]86478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]88290[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]90287[/C][C]90464.8116[/C][C]88420.9704[/C][C]92508.6529[/C][C]0.4323[/C][C]0.9815[/C][C]1[/C][C]0.9815[/C][/ROW]
[ROW][C]98[/C][C]91230[/C][C]91405.5899[/C][C]88223.1292[/C][C]94588.0506[/C][C]0.4569[/C][C]0.7546[/C][C]1[/C][C]0.9725[/C][/ROW]
[ROW][C]99[/C][C]92380[/C][C]92339.3835[/C][C]87730.1521[/C][C]96948.6149[/C][C]0.4931[/C][C]0.6814[/C][C]1[/C][C]0.9575[/C][/ROW]
[ROW][C]100[/C][C]92506[/C][C]92980.6568[/C][C]87090.3788[/C][C]98870.9348[/C][C]0.4373[/C][C]0.5792[/C][C]1[/C][C]0.9407[/C][/ROW]
[ROW][C]101[/C][C]94172[/C][C]93472.7161[/C][C]86301.4152[/C][C]100644.017[/C][C]0.4242[/C][C]0.6042[/C][C]1[/C][C]0.9217[/C][/ROW]
[ROW][C]102[/C][C]94728[/C][C]94372.3334[/C][C]86007.4872[/C][C]102737.1795[/C][C]0.4668[/C][C]0.5187[/C][C]0.9998[/C][C]0.9229[/C][/ROW]
[ROW][C]103[/C][C]96581[/C][C]97020.1078[/C][C]87513.3757[/C][C]106526.8398[/C][C]0.4639[/C][C]0.6817[/C][C]0.9989[/C][C]0.9641[/C][/ROW]
[ROW][C]104[/C][C]97344[/C][C]99868.6079[/C][C]89287.8803[/C][C]110449.3355[/C][C]0.32[/C][C]0.7287[/C][C]0.9985[/C][C]0.984[/C][/ROW]
[ROW][C]105[/C][C]98346[/C][C]99535.7229[/C][C]87936.0791[/C][C]111135.3668[/C][C]0.4203[/C][C]0.6444[/C][C]0.9962[/C][C]0.9713[/C][/ROW]
[ROW][C]106[/C][C]98214[/C][C]100507.7268[/C][C]87944.2809[/C][C]113071.1726[/C][C]0.3602[/C][C]0.632[/C][C]0.9927[/C][C]0.9717[/C][/ROW]
[ROW][C]107[/C][C]98366[/C][C]101115.3295[/C][C]87636.2851[/C][C]114594.3739[/C][C]0.3447[/C][C]0.6634[/C][C]0.9833[/C][C]0.9689[/C][/ROW]
[ROW][C]108[/C][C]98768[/C][C]102377.7184[/C][C]88028.1062[/C][C]116727.3306[/C][C]0.311[/C][C]0.7081[/C][C]0.9728[/C][C]0.9728[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2908&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2908&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[96])
8471982-------
8573957-------
8675273-------
8776322-------
8877078-------
8977954-------
9079238-------
9182179-------
9283834-------
9383744-------
9484861-------
9586478-------
9688290-------
979028790464.811688420.970492508.65290.43230.981510.9815
989123091405.589988223.129294588.05060.45690.754610.9725
999238092339.383587730.152196948.61490.49310.681410.9575
1009250692980.656887090.378898870.93480.43730.579210.9407
1019417293472.716186301.4152100644.0170.42420.604210.9217
1029472894372.333486007.4872102737.17950.46680.51870.99980.9229
1039658197020.107887513.3757106526.83980.46390.68170.99890.9641
1049734499868.607989287.8803110449.33550.320.72870.99850.984
1059834699535.722987936.0791111135.36680.42030.64440.99620.9713
10698214100507.726887944.2809113071.17260.36020.6320.99270.9717
10798366101115.329587636.2851114594.37390.34470.66340.98330.9689
10898768102377.718488028.1062116727.33060.3110.70810.97280.9728







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.0115-0.0022e-0431616.97312634.747851.3298
980.0178-0.00192e-0430831.80152569.316850.6884
990.02554e-0401649.7006137.475111.725
1000.0323-0.00514e-04225299.101518774.9251137.0216
1010.03910.00756e-04488998.010440749.8342201.8659
1020.04520.00383e-04126498.756310541.563102.6721
1030.05-0.00454e-04192815.630916067.9692126.7595
1040.0541-0.02530.00216373645.0753531137.0896728.7915
1050.0595-0.0120.0011415440.6494117953.3874343.4434
1060.0638-0.02280.00195261182.4649438431.8721662.1419
1070.068-0.02720.00237558812.6445629901.0537793.6631
1080.0715-0.03530.002913030066.86791085838.90571042.0359

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0115 & -0.002 & 2e-04 & 31616.9731 & 2634.7478 & 51.3298 \tabularnewline
98 & 0.0178 & -0.0019 & 2e-04 & 30831.8015 & 2569.3168 & 50.6884 \tabularnewline
99 & 0.0255 & 4e-04 & 0 & 1649.7006 & 137.4751 & 11.725 \tabularnewline
100 & 0.0323 & -0.0051 & 4e-04 & 225299.1015 & 18774.9251 & 137.0216 \tabularnewline
101 & 0.0391 & 0.0075 & 6e-04 & 488998.0104 & 40749.8342 & 201.8659 \tabularnewline
102 & 0.0452 & 0.0038 & 3e-04 & 126498.7563 & 10541.563 & 102.6721 \tabularnewline
103 & 0.05 & -0.0045 & 4e-04 & 192815.6309 & 16067.9692 & 126.7595 \tabularnewline
104 & 0.0541 & -0.0253 & 0.0021 & 6373645.0753 & 531137.0896 & 728.7915 \tabularnewline
105 & 0.0595 & -0.012 & 0.001 & 1415440.6494 & 117953.3874 & 343.4434 \tabularnewline
106 & 0.0638 & -0.0228 & 0.0019 & 5261182.4649 & 438431.8721 & 662.1419 \tabularnewline
107 & 0.068 & -0.0272 & 0.0023 & 7558812.6445 & 629901.0537 & 793.6631 \tabularnewline
108 & 0.0715 & -0.0353 & 0.0029 & 13030066.8679 & 1085838.9057 & 1042.0359 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2908&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]97[/C][C]0.0115[/C][C]-0.002[/C][C]2e-04[/C][C]31616.9731[/C][C]2634.7478[/C][C]51.3298[/C][/ROW]
[ROW][C]98[/C][C]0.0178[/C][C]-0.0019[/C][C]2e-04[/C][C]30831.8015[/C][C]2569.3168[/C][C]50.6884[/C][/ROW]
[ROW][C]99[/C][C]0.0255[/C][C]4e-04[/C][C]0[/C][C]1649.7006[/C][C]137.4751[/C][C]11.725[/C][/ROW]
[ROW][C]100[/C][C]0.0323[/C][C]-0.0051[/C][C]4e-04[/C][C]225299.1015[/C][C]18774.9251[/C][C]137.0216[/C][/ROW]
[ROW][C]101[/C][C]0.0391[/C][C]0.0075[/C][C]6e-04[/C][C]488998.0104[/C][C]40749.8342[/C][C]201.8659[/C][/ROW]
[ROW][C]102[/C][C]0.0452[/C][C]0.0038[/C][C]3e-04[/C][C]126498.7563[/C][C]10541.563[/C][C]102.6721[/C][/ROW]
[ROW][C]103[/C][C]0.05[/C][C]-0.0045[/C][C]4e-04[/C][C]192815.6309[/C][C]16067.9692[/C][C]126.7595[/C][/ROW]
[ROW][C]104[/C][C]0.0541[/C][C]-0.0253[/C][C]0.0021[/C][C]6373645.0753[/C][C]531137.0896[/C][C]728.7915[/C][/ROW]
[ROW][C]105[/C][C]0.0595[/C][C]-0.012[/C][C]0.001[/C][C]1415440.6494[/C][C]117953.3874[/C][C]343.4434[/C][/ROW]
[ROW][C]106[/C][C]0.0638[/C][C]-0.0228[/C][C]0.0019[/C][C]5261182.4649[/C][C]438431.8721[/C][C]662.1419[/C][/ROW]
[ROW][C]107[/C][C]0.068[/C][C]-0.0272[/C][C]0.0023[/C][C]7558812.6445[/C][C]629901.0537[/C][C]793.6631[/C][/ROW]
[ROW][C]108[/C][C]0.0715[/C][C]-0.0353[/C][C]0.0029[/C][C]13030066.8679[/C][C]1085838.9057[/C][C]1042.0359[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2908&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2908&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
970.0115-0.0022e-0431616.97312634.747851.3298
980.0178-0.00192e-0430831.80152569.316850.6884
990.02554e-0401649.7006137.475111.725
1000.0323-0.00514e-04225299.101518774.9251137.0216
1010.03910.00756e-04488998.010440749.8342201.8659
1020.04520.00383e-04126498.756310541.563102.6721
1030.05-0.00454e-04192815.630916067.9692126.7595
1040.0541-0.02530.00216373645.0753531137.0896728.7915
1050.0595-0.0120.0011415440.6494117953.3874343.4434
1060.0638-0.02280.00195261182.4649438431.8721662.1419
1070.068-0.02720.00237558812.6445629901.0537793.6631
1080.0715-0.03530.002913030066.86791085838.90571042.0359



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; 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,fx))
(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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')