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 computationSat, 17 Dec 2016 16:25:24 +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/17/t1481988441ci62jwxsyi9h1mn.htm/, Retrieved Fri, 01 Nov 2024 03:46:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300854, Retrieved Fri, 01 Nov 2024 03:46:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact93
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecast] [2016-12-17 15:25:24] [e8b5e2ae4a4517822f644e6c122e1af0] [Current]
Feedback Forum

Post a new message
Dataseries X:
3800
1650
4250
3200
2050
3600
3700
6000
8550
9050
6000
8550
6700
3850
2950
2900
2200
3500
4900
6650
10050
8300
7650
5750
4600
5250
3250
1150
1950
2850
2950
4950
6000
6650
6150
4300
4450
1250
3000
2600
1200
2050
2000
5050
4050
5150
6450
3700
3300
2000
2650
900
1350
4550
1850
3650
3250
5950
4050
3250
2200
1050
2250
2650
650
1100
2900
6450
3100
6050
4200
1800
2100
1550
1050
900
1800
1700
1700
2250
4000
3500
3300
1550
2750
1900
1200
1150
1150
2200
1500
3850
2950
3750
4600
3350
2300
1400
900
1250
1650
1600
1200
2300
2950
5650
4000
3300




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=300854&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=300854&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300854&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[96])
841550-------
852750-------
861900-------
871200-------
881150-------
891150-------
902200-------
911500-------
923850-------
932950-------
943750-------
954600-------
963350-------
9723003082.5922-49.03716214.22160.31210.43350.58240.4335
9814002836.5298-1419.17517092.23470.25410.59760.66690.4065
999002610.1089-2404.08757624.30520.25190.68190.70930.3862
10012502401.7616-3174.58227978.10540.34280.70120.670.3695
10116502210.0452-3801.32268221.4130.42760.62290.63520.3551
10216002033.6323-4322.84698390.11150.44680.54710.47950.3424
10312001871.3012-4763.37238505.97470.42140.53190.54370.3311
10423001721.9279-5139.48698583.34270.43440.55930.27160.3209
10529501584.4781-5463.22328632.17950.35210.42110.35210.3117
10656501458-5743.66858659.66840.1270.34230.26640.3033
10740001341.6177-5987.89038671.12580.23860.12460.19180.2956
10833001234.5255-6201.50958670.56040.29310.2330.28860.2886

