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 computationThu, 15 Dec 2016 23:11:41 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/15/t14818400304w8ujqqh3xhtsow.htm/, Retrieved Fri, 03 May 2024 09:00:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300034, Retrieved Fri, 03 May 2024 09:00:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact44
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima] [2016-12-15 22:11:41] [8dbd6448339a84ba150e9d534057ba9c] [Current]
Feedback Forum

Post a new message
Dataseries X:
9200
8840
8520
8720
8170
8830
8420
8350
8420
7940
7740
7740
8000
7830
7900
7750
7250
8650
7290
6250
6620
6890
7030
7170
6740
7210
7270
7440
6930
7310
7300
7240
7370
6790
6700
6880
6710
6870
6860
7190
7180
7070
6810
6610
6330
6280
6520
6180
6380
6520
6690
6210
6400
5990
6430
5830
5300
5010
5350
5530
5800
5810
5950
5800
6070
5950
6090
6430
6540
6550
6820
6770
7020
6070
5890
5930
5560
5940
6330
5860
6220
5940
6070
6760
6840
6810
7210
6830
6650
6500
6590
6360
6370
6230
5860
8270
5910
5820
5820
6180
5990
6320
6660
6230
6390
6260
6040
6280
6200
5350
5290
4940
4890
4310
3800
3540
3330
3020
3200
4610
5080
5410
5360
6040
6260
6330





Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=300034&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [ROW]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300034&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300034&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







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[114])
1134890-------
1144310-------
11538004618.01793739.76635496.26950.0340.75410.75410.7541
11635404618.01793610.09415625.94170.0180.94420.94420.7254
11733304618.01793495.30025740.73550.01230.97010.97010.7046
11830204618.01793391.20115844.83470.00530.98020.98020.6887
11932004618.01793295.26925940.76660.01780.99110.99110.676
12046104618.01793205.83926030.19660.49560.97550.97550.6655
12150804618.01793121.74486114.2910.27250.50420.50420.6567
12254104618.01793042.13166193.90420.16230.28280.28280.6492
12353604618.01792966.35146269.68440.18930.17370.17370.6426
12460404618.01792893.89886342.1370.0530.19950.19950.6369
12562604618.01792824.37046411.66540.03640.06010.06010.6318
12663304618.01792757.43846478.59730.03570.04180.04180.6272

