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, 08 Dec 2016 17:47:21 +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/08/t14812177838ih4chnac68arwg.htm/, Retrieved Sun, 28 Apr 2024 00:04:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=298371, Retrieved Sun, 28 Apr 2024 00:04:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact92
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2016-12-08 16:47:21] [1440fd85db505f66df8a556f9c91a076] [Current]
Feedback Forum

Post a new message
Dataseries X:
4956
5014.8
5053
5092.2
5126
5160
5188.8
5219.4
5255.6
5297
5349.8
5392.4
5429.8
5483.2
5540
5594.4
5650.2
5694
5741.8
5773.6
5816.8
5869.2
5927
5989.2
6038.8
6080.6
6111
6122.6
6154.4
6207
6231.2
6268.4
6309
6342.6
6376
6423.2
6465.2
6499.8
6552.2
6613.6
6658.6
6699.4
6763.4
6814.8
6869.4
6907.6
6936
6994.6
7043.2
7056.2
7068
7106.6
7141.2
7168.2
7184.6
7229.2
7273.4
7320.6
7350
7362.6
7411.2
7465.4
7510.2
7558.8
7605.4
7642.8
7681.6
7705
7729.8
7768.8
7810.4
7840.8
7855.4
7863.6
7904.4
7922.8
7929.4
7968
8018.6
8032.8
8052.6
8075.8
8106.4
8134.6
8140.6
8140
8152.2
8167.2
8166.6
8185
8203.8
8233.6
8251.6
8252.2
8235.6
8251.4
8293.8
8329.8
8342.4
8351.4
8347.8
8349.4
8337
8326
8313
8327.4
8346.4
8360.8
8374.6
8406
8406.2
8381.4
8379.8
8367.4
8372
8393.4




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R ServerBig Analytics Cloud Computing Center

\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 time0 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298371&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]0 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=298371&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298371&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 time0 seconds
R ServerBig Analytics Cloud Computing Center







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[104])
1038337-------
1048326-------
10583138315.84858287.25268344.44430.42260.24330.24330.2433
1068327.48306.488244.50288368.45720.25410.41830.41830.2685
1078346.48297.83418197.1568398.51230.17220.28240.28240.2917
1088360.88289.85528146.66768433.04270.16570.21950.21950.3104
1098374.68282.49178094.01548470.96790.16910.20770.20770.3255
11084068275.69618039.89438511.4980.13940.20550.20550.3379
1118406.28269.42487984.81938554.03030.17310.17350.17350.3484
1128381.48263.63717929.1828598.09230.24510.20170.20170.3574
1138379.88258.29597873.28598643.3060.26810.26540.26540.3652
1148367.48253.36677817.36888689.36470.30410.28490.28490.372
11583728248.81777761.61828736.01730.31010.31670.31670.3781
1168393.48244.61967706.18258783.05680.29410.32140.32140.3835

