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 computationWed, 21 Dec 2016 16:08:11 +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/21/t148233384228s1ynpxart43ie.htm/, Retrieved Mon, 06 May 2024 11:21:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302380, Retrieved Mon, 06 May 2024 11:21:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact58
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forcasting ...] [2016-12-21 15:08:11] [d4ebbcc95b180bc93fc42d05f31a3dde] [Current]
Feedback Forum

Post a new message
Dataseries X:
3606.1
3102.8
3602.5
3247.3
3467.7
3330.2
3367.1
3579.2
3303.8
3513.1
3892.7
4698.2
3876.6
3937.9
4011.5
3881.2
4054.6
3609.9
3788
3603.2
4110.8
4398.5
4402
4249.8
4054.5
3868.7
4165.4
4043.8
4220.2
4078
4129.3
4129.3
4161.5
4193.3
3959.8
3962.8
4079.3
3824.5
4160
3906.2
3907.8
4076.7
4099.4
4213.7
4012.2
4088.4
3911.9
3992.5
4333
4159
4540.8
4515.4
4661.1
4394.3
4916.4
4999.7
4783.4
4889.5
4840.6
4979.2
5442.4
5229.9
5670.3
5129.1
5358
5363.5
5388.7
5409.2
5431.2
5591.9
5622.5
5528.7
4968.7
4812.5
5175.1
4943.2
5007.1
5028.5
5023
5158.3
5248.8
5494
5193.3
4318.2
5726.3
5378.7
5776.1
5626.3
5755.2
5540.9
5560.8
5742.6
5592.9
5782.6
5611.5
5653.5
5438.7
5084.7
5736.2
5497.2
5650.9
5645.8
5634
5747.2
5585.2
5952.5
5833.5
5778.4
6096.9
5797.6
6187.9
5849.6
6096.6
5757.8
6248.1
6110.5
5919.8
6082.2
5886.9
6167.4
6458.9
6282.3
6762.1
6698.1
6017.3
5790.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=302380&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=302380&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302380&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[114])
1136096.6-------
1145757.8-------
1156248.15897.69935437.54216333.97580.05770.73520.73520.7352
1166110.55897.69935391.01136375.57150.19140.07530.07530.7169
1175919.85897.69935348.05546413.58260.46650.20940.20940.7025
1186082.25897.69935307.91136448.7720.25580.46870.46870.6906
1195886.95897.69935270.05336481.66550.48550.26790.26790.6807
1206167.45897.69935234.10056512.64380.1950.51370.51370.6722
1216458.95897.69935199.7676541.99290.04390.2060.2060.6648
1226282.35897.69935166.83136569.93410.13110.05090.05090.6583
1236762.15897.69935135.11796596.6430.00770.14040.14040.6526
1246698.15897.69935104.48496622.26130.01520.00970.00970.6474
1256017.35897.69935074.81546646.90590.37720.01810.01810.6428
1265790.55897.69935046.01226670.6740.39290.38080.38080.6386