\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[114]) \tabularnewline
113 & 4890 & - & - & - & - & - & - & - \tabularnewline
114 & 4310 & - & - & - & - & - & - & - \tabularnewline
115 & 3800 & 4618.0179 & 3739.7663 & 5496.2695 & 0.034 & 0.7541 & 0.7541 & 0.7541 \tabularnewline
116 & 3540 & 4618.0179 & 3610.0941 & 5625.9417 & 0.018 & 0.9442 & 0.9442 & 0.7254 \tabularnewline
117 & 3330 & 4618.0179 & 3495.3002 & 5740.7355 & 0.0123 & 0.9701 & 0.9701 & 0.7046 \tabularnewline
118 & 3020 & 4618.0179 & 3391.2011 & 5844.8347 & 0.0053 & 0.9802 & 0.9802 & 0.6887 \tabularnewline
119 & 3200 & 4618.0179 & 3295.2692 & 5940.7666 & 0.0178 & 0.9911 & 0.9911 & 0.676 \tabularnewline
120 & 4610 & 4618.0179 & 3205.8392 & 6030.1966 & 0.4956 & 0.9755 & 0.9755 & 0.6655 \tabularnewline
121 & 5080 & 4618.0179 & 3121.7448 & 6114.291 & 0.2725 & 0.5042 & 0.5042 & 0.6567 \tabularnewline
122 & 5410 & 4618.0179 & 3042.1316 & 6193.9042 & 0.1623 & 0.2828 & 0.2828 & 0.6492 \tabularnewline
123 & 5360 & 4618.0179 & 2966.3514 & 6269.6844 & 0.1893 & 0.1737 & 0.1737 & 0.6426 \tabularnewline
124 & 6040 & 4618.0179 & 2893.8988 & 6342.137 & 0.053 & 0.1995 & 0.1995 & 0.6369 \tabularnewline
125 & 6260 & 4618.0179 & 2824.3704 & 6411.6654 & 0.0364 & 0.0601 & 0.0601 & 0.6318 \tabularnewline
126 & 6330 & 4618.0179 & 2757.4384 & 6478.5973 & 0.0357 & 0.0418 & 0.0418 & 0.6272 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300034&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[114])[/C][/ROW]
[ROW][C]113[/C][C]4890[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4310[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]3800[/C][C]4618.0179[/C][C]3739.7663[/C][C]5496.2695[/C][C]0.034[/C][C]0.7541[/C][C]0.7541[/C][C]0.7541[/C][/ROW]
[ROW][C]116[/C][C]3540[/C][C]4618.0179[/C][C]3610.0941[/C][C]5625.9417[/C][C]0.018[/C][C]0.9442[/C][C]0.9442[/C][C]0.7254[/C][/ROW]
[ROW][C]117[/C][C]3330[/C][C]4618.0179[/C][C]3495.3002[/C][C]5740.7355[/C][C]0.0123[/C][C]0.9701[/C][C]0.9701[/C][C]0.7046[/C][/ROW]
[ROW][C]118[/C][C]3020[/C][C]4618.0179[/C][C]3391.2011[/C][C]5844.8347[/C][C]0.0053[/C][C]0.9802[/C][C]0.9802[/C][C]0.6887[/C][/ROW]
[ROW][C]119[/C][C]3200[/C][C]4618.0179[/C][C]3295.2692[/C][C]5940.7666[/C][C]0.0178[/C][C]0.9911[/C][C]0.9911[/C][C]0.676[/C][/ROW]
[ROW][C]120[/C][C]4610[/C][C]4618.0179[/C][C]3205.8392[/C][C]6030.1966[/C][C]0.4956[/C][C]0.9755[/C][C]0.9755[/C][C]0.6655[/C][/ROW]
[ROW][C]121[/C][C]5080[/C][C]4618.0179[/C][C]3121.7448[/C][C]6114.291[/C][C]0.2725[/C][C]0.5042[/C][C]0.5042[/C][C]0.6567[/C][/ROW]
[ROW][C]122[/C][C]5410[/C][C]4618.0179[/C][C]3042.1316[/C][C]6193.9042[/C][C]0.1623[/C][C]0.2828[/C][C]0.2828[/C][C]0.6492[/C][/ROW]
[ROW][C]123[/C][C]5360[/C][C]4618.0179[/C][C]2966.3514[/C][C]6269.6844[/C][C]0.1893[/C][C]0.1737[/C][C]0.1737[/C][C]0.6426[/C][/ROW]
[ROW][C]124[/C][C]6040[/C][C]4618.0179[/C][C]2893.8988[/C][C]6342.137[/C][C]0.053[/C][C]0.1995[/C][C]0.1995[/C][C]0.6369[/C][/ROW]
[ROW][C]125[/C][C]6260[/C][C]4618.0179[/C][C]2824.3704[/C][C]6411.6654[/C][C]0.0364[/C][C]0.0601[/C][C]0.0601[/C][C]0.6318[/C][/ROW]
[ROW][C]126[/C][C]6330[/C][C]4618.0179[/C][C]2757.4384[/C][C]6478.5973[/C][C]0.0357[/C][C]0.0418[/C][C]0.0418[/C][C]0.6272[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300034&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300034&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[114])
1134890-------
1144310-------
11538004618.01793739.76635496.26950.0340.75410.75410.7541
11635404618.01793610.09415625.94170.0180.94420.94420.7254
11733304618.01793495.30025740.73550.01230.97010.97010.7046
11830204618.01793391.20115844.83470.00530.98020.98020.6887
11932004618.01793295.26925940.76660.01780.99110.99110.676
12046104618.01793205.83926030.19660.49560.97550.97550.6655
12150804618.01793121.74486114.2910.27250.50420.50420.6567
12254104618.01793042.13166193.90420.16230.28280.28280.6492
12353604618.01792966.35146269.68440.18930.17370.17370.6426
12460404618.01792893.89886342.1370.0530.19950.19950.6369
12562604618.01792824.37046411.66540.03640.06010.06010.6318
12663304618.01792757.43846478.59730.03570.04180.04180.6272







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.097-0.21530.21530.1943669153.271200-2.14752.1475
1160.1114-0.30450.25990.22931162122.575915637.9231956.8897-2.83012.4888
1170.124-0.38680.30220.26091658990.08951163421.97861078.6204-3.38142.7864
1180.1355-0.52910.35890.30032553661.18241510981.77951229.22-4.19533.1386
1190.1461-0.44310.37580.31282010774.74141610940.37191269.2283-3.72273.2554
1200.156-0.00170.31340.260964.28661342461.02431158.6462-0.0212.7164
1210.16530.09090.28160.2373213427.46831181170.51631086.81671.21282.5016
1220.17410.14640.26470.2274627235.65981111928.65931054.48032.07922.4488
1230.18250.13840.25070.2186550537.44891049551.85811024.47641.94792.3931
1240.19050.23540.24920.22342022033.11621146799.98391070.88753.73312.5271
1250.19820.26230.25040.23062696105.24381287645.91661134.74494.31072.6893
1260.20560.27050.2520.23742930882.73891424582.31851193.55874.49452.8397

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.097 & -0.2153 & 0.2153 & 0.1943 & 669153.2712 & 0 & 0 & -2.1475 & 2.1475 \tabularnewline
116 & 0.1114 & -0.3045 & 0.2599 & 0.2293 & 1162122.575 & 915637.9231 & 956.8897 & -2.8301 & 2.4888 \tabularnewline
117 & 0.124 & -0.3868 & 0.3022 & 0.2609 & 1658990.0895 & 1163421.9786 & 1078.6204 & -3.3814 & 2.7864 \tabularnewline
118 & 0.1355 & -0.5291 & 0.3589 & 0.3003 & 2553661.1824 & 1510981.7795 & 1229.22 & -4.1953 & 3.1386 \tabularnewline
119 & 0.1461 & -0.4431 & 0.3758 & 0.3128 & 2010774.7414 & 1610940.3719 & 1269.2283 & -3.7227 & 3.2554 \tabularnewline
120 & 0.156 & -0.0017 & 0.3134 & 0.2609 & 64.2866 & 1342461.0243 & 1158.6462 & -0.021 & 2.7164 \tabularnewline
121 & 0.1653 & 0.0909 & 0.2816 & 0.2373 & 213427.4683 & 1181170.5163 & 1086.8167 & 1.2128 & 2.5016 \tabularnewline
122 & 0.1741 & 0.1464 & 0.2647 & 0.2274 & 627235.6598 & 1111928.6593 & 1054.4803 & 2.0792 & 2.4488 \tabularnewline
123 & 0.1825 & 0.1384 & 0.2507 & 0.2186 & 550537.4489 & 1049551.8581 & 1024.4764 & 1.9479 & 2.3931 \tabularnewline
124 & 0.1905 & 0.2354 & 0.2492 & 0.2234 & 2022033.1162 & 1146799.9839 & 1070.8875 & 3.7331 & 2.5271 \tabularnewline
125 & 0.1982 & 0.2623 & 0.2504 & 0.2306 & 2696105.2438 & 1287645.9166 & 1134.7449 & 4.3107 & 2.6893 \tabularnewline
126 & 0.2056 & 0.2705 & 0.252 & 0.2374 & 2930882.7389 & 1424582.3185 & 1193.5587 & 4.4945 & 2.8397 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300034&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]115[/C][C]0.097[/C][C]-0.2153[/C][C]0.2153[/C][C]0.1943[/C][C]669153.2712[/C][C]0[/C][C]0[/C][C]-2.1475[/C][C]2.1475[/C][/ROW]
[ROW][C]116[/C][C]0.1114[/C][C]-0.3045[/C][C]0.2599[/C][C]0.2293[/C][C]1162122.575[/C][C]915637.9231[/C][C]956.8897[/C][C]-2.8301[/C][C]2.4888[/C][/ROW]
[ROW][C]117[/C][C]0.124[/C][C]-0.3868[/C][C]0.3022[/C][C]0.2609[/C][C]1658990.0895[/C][C]1163421.9786[/C][C]1078.6204[/C][C]-3.3814[/C][C]2.7864[/C][/ROW]
[ROW][C]118[/C][C]0.1355[/C][C]-0.5291[/C][C]0.3589[/C][C]0.3003[/C][C]2553661.1824[/C][C]1510981.7795[/C][C]1229.22[/C][C]-4.1953[/C][C]3.1386[/C][/ROW]
[ROW][C]119[/C][C]0.1461[/C][C]-0.4431[/C][C]0.3758[/C][C]0.3128[/C][C]2010774.7414[/C][C]1610940.3719[/C][C]1269.2283[/C][C]-3.7227[/C][C]3.2554[/C][/ROW]
[ROW][C]120[/C][C]0.156[/C][C]-0.0017[/C][C]0.3134[/C][C]0.2609[/C][C]64.2866[/C][C]1342461.0243[/C][C]1158.6462[/C][C]-0.021[/C][C]2.7164[/C][/ROW]
[ROW][C]121[/C][C]0.1653[/C][C]0.0909[/C][C]0.2816[/C][C]0.2373[/C][C]213427.4683[/C][C]1181170.5163[/C][C]1086.8167[/C][C]1.2128[/C][C]2.5016[/C][/ROW]
[ROW][C]122[/C][C]0.1741[/C][C]0.1464[/C][C]0.2647[/C][C]0.2274[/C][C]627235.6598[/C][C]1111928.6593[/C][C]1054.4803[/C][C]2.0792[/C][C]2.4488[/C][/ROW]
[ROW][C]123[/C][C]0.1825[/C][C]0.1384[/C][C]0.2507[/C][C]0.2186[/C][C]550537.4489[/C][C]1049551.8581[/C][C]1024.4764[/C][C]1.9479[/C][C]2.3931[/C][/ROW]
[ROW][C]124[/C][C]0.1905[/C][C]0.2354[/C][C]0.2492[/C][C]0.2234[/C][C]2022033.1162[/C][C]1146799.9839[/C][C]1070.8875[/C][C]3.7331[/C][C]2.5271[/C][/ROW]
[ROW][C]125[/C][C]0.1982[/C][C]0.2623[/C][C]0.2504[/C][C]0.2306[/C][C]2696105.2438[/C][C]1287645.9166[/C][C]1134.7449[/C][C]4.3107[/C][C]2.6893[/C][/ROW]
[ROW][C]126[/C][C]0.2056[/C][C]0.2705[/C][C]0.252[/C][C]0.2374[/C][C]2930882.7389[/C][C]1424582.3185[/C][C]1193.5587[/C][C]4.4945[/C][C]2.8397[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300034&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300034&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.097-0.21530.21530.1943669153.271200-2.14752.1475
1160.1114-0.30450.25990.22931162122.575915637.9231956.8897-2.83012.4888
1170.124-0.38680.30220.26091658990.08951163421.97861078.6204-3.38142.7864
1180.1355-0.52910.35890.30032553661.18241510981.77951229.22-4.19533.1386
1190.1461-0.44310.37580.31282010774.74141610940.37191269.2283-3.72273.2554
1200.156-0.00170.31340.260964.28661342461.02431158.6462-0.0212.7164
1210.16530.09090.28160.2373213427.46831181170.51631086.81671.21282.5016
1220.17410.14640.26470.2274627235.65981111928.65931054.48032.07922.4488
1230.18250.13840.25070.2186550537.44891049551.85811024.47641.94792.3931
1240.19050.23540.24920.22342022033.11621146799.98391070.88753.73312.5271
1250.19820.26230.25040.23062696105.24381287645.91661134.74494.31072.6893
1260.20560.27050.2520.23742930882.73891424582.31851193.55874.49452.8397



Parameters (Session):
par1 = 0 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '1'
par4 <- '0'
par3 <- '1'
par2 <- '1'
par1 <- '0'
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*2
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)
}
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')