\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 & 1550 & - & - & - & - & - & - & - \tabularnewline
85 & 2750 & - & - & - & - & - & - & - \tabularnewline
86 & 1900 & - & - & - & - & - & - & - \tabularnewline
87 & 1200 & - & - & - & - & - & - & - \tabularnewline
88 & 1150 & - & - & - & - & - & - & - \tabularnewline
89 & 1150 & - & - & - & - & - & - & - \tabularnewline
90 & 2200 & - & - & - & - & - & - & - \tabularnewline
91 & 1500 & - & - & - & - & - & - & - \tabularnewline
92 & 3850 & - & - & - & - & - & - & - \tabularnewline
93 & 2950 & - & - & - & - & - & - & - \tabularnewline
94 & 3750 & - & - & - & - & - & - & - \tabularnewline
95 & 4600 & - & - & - & - & - & - & - \tabularnewline
96 & 3350 & - & - & - & - & - & - & - \tabularnewline
97 & 2300 & 3082.5922 & -49.0371 & 6214.2216 & 0.3121 & 0.4335 & 0.5824 & 0.4335 \tabularnewline
98 & 1400 & 2836.5298 & -1419.1751 & 7092.2347 & 0.2541 & 0.5976 & 0.6669 & 0.4065 \tabularnewline
99 & 900 & 2610.1089 & -2404.0875 & 7624.3052 & 0.2519 & 0.6819 & 0.7093 & 0.3862 \tabularnewline
100 & 1250 & 2401.7616 & -3174.5822 & 7978.1054 & 0.3428 & 0.7012 & 0.67 & 0.3695 \tabularnewline
101 & 1650 & 2210.0452 & -3801.3226 & 8221.413 & 0.4276 & 0.6229 & 0.6352 & 0.3551 \tabularnewline
102 & 1600 & 2033.6323 & -4322.8469 & 8390.1115 & 0.4468 & 0.5471 & 0.4795 & 0.3424 \tabularnewline
103 & 1200 & 1871.3012 & -4763.3723 & 8505.9747 & 0.4214 & 0.5319 & 0.5437 & 0.3311 \tabularnewline
104 & 2300 & 1721.9279 & -5139.4869 & 8583.3427 & 0.4344 & 0.5593 & 0.2716 & 0.3209 \tabularnewline
105 & 2950 & 1584.4781 & -5463.2232 & 8632.1795 & 0.3521 & 0.4211 & 0.3521 & 0.3117 \tabularnewline
106 & 5650 & 1458 & -5743.6685 & 8659.6684 & 0.127 & 0.3423 & 0.2664 & 0.3033 \tabularnewline
107 & 4000 & 1341.6177 & -5987.8903 & 8671.1258 & 0.2386 & 0.1246 & 0.1918 & 0.2956 \tabularnewline
108 & 3300 & 1234.5255 & -6201.5095 & 8670.5604 & 0.2931 & 0.233 & 0.2886 & 0.2886 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300854&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]1550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]1900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]1200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]1150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]1150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]2200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]1500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]3850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]4600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]3350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2300[/C][C]3082.5922[/C][C]-49.0371[/C][C]6214.2216[/C][C]0.3121[/C][C]0.4335[/C][C]0.5824[/C][C]0.4335[/C][/ROW]
[ROW][C]98[/C][C]1400[/C][C]2836.5298[/C][C]-1419.1751[/C][C]7092.2347[/C][C]0.2541[/C][C]0.5976[/C][C]0.6669[/C][C]0.4065[/C][/ROW]
[ROW][C]99[/C][C]900[/C][C]2610.1089[/C][C]-2404.0875[/C][C]7624.3052[/C][C]0.2519[/C][C]0.6819[/C][C]0.7093[/C][C]0.3862[/C][/ROW]
[ROW][C]100[/C][C]1250[/C][C]2401.7616[/C][C]-3174.5822[/C][C]7978.1054[/C][C]0.3428[/C][C]0.7012[/C][C]0.67[/C][C]0.3695[/C][/ROW]
[ROW][C]101[/C][C]1650[/C][C]2210.0452[/C][C]-3801.3226[/C][C]8221.413[/C][C]0.4276[/C][C]0.6229[/C][C]0.6352[/C][C]0.3551[/C][/ROW]
[ROW][C]102[/C][C]1600[/C][C]2033.6323[/C][C]-4322.8469[/C][C]8390.1115[/C][C]0.4468[/C][C]0.5471[/C][C]0.4795[/C][C]0.3424[/C][/ROW]
[ROW][C]103[/C][C]1200[/C][C]1871.3012[/C][C]-4763.3723[/C][C]8505.9747[/C][C]0.4214[/C][C]0.5319[/C][C]0.5437[/C][C]0.3311[/C][/ROW]
[ROW][C]104[/C][C]2300[/C][C]1721.9279[/C][C]-5139.4869[/C][C]8583.3427[/C][C]0.4344[/C][C]0.5593[/C][C]0.2716[/C][C]0.3209[/C][/ROW]
[ROW][C]105[/C][C]2950[/C][C]1584.4781[/C][C]-5463.2232[/C][C]8632.1795[/C][C]0.3521[/C][C]0.4211[/C][C]0.3521[/C][C]0.3117[/C][/ROW]
[ROW][C]106[/C][C]5650[/C][C]1458[/C][C]-5743.6685[/C][C]8659.6684[/C][C]0.127[/C][C]0.3423[/C][C]0.2664[/C][C]0.3033[/C][/ROW]
[ROW][C]107[/C][C]4000[/C][C]1341.6177[/C][C]-5987.8903[/C][C]8671.1258[/C][C]0.2386[/C][C]0.1246[/C][C]0.1918[/C][C]0.2956[/C][/ROW]
[ROW][C]108[/C][C]3300[/C][C]1234.5255[/C][C]-6201.5095[/C][C]8670.5604[/C][C]0.2931[/C][C]0.233[/C][C]0.2886[/C][C]0.2886[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300854&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300854&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])
841550-------
852750-------
861900-------
871200-------
881150-------
891150-------
902200-------
911500-------
923850-------
932950-------
943750-------
954600-------
963350-------
9723003082.5922-49.03716214.22160.31210.43350.58240.4335
9814002836.5298-1419.17517092.23470.25410.59760.66690.4065
999002610.1089-2404.08757624.30520.25190.68190.70930.3862
10012502401.7616-3174.58227978.10540.34280.70120.670.3695
10116502210.0452-3801.32268221.4130.42760.62290.63520.3551
10216002033.6323-4322.84698390.11150.44680.54710.47950.3424
10312001871.3012-4763.37238505.97470.42140.53190.54370.3311
10423001721.9279-5139.48698583.34270.43440.55930.27160.3209
10529501584.4781-5463.22328632.17950.35210.42110.35210.3117
10656501458-5743.66858659.66840.1270.34230.26640.3033
10740001341.6177-5987.89038671.12580.23860.12460.19180.2956
10833001234.5255-6201.50958670.56040.29310.2330.28860.2886







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
970.5183-0.34030.34030.2908612450.580900-0.91580.9158
980.7655-1.02610.68320.48452063617.82971338034.20531156.7343-1.6811.2984
990.9801-1.90011.08880.64782924472.2821866846.89751366.3261-2.00121.5327
1001.1846-0.92141.0470.64351326554.69661731773.84731315.9688-1.34781.4865
1011.3878-0.33940.90550.5729313650.6541448149.20871203.3907-0.65541.3202
1021.5947-0.2710.79970.5172188036.97391238130.50291112.7131-0.50741.1848
1031.8089-0.55940.76540.5057450645.33791125632.62221060.9584-0.78561.1277
1042.0330.25130.70110.4784334167.30531026699.45751013.26180.67651.0713
1052.26940.46290.67470.49221864650.02881119805.07661058.20841.5981.1298
1062.52010.74190.68140.560917572864.25922765110.99481662.86234.90551.5074
1072.78730.66460.67990.60047066996.35033156191.48171776.56733.11091.6532
1083.07320.62590.67540.62634266185.01233248690.94261802.41252.4171.7168

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
97 & 0.5183 & -0.3403 & 0.3403 & 0.2908 & 612450.5809 & 0 & 0 & -0.9158 & 0.9158 \tabularnewline
98 & 0.7655 & -1.0261 & 0.6832 & 0.4845 & 2063617.8297 & 1338034.2053 & 1156.7343 & -1.681 & 1.2984 \tabularnewline
99 & 0.9801 & -1.9001 & 1.0888 & 0.6478 & 2924472.282 & 1866846.8975 & 1366.3261 & -2.0012 & 1.5327 \tabularnewline
100 & 1.1846 & -0.9214 & 1.047 & 0.6435 & 1326554.6966 & 1731773.8473 & 1315.9688 & -1.3478 & 1.4865 \tabularnewline
101 & 1.3878 & -0.3394 & 0.9055 & 0.5729 & 313650.654 & 1448149.2087 & 1203.3907 & -0.6554 & 1.3202 \tabularnewline
102 & 1.5947 & -0.271 & 0.7997 & 0.5172 & 188036.9739 & 1238130.5029 & 1112.7131 & -0.5074 & 1.1848 \tabularnewline
103 & 1.8089 & -0.5594 & 0.7654 & 0.5057 & 450645.3379 & 1125632.6222 & 1060.9584 & -0.7856 & 1.1277 \tabularnewline
104 & 2.033 & 0.2513 & 0.7011 & 0.4784 & 334167.3053 & 1026699.4575 & 1013.2618 & 0.6765 & 1.0713 \tabularnewline
105 & 2.2694 & 0.4629 & 0.6747 & 0.4922 & 1864650.0288 & 1119805.0766 & 1058.2084 & 1.598 & 1.1298 \tabularnewline
106 & 2.5201 & 0.7419 & 0.6814 & 0.5609 & 17572864.2592 & 2765110.9948 & 1662.8623 & 4.9055 & 1.5074 \tabularnewline
107 & 2.7873 & 0.6646 & 0.6799 & 0.6004 & 7066996.3503 & 3156191.4817 & 1776.5673 & 3.1109 & 1.6532 \tabularnewline
108 & 3.0732 & 0.6259 & 0.6754 & 0.6263 & 4266185.0123 & 3248690.9426 & 1802.4125 & 2.417 & 1.7168 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300854&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]97[/C][C]0.5183[/C][C]-0.3403[/C][C]0.3403[/C][C]0.2908[/C][C]612450.5809[/C][C]0[/C][C]0[/C][C]-0.9158[/C][C]0.9158[/C][/ROW]
[ROW][C]98[/C][C]0.7655[/C][C]-1.0261[/C][C]0.6832[/C][C]0.4845[/C][C]2063617.8297[/C][C]1338034.2053[/C][C]1156.7343[/C][C]-1.681[/C][C]1.2984[/C][/ROW]
[ROW][C]99[/C][C]0.9801[/C][C]-1.9001[/C][C]1.0888[/C][C]0.6478[/C][C]2924472.282[/C][C]1866846.8975[/C][C]1366.3261[/C][C]-2.0012[/C][C]1.5327[/C][/ROW]
[ROW][C]100[/C][C]1.1846[/C][C]-0.9214[/C][C]1.047[/C][C]0.6435[/C][C]1326554.6966[/C][C]1731773.8473[/C][C]1315.9688[/C][C]-1.3478[/C][C]1.4865[/C][/ROW]
[ROW][C]101[/C][C]1.3878[/C][C]-0.3394[/C][C]0.9055[/C][C]0.5729[/C][C]313650.654[/C][C]1448149.2087[/C][C]1203.3907[/C][C]-0.6554[/C][C]1.3202[/C][/ROW]
[ROW][C]102[/C][C]1.5947[/C][C]-0.271[/C][C]0.7997[/C][C]0.5172[/C][C]188036.9739[/C][C]1238130.5029[/C][C]1112.7131[/C][C]-0.5074[/C][C]1.1848[/C][/ROW]
[ROW][C]103[/C][C]1.8089[/C][C]-0.5594[/C][C]0.7654[/C][C]0.5057[/C][C]450645.3379[/C][C]1125632.6222[/C][C]1060.9584[/C][C]-0.7856[/C][C]1.1277[/C][/ROW]
[ROW][C]104[/C][C]2.033[/C][C]0.2513[/C][C]0.7011[/C][C]0.4784[/C][C]334167.3053[/C][C]1026699.4575[/C][C]1013.2618[/C][C]0.6765[/C][C]1.0713[/C][/ROW]
[ROW][C]105[/C][C]2.2694[/C][C]0.4629[/C][C]0.6747[/C][C]0.4922[/C][C]1864650.0288[/C][C]1119805.0766[/C][C]1058.2084[/C][C]1.598[/C][C]1.1298[/C][/ROW]
[ROW][C]106[/C][C]2.5201[/C][C]0.7419[/C][C]0.6814[/C][C]0.5609[/C][C]17572864.2592[/C][C]2765110.9948[/C][C]1662.8623[/C][C]4.9055[/C][C]1.5074[/C][/ROW]
[ROW][C]107[/C][C]2.7873[/C][C]0.6646[/C][C]0.6799[/C][C]0.6004[/C][C]7066996.3503[/C][C]3156191.4817[/C][C]1776.5673[/C][C]3.1109[/C][C]1.6532[/C][/ROW]
[ROW][C]108[/C][C]3.0732[/C][C]0.6259[/C][C]0.6754[/C][C]0.6263[/C][C]4266185.0123[/C][C]3248690.9426[/C][C]1802.4125[/C][C]2.417[/C][C]1.7168[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300854&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300854&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
970.5183-0.34030.34030.2908612450.580900-0.91580.9158
980.7655-1.02610.68320.48452063617.82971338034.20531156.7343-1.6811.2984
990.9801-1.90011.08880.64782924472.2821866846.89751366.3261-2.00121.5327
1001.1846-0.92141.0470.64351326554.69661731773.84731315.9688-1.34781.4865
1011.3878-0.33940.90550.5729313650.6541448149.20871203.3907-0.65541.3202
1021.5947-0.2710.79970.5172188036.97391238130.50291112.7131-0.50741.1848
1031.8089-0.55940.76540.5057450645.33791125632.62221060.9584-0.78561.1277
1042.0330.25130.70110.4784334167.30531026699.45751013.26180.67651.0713
1052.26940.46290.67470.49221864650.02881119805.07661058.20841.5981.1298
1062.52010.74190.68140.560917572864.25922765110.99481662.86234.90551.5074
1072.78730.66460.67990.60047066996.35033156191.48171776.56733.11091.6532
1083.07320.62590.67540.62634266185.01233248690.94261802.41252.4171.7168



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '0'
par6 <- '0'
par5 <- '1'
par4 <- '0'
par3 <- '0'
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')