\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 & 6096.6 & - & - & - & - & - & - & - \tabularnewline
114 & 5757.8 & - & - & - & - & - & - & - \tabularnewline
115 & 6248.1 & 5897.6993 & 5437.5421 & 6333.9758 & 0.0577 & 0.7352 & 0.7352 & 0.7352 \tabularnewline
116 & 6110.5 & 5897.6993 & 5391.0113 & 6375.5715 & 0.1914 & 0.0753 & 0.0753 & 0.7169 \tabularnewline
117 & 5919.8 & 5897.6993 & 5348.0554 & 6413.5826 & 0.4665 & 0.2094 & 0.2094 & 0.7025 \tabularnewline
118 & 6082.2 & 5897.6993 & 5307.9113 & 6448.772 & 0.2558 & 0.4687 & 0.4687 & 0.6906 \tabularnewline
119 & 5886.9 & 5897.6993 & 5270.0533 & 6481.6655 & 0.4855 & 0.2679 & 0.2679 & 0.6807 \tabularnewline
120 & 6167.4 & 5897.6993 & 5234.1005 & 6512.6438 & 0.195 & 0.5137 & 0.5137 & 0.6722 \tabularnewline
121 & 6458.9 & 5897.6993 & 5199.767 & 6541.9929 & 0.0439 & 0.206 & 0.206 & 0.6648 \tabularnewline
122 & 6282.3 & 5897.6993 & 5166.8313 & 6569.9341 & 0.1311 & 0.0509 & 0.0509 & 0.6583 \tabularnewline
123 & 6762.1 & 5897.6993 & 5135.1179 & 6596.643 & 0.0077 & 0.1404 & 0.1404 & 0.6526 \tabularnewline
124 & 6698.1 & 5897.6993 & 5104.4849 & 6622.2613 & 0.0152 & 0.0097 & 0.0097 & 0.6474 \tabularnewline
125 & 6017.3 & 5897.6993 & 5074.8154 & 6646.9059 & 0.3772 & 0.0181 & 0.0181 & 0.6428 \tabularnewline
126 & 5790.5 & 5897.6993 & 5046.0122 & 6670.674 & 0.3929 & 0.3808 & 0.3808 & 0.6386 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302380&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]6096.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5757.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]6248.1[/C][C]5897.6993[/C][C]5437.5421[/C][C]6333.9758[/C][C]0.0577[/C][C]0.7352[/C][C]0.7352[/C][C]0.7352[/C][/ROW]
[ROW][C]116[/C][C]6110.5[/C][C]5897.6993[/C][C]5391.0113[/C][C]6375.5715[/C][C]0.1914[/C][C]0.0753[/C][C]0.0753[/C][C]0.7169[/C][/ROW]
[ROW][C]117[/C][C]5919.8[/C][C]5897.6993[/C][C]5348.0554[/C][C]6413.5826[/C][C]0.4665[/C][C]0.2094[/C][C]0.2094[/C][C]0.7025[/C][/ROW]
[ROW][C]118[/C][C]6082.2[/C][C]5897.6993[/C][C]5307.9113[/C][C]6448.772[/C][C]0.2558[/C][C]0.4687[/C][C]0.4687[/C][C]0.6906[/C][/ROW]
[ROW][C]119[/C][C]5886.9[/C][C]5897.6993[/C][C]5270.0533[/C][C]6481.6655[/C][C]0.4855[/C][C]0.2679[/C][C]0.2679[/C][C]0.6807[/C][/ROW]
[ROW][C]120[/C][C]6167.4[/C][C]5897.6993[/C][C]5234.1005[/C][C]6512.6438[/C][C]0.195[/C][C]0.5137[/C][C]0.5137[/C][C]0.6722[/C][/ROW]
[ROW][C]121[/C][C]6458.9[/C][C]5897.6993[/C][C]5199.767[/C][C]6541.9929[/C][C]0.0439[/C][C]0.206[/C][C]0.206[/C][C]0.6648[/C][/ROW]
[ROW][C]122[/C][C]6282.3[/C][C]5897.6993[/C][C]5166.8313[/C][C]6569.9341[/C][C]0.1311[/C][C]0.0509[/C][C]0.0509[/C][C]0.6583[/C][/ROW]
[ROW][C]123[/C][C]6762.1[/C][C]5897.6993[/C][C]5135.1179[/C][C]6596.643[/C][C]0.0077[/C][C]0.1404[/C][C]0.1404[/C][C]0.6526[/C][/ROW]
[ROW][C]124[/C][C]6698.1[/C][C]5897.6993[/C][C]5104.4849[/C][C]6622.2613[/C][C]0.0152[/C][C]0.0097[/C][C]0.0097[/C][C]0.6474[/C][/ROW]
[ROW][C]125[/C][C]6017.3[/C][C]5897.6993[/C][C]5074.8154[/C][C]6646.9059[/C][C]0.3772[/C][C]0.0181[/C][C]0.0181[/C][C]0.6428[/C][/ROW]
[ROW][C]126[/C][C]5790.5[/C][C]5897.6993[/C][C]5046.0122[/C][C]6670.674[/C][C]0.3929[/C][C]0.3808[/C][C]0.3808[/C][C]0.6386[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302380&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302380&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])
1136096.6-------
1145757.8-------
1156248.15897.69935437.54216333.97580.05770.73520.73520.7352
1166110.55897.69935391.01136375.57150.19140.07530.07530.7169
1175919.85897.69935348.05546413.58260.46650.20940.20940.7025
1186082.25897.69935307.91136448.7720.25580.46870.46870.6906
1195886.95897.69935270.05336481.66550.48550.26790.26790.6807
1206167.45897.69935234.10056512.64380.1950.51370.51370.6722
1216458.95897.69935199.7676541.99290.04390.2060.2060.6648
1226282.35897.69935166.83136569.93410.13110.05090.05090.6583
1236762.15897.69935135.11796596.6430.00770.14040.14040.6526
1246698.15897.69935104.48496622.26130.01520.00970.00970.6474
1256017.35897.69935074.81546646.90590.37720.01810.01810.6428
1265790.55897.69935046.01226670.6740.39290.38080.38080.6386







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.03770.05610.05610.0577122780.6835001.33561.3356
1160.04130.03480.04550.046645284.157984032.4207289.88350.81111.0733
1170.04460.00370.03150.0323488.44356184.4281237.03250.08420.7436
1180.04770.03030.03120.031934040.525650648.4525225.05210.70320.7335
1190.0505-0.00180.02540.0259116.623940542.0868201.3507-0.04120.5951
1200.05320.04370.02840.02972738.492945908.1545214.26191.0280.6672
1210.05570.08690.03680.0379314946.278484342.1722290.41722.1390.8775
1220.05820.06120.03980.041147917.734692289.1175303.79121.46590.951
1230.06050.12780.04960.0516747188.6514165055.7324406.27053.29471.2114
1240.06270.11950.05660.0592640641.3558212614.2947461.10123.05071.3954
1250.06480.01990.05330.055614304.3387194586.1169441.11920.45591.3099
1260.0669-0.01850.05040.052511491.6798179328.2471423.4717-0.40861.2348