\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[104]) \tabularnewline
103 & 8337 & - & - & - & - & - & - & - \tabularnewline
104 & 8326 & - & - & - & - & - & - & - \tabularnewline
105 & 8313 & 8315.8485 & 8287.2526 & 8344.4443 & 0.4226 & 0.2433 & 0.2433 & 0.2433 \tabularnewline
106 & 8327.4 & 8306.48 & 8244.5028 & 8368.4572 & 0.2541 & 0.4183 & 0.4183 & 0.2685 \tabularnewline
107 & 8346.4 & 8297.8341 & 8197.156 & 8398.5123 & 0.1722 & 0.2824 & 0.2824 & 0.2917 \tabularnewline
108 & 8360.8 & 8289.8552 & 8146.6676 & 8433.0427 & 0.1657 & 0.2195 & 0.2195 & 0.3104 \tabularnewline
109 & 8374.6 & 8282.4917 & 8094.0154 & 8470.9679 & 0.1691 & 0.2077 & 0.2077 & 0.3255 \tabularnewline
110 & 8406 & 8275.6961 & 8039.8943 & 8511.498 & 0.1394 & 0.2055 & 0.2055 & 0.3379 \tabularnewline
111 & 8406.2 & 8269.4248 & 7984.8193 & 8554.0303 & 0.1731 & 0.1735 & 0.1735 & 0.3484 \tabularnewline
112 & 8381.4 & 8263.6371 & 7929.182 & 8598.0923 & 0.2451 & 0.2017 & 0.2017 & 0.3574 \tabularnewline
113 & 8379.8 & 8258.2959 & 7873.2859 & 8643.306 & 0.2681 & 0.2654 & 0.2654 & 0.3652 \tabularnewline
114 & 8367.4 & 8253.3667 & 7817.3688 & 8689.3647 & 0.3041 & 0.2849 & 0.2849 & 0.372 \tabularnewline
115 & 8372 & 8248.8177 & 7761.6182 & 8736.0173 & 0.3101 & 0.3167 & 0.3167 & 0.3781 \tabularnewline
116 & 8393.4 & 8244.6196 & 7706.1825 & 8783.0568 & 0.2941 & 0.3214 & 0.3214 & 0.3835 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298371&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[104])[/C][/ROW]
[ROW][C]103[/C][C]8337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]8326[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]8313[/C][C]8315.8485[/C][C]8287.2526[/C][C]8344.4443[/C][C]0.4226[/C][C]0.2433[/C][C]0.2433[/C][C]0.2433[/C][/ROW]
[ROW][C]106[/C][C]8327.4[/C][C]8306.48[/C][C]8244.5028[/C][C]8368.4572[/C][C]0.2541[/C][C]0.4183[/C][C]0.4183[/C][C]0.2685[/C][/ROW]
[ROW][C]107[/C][C]8346.4[/C][C]8297.8341[/C][C]8197.156[/C][C]8398.5123[/C][C]0.1722[/C][C]0.2824[/C][C]0.2824[/C][C]0.2917[/C][/ROW]
[ROW][C]108[/C][C]8360.8[/C][C]8289.8552[/C][C]8146.6676[/C][C]8433.0427[/C][C]0.1657[/C][C]0.2195[/C][C]0.2195[/C][C]0.3104[/C][/ROW]
[ROW][C]109[/C][C]8374.6[/C][C]8282.4917[/C][C]8094.0154[/C][C]8470.9679[/C][C]0.1691[/C][C]0.2077[/C][C]0.2077[/C][C]0.3255[/C][/ROW]
[ROW][C]110[/C][C]8406[/C][C]8275.6961[/C][C]8039.8943[/C][C]8511.498[/C][C]0.1394[/C][C]0.2055[/C][C]0.2055[/C][C]0.3379[/C][/ROW]
[ROW][C]111[/C][C]8406.2[/C][C]8269.4248[/C][C]7984.8193[/C][C]8554.0303[/C][C]0.1731[/C][C]0.1735[/C][C]0.1735[/C][C]0.3484[/C][/ROW]
[ROW][C]112[/C][C]8381.4[/C][C]8263.6371[/C][C]7929.182[/C][C]8598.0923[/C][C]0.2451[/C][C]0.2017[/C][C]0.2017[/C][C]0.3574[/C][/ROW]
[ROW][C]113[/C][C]8379.8[/C][C]8258.2959[/C][C]7873.2859[/C][C]8643.306[/C][C]0.2681[/C][C]0.2654[/C][C]0.2654[/C][C]0.3652[/C][/ROW]
[ROW][C]114[/C][C]8367.4[/C][C]8253.3667[/C][C]7817.3688[/C][C]8689.3647[/C][C]0.3041[/C][C]0.2849[/C][C]0.2849[/C][C]0.372[/C][/ROW]
[ROW][C]115[/C][C]8372[/C][C]8248.8177[/C][C]7761.6182[/C][C]8736.0173[/C][C]0.3101[/C][C]0.3167[/C][C]0.3167[/C][C]0.3781[/C][/ROW]
[ROW][C]116[/C][C]8393.4[/C][C]8244.6196[/C][C]7706.1825[/C][C]8783.0568[/C][C]0.2941[/C][C]0.3214[/C][C]0.3214[/C][C]0.3835[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298371&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298371&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[104])
1038337-------
1048326-------
10583138315.84858287.25268344.44430.42260.24330.24330.2433
1068327.48306.488244.50288368.45720.25410.41830.41830.2685
1078346.48297.83418197.1568398.51230.17220.28240.28240.2917
1088360.88289.85528146.66768433.04270.16570.21950.21950.3104
1098374.68282.49178094.01548470.96790.16910.20770.20770.3255
11084068275.69618039.89438511.4980.13940.20550.20550.3379
1118406.28269.42487984.81938554.03030.17310.17350.17350.3484
1128381.48263.63717929.1828598.09230.24510.20170.20170.3574
1138379.88258.29597873.28598643.3060.26810.26540.26540.3652
1148367.48253.36677817.36888689.36470.30410.28490.28490.372
11583728248.81777761.61828736.01730.31010.31670.31670.3781
1168393.48244.61967706.18258783.05680.29410.32140.32140.3835







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.0018-3e-043e-043e-048.113800-0.19830.1983
1060.00380.00250.00140.0014437.6469222.880314.92921.45650.8274
1070.00620.00580.00290.00292358.6435934.801430.57453.38121.6786
1080.00880.00850.00430.00435033.1691959.393344.2654.93922.4938
1090.01160.0110.00560.00578483.94653264.303957.13416.41263.2775
1100.01450.01550.00730.007316979.09885550.103174.4999.07184.2433
1110.01760.01630.00860.008618707.46417429.726186.19599.52234.9974
1120.02060.01410.00920.009313868.09018234.521690.74438.19875.3976
1130.02380.01450.00980.009914763.2358959.934294.65698.45915.7377
1140.0270.01360.01020.010313003.58479364.299296.76937.9395.9579
1150.03010.01470.01060.010715173.86859892.441999.46088.5766.1959
1160.03330.01770.01120.011322135.598310912.7049104.463910.35816.5427

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.0018 & -3e-04 & 3e-04 & 3e-04 & 8.1138 & 0 & 0 & -0.1983 & 0.1983 \tabularnewline
106 & 0.0038 & 0.0025 & 0.0014 & 0.0014 & 437.6469 & 222.8803 & 14.9292 & 1.4565 & 0.8274 \tabularnewline
107 & 0.0062 & 0.0058 & 0.0029 & 0.0029 & 2358.6435 & 934.8014 & 30.5745 & 3.3812 & 1.6786 \tabularnewline
108 & 0.0088 & 0.0085 & 0.0043 & 0.0043 & 5033.169 & 1959.3933 & 44.265 & 4.9392 & 2.4938 \tabularnewline
109 & 0.0116 & 0.011 & 0.0056 & 0.0057 & 8483.9465 & 3264.3039 & 57.1341 & 6.4126 & 3.2775 \tabularnewline
110 & 0.0145 & 0.0155 & 0.0073 & 0.0073 & 16979.0988 & 5550.1031 & 74.499 & 9.0718 & 4.2433 \tabularnewline
111 & 0.0176 & 0.0163 & 0.0086 & 0.0086 & 18707.4641 & 7429.7261 & 86.1959 & 9.5223 & 4.9974 \tabularnewline
112 & 0.0206 & 0.0141 & 0.0092 & 0.0093 & 13868.0901 & 8234.5216 & 90.7443 & 8.1987 & 5.3976 \tabularnewline
113 & 0.0238 & 0.0145 & 0.0098 & 0.0099 & 14763.235 & 8959.9342 & 94.6569 & 8.4591 & 5.7377 \tabularnewline
114 & 0.027 & 0.0136 & 0.0102 & 0.0103 & 13003.5847 & 9364.2992 & 96.7693 & 7.939 & 5.9579 \tabularnewline
115 & 0.0301 & 0.0147 & 0.0106 & 0.0107 & 15173.8685 & 9892.4419 & 99.4608 & 8.576 & 6.1959 \tabularnewline
116 & 0.0333 & 0.0177 & 0.0112 & 0.0113 & 22135.5983 & 10912.7049 & 104.4639 & 10.3581 & 6.5427 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298371&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]105[/C][C]0.0018[/C][C]-3e-04[/C][C]3e-04[/C][C]3e-04[/C][C]8.1138[/C][C]0[/C][C]0[/C][C]-0.1983[/C][C]0.1983[/C][/ROW]
[ROW][C]106[/C][C]0.0038[/C][C]0.0025[/C][C]0.0014[/C][C]0.0014[/C][C]437.6469[/C][C]222.8803[/C][C]14.9292[/C][C]1.4565[/C][C]0.8274[/C][/ROW]
[ROW][C]107[/C][C]0.0062[/C][C]0.0058[/C][C]0.0029[/C][C]0.0029[/C][C]2358.6435[/C][C]934.8014[/C][C]30.5745[/C][C]3.3812[/C][C]1.6786[/C][/ROW]
[ROW][C]108[/C][C]0.0088[/C][C]0.0085[/C][C]0.0043[/C][C]0.0043[/C][C]5033.169[/C][C]1959.3933[/C][C]44.265[/C][C]4.9392[/C][C]2.4938[/C][/ROW]
[ROW][C]109[/C][C]0.0116[/C][C]0.011[/C][C]0.0056[/C][C]0.0057[/C][C]8483.9465[/C][C]3264.3039[/C][C]57.1341[/C][C]6.4126[/C][C]3.2775[/C][/ROW]
[ROW][C]110[/C][C]0.0145[/C][C]0.0155[/C][C]0.0073[/C][C]0.0073[/C][C]16979.0988[/C][C]5550.1031[/C][C]74.499[/C][C]9.0718[/C][C]4.2433[/C][/ROW]
[ROW][C]111[/C][C]0.0176[/C][C]0.0163[/C][C]0.0086[/C][C]0.0086[/C][C]18707.4641[/C][C]7429.7261[/C][C]86.1959[/C][C]9.5223[/C][C]4.9974[/C][/ROW]
[ROW][C]112[/C][C]0.0206[/C][C]0.0141[/C][C]0.0092[/C][C]0.0093[/C][C]13868.0901[/C][C]8234.5216[/C][C]90.7443[/C][C]8.1987[/C][C]5.3976[/C][/ROW]
[ROW][C]113[/C][C]0.0238[/C][C]0.0145[/C][C]0.0098[/C][C]0.0099[/C][C]14763.235[/C][C]8959.9342[/C][C]94.6569[/C][C]8.4591[/C][C]5.7377[/C][/ROW]
[ROW][C]114[/C][C]0.027[/C][C]0.0136[/C][C]0.0102[/C][C]0.0103[/C][C]13003.5847[/C][C]9364.2992[/C][C]96.7693[/C][C]7.939[/C][C]5.9579[/C][/ROW]
[ROW][C]115[/C][C]0.0301[/C][C]0.0147[/C][C]0.0106[/C][C]0.0107[/C][C]15173.8685[/C][C]9892.4419[/C][C]99.4608[/C][C]8.576[/C][C]6.1959[/C][/ROW]
[ROW][C]116[/C][C]0.0333[/C][C]0.0177[/C][C]0.0112[/C][C]0.0113[/C][C]22135.5983[/C][C]10912.7049[/C][C]104.4639[/C][C]10.3581[/C][C]6.5427[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298371&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298371&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
1050.0018-3e-043e-043e-048.113800-0.19830.1983
1060.00380.00250.00140.0014437.6469222.880314.92921.45650.8274
1070.00620.00580.00290.00292358.6435934.801430.57453.38121.6786
1080.00880.00850.00430.00435033.1691959.393344.2654.93922.4938
1090.01160.0110.00560.00578483.94653264.303957.13416.41263.2775
1100.01450.01550.00730.007316979.09885550.103174.4999.07184.2433
1110.01760.01630.00860.008618707.46417429.726186.19599.52234.9974
1120.02060.01410.00920.009313868.09018234.521690.74438.19875.3976
1130.02380.01450.00980.009914763.2358959.934294.65698.45915.7377
1140.0270.01360.01020.010313003.58479364.299296.76937.9395.9579
1150.03010.01470.01060.010715173.86859892.441999.46088.5766.1959
1160.03330.01770.01120.011322135.598310912.7049104.463910.35816.5427



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 1 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 1 ; par6 = 1 ; 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*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')