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 computationFri, 16 Dec 2016 14:40:22 +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/16/t1481895649rlan71jmbenlxqo.htm/, Retrieved Fri, 01 Nov 2024 03:31:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300260, Retrieved Fri, 01 Nov 2024 03:31:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact98
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2016-12-16 13:36:55] [683f400e1b95307fc738e729f07c4fce]
- RM      [ARIMA Forecasting] [] [2016-12-16 13:40:22] [404ac5ee4f7301873f6a96ef36861981] [Current]
Feedback Forum

Post a new message
Dataseries X:
6086
6090.5
6103.5
6144
6190.5
6225
6272
6294
6366
6426
6477
6500
6538
6581
6615.5
6639.5
6651
6665
6684
6684.5
6666.5
6666.5
6651
6652
6647
6618.5
6604.5
6572
6556
6535
6515.5
6515
6489
6491
6483.5
6486.5
6486.5
6478.5
6461
6458.5
6446
6420
6397.5
6408
6408.5
6401.5
6408.5
6417.5
6406.5
6426.5
6431.5
6441.5
6446
6450
6468
6488.5
6512
6525
6551
6567.5
6560.5
6572
6574.5
6583.5
6589.5
6600
6601
6586
6590
6616
6641.5
6647
6662
6663.5
6663
6653.5
6642.5
6624.5
6605.5
6604.5
6575
6566
6562.5
6560.5
6502
6552.5
6542.5
6536
6516.5
6506.5
6491.5
6469.5
6445
6426
6355.5
6340
6307.5
6254.5
6230.5
6213
6212.5
6203
6204
6220.5
6205
6199.5
6184.5
6169
6140.5
6144.5
6145.5
6148.5
6145
6133
6138
6104.5
6090.5




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

\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
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300260&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] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300260&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300260&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







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[105])
1046220.5-------
1056205-------
1066199.56206.09766174.09486238.10030.34310.52680.52680.5268
1076184.56204.45386154.94686253.96090.21480.57770.57770.4914
10861696201.98516131.35986272.61030.180.68620.68620.4667
1096140.56196.16186099.61056292.71320.12930.70930.70930.4288
1106144.56192.13716063.40556320.86870.23410.78410.78410.4224
1116145.56188.10336023.62656352.58010.30580.69830.69830.4202
1126148.56184.91895981.39466388.44320.36290.64790.64790.4233
11361456182.28075937.56916426.99240.38260.60660.60660.4278
11461336180.14485892.82116467.46840.37390.59470.59470.4327
11561386177.75875846.77746508.74010.40690.60450.60450.4359
1166104.56174.89175798.93496550.84860.35680.57630.57630.4376
1176090.56171.47345748.81076594.13610.35360.62190.62190.4382