\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.0377 & 0.0561 & 0.0561 & 0.0577 & 122780.6835 & 0 & 0 & 1.3356 & 1.3356 \tabularnewline
116 & 0.0413 & 0.0348 & 0.0455 & 0.0466 & 45284.1579 & 84032.4207 & 289.8835 & 0.8111 & 1.0733 \tabularnewline
117 & 0.0446 & 0.0037 & 0.0315 & 0.0323 & 488.443 & 56184.4281 & 237.0325 & 0.0842 & 0.7436 \tabularnewline
118 & 0.0477 & 0.0303 & 0.0312 & 0.0319 & 34040.5256 & 50648.4525 & 225.0521 & 0.7032 & 0.7335 \tabularnewline
119 & 0.0505 & -0.0018 & 0.0254 & 0.0259 & 116.6239 & 40542.0868 & 201.3507 & -0.0412 & 0.5951 \tabularnewline
120 & 0.0532 & 0.0437 & 0.0284 & 0.029 & 72738.4929 & 45908.1545 & 214.2619 & 1.028 & 0.6672 \tabularnewline
121 & 0.0557 & 0.0869 & 0.0368 & 0.0379 & 314946.2784 & 84342.1722 & 290.4172 & 2.139 & 0.8775 \tabularnewline
122 & 0.0582 & 0.0612 & 0.0398 & 0.041 & 147917.7346 & 92289.1175 & 303.7912 & 1.4659 & 0.951 \tabularnewline
123 & 0.0605 & 0.1278 & 0.0496 & 0.0516 & 747188.6514 & 165055.7324 & 406.2705 & 3.2947 & 1.2114 \tabularnewline
124 & 0.0627 & 0.1195 & 0.0566 & 0.0592 & 640641.3558 & 212614.2947 & 461.1012 & 3.0507 & 1.3954 \tabularnewline
125 & 0.0648 & 0.0199 & 0.0533 & 0.0556 & 14304.3387 & 194586.1169 & 441.1192 & 0.4559 & 1.3099 \tabularnewline
126 & 0.0669 & -0.0185 & 0.0504 & 0.0525 & 11491.6798 & 179328.2471 & 423.4717 & -0.4086 & 1.2348 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302380&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.0377[/C][C]0.0561[/C][C]0.0561[/C][C]0.0577[/C][C]122780.6835[/C][C]0[/C][C]0[/C][C]1.3356[/C][C]1.3356[/C][/ROW]
[ROW][C]116[/C][C]0.0413[/C][C]0.0348[/C][C]0.0455[/C][C]0.0466[/C][C]45284.1579[/C][C]84032.4207[/C][C]289.8835[/C][C]0.8111[/C][C]1.0733[/C][/ROW]
[ROW][C]117[/C][C]0.0446[/C][C]0.0037[/C][C]0.0315[/C][C]0.0323[/C][C]488.443[/C][C]56184.4281[/C][C]237.0325[/C][C]0.0842[/C][C]0.7436[/C][/ROW]
[ROW][C]118[/C][C]0.0477[/C][C]0.0303[/C][C]0.0312[/C][C]0.0319[/C][C]34040.5256[/C][C]50648.4525[/C][C]225.0521[/C][C]0.7032[/C][C]0.7335[/C][/ROW]
[ROW][C]119[/C][C]0.0505[/C][C]-0.0018[/C][C]0.0254[/C][C]0.0259[/C][C]116.6239[/C][C]40542.0868[/C][C]201.3507[/C][C]-0.0412[/C][C]0.5951[/C][/ROW]
[ROW][C]120[/C][C]0.0532[/C][C]0.0437[/C][C]0.0284[/C][C]0.029[/C][C]72738.4929[/C][C]45908.1545[/C][C]214.2619[/C][C]1.028[/C][C]0.6672[/C][/ROW]
[ROW][C]121[/C][C]0.0557[/C][C]0.0869[/C][C]0.0368[/C][C]0.0379[/C][C]314946.2784[/C][C]84342.1722[/C][C]290.4172[/C][C]2.139[/C][C]0.8775[/C][/ROW]
[ROW][C]122[/C][C]0.0582[/C][C]0.0612[/C][C]0.0398[/C][C]0.041[/C][C]147917.7346[/C][C]92289.1175[/C][C]303.7912[/C][C]1.4659[/C][C]0.951[/C][/ROW]
[ROW][C]123[/C][C]0.0605[/C][C]0.1278[/C][C]0.0496[/C][C]0.0516[/C][C]747188.6514[/C][C]165055.7324[/C][C]406.2705[/C][C]3.2947[/C][C]1.2114[/C][/ROW]
[ROW][C]124[/C][C]0.0627[/C][C]0.1195[/C][C]0.0566[/C][C]0.0592[/C][C]640641.3558[/C][C]212614.2947[/C][C]461.1012[/C][C]3.0507[/C][C]1.3954[/C][/ROW]
[ROW][C]125[/C][C]0.0648[/C][C]0.0199[/C][C]0.0533[/C][C]0.0556[/C][C]14304.3387[/C][C]194586.1169[/C][C]441.1192[/C][C]0.4559[/C][C]1.3099[/C][/ROW]
[ROW][C]126[/C][C]0.0669[/C][C]-0.0185[/C][C]0.0504[/C][C]0.0525[/C][C]11491.6798[/C][C]179328.2471[/C][C]423.4717[/C][C]-0.4086[/C][C]1.2348[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302380&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302380&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.03770.05610.05610.0577122780.6835001.33561.3356
1160.04130.03480.04550.046645284.157984032.4207289.88350.81111.0733
1170.04460.00370.03150.0323488.44356184.4281237.03250.08420.7436
1180.04770.03030.03120.031934040.525650648.4525225.05210.70320.7335
1190.0505-0.00180.02540.0259116.623940542.0868201.3507-0.04120.5951
1200.05320.04370.02840.02972738.492945908.1545214.26191.0280.6672
1210.05570.08690.03680.0379314946.278484342.1722290.41722.1390.8775
1220.05820.06120.03980.041147917.734692289.1175303.79121.46590.951
1230.06050.12780.04960.0516747188.6514165055.7324406.27053.29471.2114
1240.06270.11950.05660.0592640641.3558212614.2947461.10123.05071.3954
1250.06480.01990.05330.055614304.3387194586.1169441.11920.45591.3099
1260.0669-0.01850.05040.052511491.6798179328.2471423.4717-0.40861.2348



Parameters (Session):
par1 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1.7 ; 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):
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')