\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[105]) \tabularnewline
104 & 6220.5 & - & - & - & - & - & - & - \tabularnewline
105 & 6205 & - & - & - & - & - & - & - \tabularnewline
106 & 6199.5 & 6206.0976 & 6174.0948 & 6238.1003 & 0.3431 & 0.5268 & 0.5268 & 0.5268 \tabularnewline
107 & 6184.5 & 6204.4538 & 6154.9468 & 6253.9609 & 0.2148 & 0.5777 & 0.5777 & 0.4914 \tabularnewline
108 & 6169 & 6201.9851 & 6131.3598 & 6272.6103 & 0.18 & 0.6862 & 0.6862 & 0.4667 \tabularnewline
109 & 6140.5 & 6196.1618 & 6099.6105 & 6292.7132 & 0.1293 & 0.7093 & 0.7093 & 0.4288 \tabularnewline
110 & 6144.5 & 6192.1371 & 6063.4055 & 6320.8687 & 0.2341 & 0.7841 & 0.7841 & 0.4224 \tabularnewline
111 & 6145.5 & 6188.1033 & 6023.6265 & 6352.5801 & 0.3058 & 0.6983 & 0.6983 & 0.4202 \tabularnewline
112 & 6148.5 & 6184.9189 & 5981.3946 & 6388.4432 & 0.3629 & 0.6479 & 0.6479 & 0.4233 \tabularnewline
113 & 6145 & 6182.2807 & 5937.5691 & 6426.9924 & 0.3826 & 0.6066 & 0.6066 & 0.4278 \tabularnewline
114 & 6133 & 6180.1448 & 5892.8211 & 6467.4684 & 0.3739 & 0.5947 & 0.5947 & 0.4327 \tabularnewline
115 & 6138 & 6177.7587 & 5846.7774 & 6508.7401 & 0.4069 & 0.6045 & 0.6045 & 0.4359 \tabularnewline
116 & 6104.5 & 6174.8917 & 5798.9349 & 6550.8486 & 0.3568 & 0.5763 & 0.5763 & 0.4376 \tabularnewline
117 & 6090.5 & 6171.4734 & 5748.8107 & 6594.1361 & 0.3536 & 0.6219 & 0.6219 & 0.4382 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300260&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[105])[/C][/ROW]
[ROW][C]104[/C][C]6220.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6199.5[/C][C]6206.0976[/C][C]6174.0948[/C][C]6238.1003[/C][C]0.3431[/C][C]0.5268[/C][C]0.5268[/C][C]0.5268[/C][/ROW]
[ROW][C]107[/C][C]6184.5[/C][C]6204.4538[/C][C]6154.9468[/C][C]6253.9609[/C][C]0.2148[/C][C]0.5777[/C][C]0.5777[/C][C]0.4914[/C][/ROW]
[ROW][C]108[/C][C]6169[/C][C]6201.9851[/C][C]6131.3598[/C][C]6272.6103[/C][C]0.18[/C][C]0.6862[/C][C]0.6862[/C][C]0.4667[/C][/ROW]
[ROW][C]109[/C][C]6140.5[/C][C]6196.1618[/C][C]6099.6105[/C][C]6292.7132[/C][C]0.1293[/C][C]0.7093[/C][C]0.7093[/C][C]0.4288[/C][/ROW]
[ROW][C]110[/C][C]6144.5[/C][C]6192.1371[/C][C]6063.4055[/C][C]6320.8687[/C][C]0.2341[/C][C]0.7841[/C][C]0.7841[/C][C]0.4224[/C][/ROW]
[ROW][C]111[/C][C]6145.5[/C][C]6188.1033[/C][C]6023.6265[/C][C]6352.5801[/C][C]0.3058[/C][C]0.6983[/C][C]0.6983[/C][C]0.4202[/C][/ROW]
[ROW][C]112[/C][C]6148.5[/C][C]6184.9189[/C][C]5981.3946[/C][C]6388.4432[/C][C]0.3629[/C][C]0.6479[/C][C]0.6479[/C][C]0.4233[/C][/ROW]
[ROW][C]113[/C][C]6145[/C][C]6182.2807[/C][C]5937.5691[/C][C]6426.9924[/C][C]0.3826[/C][C]0.6066[/C][C]0.6066[/C][C]0.4278[/C][/ROW]
[ROW][C]114[/C][C]6133[/C][C]6180.1448[/C][C]5892.8211[/C][C]6467.4684[/C][C]0.3739[/C][C]0.5947[/C][C]0.5947[/C][C]0.4327[/C][/ROW]
[ROW][C]115[/C][C]6138[/C][C]6177.7587[/C][C]5846.7774[/C][C]6508.7401[/C][C]0.4069[/C][C]0.6045[/C][C]0.6045[/C][C]0.4359[/C][/ROW]
[ROW][C]116[/C][C]6104.5[/C][C]6174.8917[/C][C]5798.9349[/C][C]6550.8486[/C][C]0.3568[/C][C]0.5763[/C][C]0.5763[/C][C]0.4376[/C][/ROW]
[ROW][C]117[/C][C]6090.5[/C][C]6171.4734[/C][C]5748.8107[/C][C]6594.1361[/C][C]0.3536[/C][C]0.6219[/C][C]0.6219[/C][C]0.4382[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300260&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300260&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[105])
1046220.5-------
1056205-------
1066199.56206.09766174.09486238.10030.34310.52680.52680.5268
1076184.56204.45386154.94686253.96090.21480.57770.57770.4914
10861696201.98516131.35986272.61030.180.68620.68620.4667
1096140.56196.16186099.61056292.71320.12930.70930.70930.4288
1106144.56192.13716063.40556320.86870.23410.78410.78410.4224
1116145.56188.10336023.62656352.58010.30580.69830.69830.4202
1126148.56184.91895981.39466388.44320.36290.64790.64790.4233
11361456182.28075937.56916426.99240.38260.60660.60660.4278
11461336180.14485892.82116467.46840.37390.59470.59470.4327
11561386177.75875846.77746508.74010.40690.60450.60450.4359
1166104.56174.89175798.93496550.84860.35680.57630.57630.4376
1176090.56171.47345748.81076594.13610.35360.62190.62190.4382







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0026-0.00110.00110.001143.528200-0.53760.5376
1070.0041-0.00320.00210.0021398.1556220.841914.8608-1.62591.0817
1080.0058-0.00530.00320.00321088.0144509.899422.581-2.68771.617
1090.008-0.00910.00470.00473098.23891156.984334.0145-4.53542.3466
1100.0106-0.00780.00530.00532269.29571379.446637.1409-3.88152.6536
1110.0136-0.00690.00560.00551815.04341452.04638.1057-3.47142.7899
1120.0168-0.00590.00560.00561326.3351434.087337.8693-2.96752.8153
1130.0202-0.00610.00570.00571389.85291428.55837.7963-3.03772.8431
1140.0237-0.00770.00590.00592222.62991516.788238.946-3.84142.954
1150.0273-0.00650.0060.00591580.75531523.184939.028-3.23962.9826
1160.0311-0.01150.00650.00644954.99821835.16842.8389-5.73563.2328
1170.0349-0.01330.0070.0076556.6942228.628547.2084-6.59783.5133

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
106 & 0.0026 & -0.0011 & 0.0011 & 0.0011 & 43.5282 & 0 & 0 & -0.5376 & 0.5376 \tabularnewline
107 & 0.0041 & -0.0032 & 0.0021 & 0.0021 & 398.1556 & 220.8419 & 14.8608 & -1.6259 & 1.0817 \tabularnewline
108 & 0.0058 & -0.0053 & 0.0032 & 0.0032 & 1088.0144 & 509.8994 & 22.581 & -2.6877 & 1.617 \tabularnewline
109 & 0.008 & -0.0091 & 0.0047 & 0.0047 & 3098.2389 & 1156.9843 & 34.0145 & -4.5354 & 2.3466 \tabularnewline
110 & 0.0106 & -0.0078 & 0.0053 & 0.0053 & 2269.2957 & 1379.4466 & 37.1409 & -3.8815 & 2.6536 \tabularnewline
111 & 0.0136 & -0.0069 & 0.0056 & 0.0055 & 1815.0434 & 1452.046 & 38.1057 & -3.4714 & 2.7899 \tabularnewline
112 & 0.0168 & -0.0059 & 0.0056 & 0.0056 & 1326.335 & 1434.0873 & 37.8693 & -2.9675 & 2.8153 \tabularnewline
113 & 0.0202 & -0.0061 & 0.0057 & 0.0057 & 1389.8529 & 1428.558 & 37.7963 & -3.0377 & 2.8431 \tabularnewline
114 & 0.0237 & -0.0077 & 0.0059 & 0.0059 & 2222.6299 & 1516.7882 & 38.946 & -3.8414 & 2.954 \tabularnewline
115 & 0.0273 & -0.0065 & 0.006 & 0.0059 & 1580.7553 & 1523.1849 & 39.028 & -3.2396 & 2.9826 \tabularnewline
116 & 0.0311 & -0.0115 & 0.0065 & 0.0064 & 4954.9982 & 1835.168 & 42.8389 & -5.7356 & 3.2328 \tabularnewline
117 & 0.0349 & -0.0133 & 0.007 & 0.007 & 6556.694 & 2228.6285 & 47.2084 & -6.5978 & 3.5133 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300260&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]106[/C][C]0.0026[/C][C]-0.0011[/C][C]0.0011[/C][C]0.0011[/C][C]43.5282[/C][C]0[/C][C]0[/C][C]-0.5376[/C][C]0.5376[/C][/ROW]
[ROW][C]107[/C][C]0.0041[/C][C]-0.0032[/C][C]0.0021[/C][C]0.0021[/C][C]398.1556[/C][C]220.8419[/C][C]14.8608[/C][C]-1.6259[/C][C]1.0817[/C][/ROW]
[ROW][C]108[/C][C]0.0058[/C][C]-0.0053[/C][C]0.0032[/C][C]0.0032[/C][C]1088.0144[/C][C]509.8994[/C][C]22.581[/C][C]-2.6877[/C][C]1.617[/C][/ROW]
[ROW][C]109[/C][C]0.008[/C][C]-0.0091[/C][C]0.0047[/C][C]0.0047[/C][C]3098.2389[/C][C]1156.9843[/C][C]34.0145[/C][C]-4.5354[/C][C]2.3466[/C][/ROW]
[ROW][C]110[/C][C]0.0106[/C][C]-0.0078[/C][C]0.0053[/C][C]0.0053[/C][C]2269.2957[/C][C]1379.4466[/C][C]37.1409[/C][C]-3.8815[/C][C]2.6536[/C][/ROW]
[ROW][C]111[/C][C]0.0136[/C][C]-0.0069[/C][C]0.0056[/C][C]0.0055[/C][C]1815.0434[/C][C]1452.046[/C][C]38.1057[/C][C]-3.4714[/C][C]2.7899[/C][/ROW]
[ROW][C]112[/C][C]0.0168[/C][C]-0.0059[/C][C]0.0056[/C][C]0.0056[/C][C]1326.335[/C][C]1434.0873[/C][C]37.8693[/C][C]-2.9675[/C][C]2.8153[/C][/ROW]
[ROW][C]113[/C][C]0.0202[/C][C]-0.0061[/C][C]0.0057[/C][C]0.0057[/C][C]1389.8529[/C][C]1428.558[/C][C]37.7963[/C][C]-3.0377[/C][C]2.8431[/C][/ROW]
[ROW][C]114[/C][C]0.0237[/C][C]-0.0077[/C][C]0.0059[/C][C]0.0059[/C][C]2222.6299[/C][C]1516.7882[/C][C]38.946[/C][C]-3.8414[/C][C]2.954[/C][/ROW]
[ROW][C]115[/C][C]0.0273[/C][C]-0.0065[/C][C]0.006[/C][C]0.0059[/C][C]1580.7553[/C][C]1523.1849[/C][C]39.028[/C][C]-3.2396[/C][C]2.9826[/C][/ROW]
[ROW][C]116[/C][C]0.0311[/C][C]-0.0115[/C][C]0.0065[/C][C]0.0064[/C][C]4954.9982[/C][C]1835.168[/C][C]42.8389[/C][C]-5.7356[/C][C]3.2328[/C][/ROW]
[ROW][C]117[/C][C]0.0349[/C][C]-0.0133[/C][C]0.007[/C][C]0.007[/C][C]6556.694[/C][C]2228.6285[/C][C]47.2084[/C][C]-6.5978[/C][C]3.5133[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300260&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300260&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
1060.0026-0.00110.00110.001143.528200-0.53760.5376
1070.0041-0.00320.00210.0021398.1556220.841914.8608-1.62591.0817
1080.0058-0.00530.00320.00321088.0144509.899422.581-2.68771.617
1090.008-0.00910.00470.00473098.23891156.984334.0145-4.53542.3466
1100.0106-0.00780.00530.00532269.29571379.446637.1409-3.88152.6536
1110.0136-0.00690.00560.00551815.04341452.04638.1057-3.47142.7899
1120.0168-0.00590.00560.00561326.3351434.087337.8693-2.96752.8153
1130.0202-0.00610.00570.00571389.85291428.55837.7963-3.03772.8431
1140.0237-0.00770.00590.00592222.62991516.788238.946-3.84142.954
1150.0273-0.00650.0060.00591580.75531523.184939.028-3.23962.9826
1160.0311-0.01150.00650.00644954.99821835.16842.8389-5.73563.2328
1170.0349-0.01330.0070.0076556.6942228.628547.2084-6.59783.5133



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