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, 09 Dec 2016 10:09: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/09/t1481274799uqqqg91xncig0ex.htm/, Retrieved Fri, 17 May 2024 16:25:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=298457, Retrieved Fri, 17 May 2024 16:25:13 +0000
QR Codes:

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

Post a new message
Dataseries X:
1660
1955
2460
2580
2480
2975
2755
2595
2670
2850
2575
2425
2760
2380
2865
2850
3075
2895
2775
2930
2915
3125
2595
2350
2735
3005
3260
3000
3170
3065
2990
3135
2880
4295
4110
3320
3695
3830
4405
5650
5195
4070
4545
4460
4565
4575
3830
3955
4360
4080
4985
4210
4745
4910
4110
4455
3380
4775
4185
3875
4920
4600
4985
5570
4985
5460
5370
5080
4765
5455
4780
4735
4545
4730
5565
5365
5505
5745
5060
4995
5435
5390
5345
4665
5495
4585
4975
5320
6065
5995
5040
4930
5240
5000
5000
4565
5375
5030
5345
5830
5185
5880
6320
5460
4505
5680
4645
4075
4460
4805
5325
5620
5730
5505
4750
5455
5300
6020
4860
4245
6440
5630
5945
5670
5120
6025




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298457&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=298457&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298457&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 time2 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])
1025880-------
1036320-------
1045460-------
1054505-------
1065680-------
1074645-------
1084075-------
1094460-------
1104805-------
1115325-------
1125620-------
1135730-------
1145505-------
11547505336.54684425.23686435.52710.14780.38190.03970.3819
11654555299.37954293.34776541.1480.4030.80710.39990.3728
11753005024.35894015.80956286.20010.33430.25180.79010.2277
11860205726.12544482.59767314.6230.35850.70050.52270.6075
11948605160.52063955.77916732.16880.35390.14190.73990.3337
12042454724.91543561.91966267.63890.2710.43190.79550.1608
12164405265.82813908.12837095.19850.10420.8630.8060.3989
12256305202.3933801.62477119.29650.3310.10290.65770.3785
12359455940.54924277.7238249.74520.49850.6040.69930.6442
12456706134.59624356.52768638.36380.3580.5590.65650.6889
12551206180.26354330.55428820.03890.21560.64760.63090.6919
12660256233.25854311.49219011.61610.44160.78390.69630.6963

\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
102 & 5880 & - & - & - & - & - & - & - \tabularnewline
103 & 6320 & - & - & - & - & - & - & - \tabularnewline
104 & 5460 & - & - & - & - & - & - & - \tabularnewline
105 & 4505 & - & - & - & - & - & - & - \tabularnewline
106 & 5680 & - & - & - & - & - & - & - \tabularnewline
107 & 4645 & - & - & - & - & - & - & - \tabularnewline
108 & 4075 & - & - & - & - & - & - & - \tabularnewline
109 & 4460 & - & - & - & - & - & - & - \tabularnewline
110 & 4805 & - & - & - & - & - & - & - \tabularnewline
111 & 5325 & - & - & - & - & - & - & - \tabularnewline
112 & 5620 & - & - & - & - & - & - & - \tabularnewline
113 & 5730 & - & - & - & - & - & - & - \tabularnewline
114 & 5505 & - & - & - & - & - & - & - \tabularnewline
115 & 4750 & 5336.5468 & 4425.2368 & 6435.5271 & 0.1478 & 0.3819 & 0.0397 & 0.3819 \tabularnewline
116 & 5455 & 5299.3795 & 4293.3477 & 6541.148 & 0.403 & 0.8071 & 0.3999 & 0.3728 \tabularnewline
117 & 5300 & 5024.3589 & 4015.8095 & 6286.2001 & 0.3343 & 0.2518 & 0.7901 & 0.2277 \tabularnewline
118 & 6020 & 5726.1254 & 4482.5976 & 7314.623 & 0.3585 & 0.7005 & 0.5227 & 0.6075 \tabularnewline
119 & 4860 & 5160.5206 & 3955.7791 & 6732.1688 & 0.3539 & 0.1419 & 0.7399 & 0.3337 \tabularnewline
120 & 4245 & 4724.9154 & 3561.9196 & 6267.6389 & 0.271 & 0.4319 & 0.7955 & 0.1608 \tabularnewline
121 & 6440 & 5265.8281 & 3908.1283 & 7095.1985 & 0.1042 & 0.863 & 0.806 & 0.3989 \tabularnewline
122 & 5630 & 5202.393 & 3801.6247 & 7119.2965 & 0.331 & 0.1029 & 0.6577 & 0.3785 \tabularnewline
123 & 5945 & 5940.5492 & 4277.723 & 8249.7452 & 0.4985 & 0.604 & 0.6993 & 0.6442 \tabularnewline
124 & 5670 & 6134.5962 & 4356.5276 & 8638.3638 & 0.358 & 0.559 & 0.6565 & 0.6889 \tabularnewline
125 & 5120 & 6180.2635 & 4330.5542 & 8820.0389 & 0.2156 & 0.6476 & 0.6309 & 0.6919 \tabularnewline
126 & 6025 & 6233.2585 & 4311.4921 & 9011.6161 & 0.4416 & 0.7839 & 0.6963 & 0.6963 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298457&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]102[/C][C]5880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]6320[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4505[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]5680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]4645[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]4075[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]4460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]4805[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]5325[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]5620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5505[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]4750[/C][C]5336.5468[/C][C]4425.2368[/C][C]6435.5271[/C][C]0.1478[/C][C]0.3819[/C][C]0.0397[/C][C]0.3819[/C][/ROW]
[ROW][C]116[/C][C]5455[/C][C]5299.3795[/C][C]4293.3477[/C][C]6541.148[/C][C]0.403[/C][C]0.8071[/C][C]0.3999[/C][C]0.3728[/C][/ROW]
[ROW][C]117[/C][C]5300[/C][C]5024.3589[/C][C]4015.8095[/C][C]6286.2001[/C][C]0.3343[/C][C]0.2518[/C][C]0.7901[/C][C]0.2277[/C][/ROW]
[ROW][C]118[/C][C]6020[/C][C]5726.1254[/C][C]4482.5976[/C][C]7314.623[/C][C]0.3585[/C][C]0.7005[/C][C]0.5227[/C][C]0.6075[/C][/ROW]
[ROW][C]119[/C][C]4860[/C][C]5160.5206[/C][C]3955.7791[/C][C]6732.1688[/C][C]0.3539[/C][C]0.1419[/C][C]0.7399[/C][C]0.3337[/C][/ROW]
[ROW][C]120[/C][C]4245[/C][C]4724.9154[/C][C]3561.9196[/C][C]6267.6389[/C][C]0.271[/C][C]0.4319[/C][C]0.7955[/C][C]0.1608[/C][/ROW]
[ROW][C]121[/C][C]6440[/C][C]5265.8281[/C][C]3908.1283[/C][C]7095.1985[/C][C]0.1042[/C][C]0.863[/C][C]0.806[/C][C]0.3989[/C][/ROW]
[ROW][C]122[/C][C]5630[/C][C]5202.393[/C][C]3801.6247[/C][C]7119.2965[/C][C]0.331[/C][C]0.1029[/C][C]0.6577[/C][C]0.3785[/C][/ROW]
[ROW][C]123[/C][C]5945[/C][C]5940.5492[/C][C]4277.723[/C][C]8249.7452[/C][C]0.4985[/C][C]0.604[/C][C]0.6993[/C][C]0.6442[/C][/ROW]
[ROW][C]124[/C][C]5670[/C][C]6134.5962[/C][C]4356.5276[/C][C]8638.3638[/C][C]0.358[/C][C]0.559[/C][C]0.6565[/C][C]0.6889[/C][/ROW]
[ROW][C]125[/C][C]5120[/C][C]6180.2635[/C][C]4330.5542[/C][C]8820.0389[/C][C]0.2156[/C][C]0.6476[/C][C]0.6309[/C][C]0.6919[/C][/ROW]
[ROW][C]126[/C][C]6025[/C][C]6233.2585[/C][C]4311.4921[/C][C]9011.6161[/C][C]0.4416[/C][C]0.7839[/C][C]0.6963[/C][C]0.6963[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298457&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298457&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])
1025880-------
1036320-------
1045460-------
1054505-------
1065680-------
1074645-------
1084075-------
1094460-------
1104805-------
1115325-------
1125620-------
1135730-------
1145505-------
11547505336.54684425.23686435.52710.14780.38190.03970.3819
11654555299.37954293.34776541.1480.4030.80710.39990.3728
11753005024.35894015.80956286.20010.33430.25180.79010.2277
11860205726.12544482.59767314.6230.35850.70050.52270.6075
11948605160.52063955.77916732.16880.35390.14190.73990.3337
12042454724.91543561.91966267.63890.2710.43190.79550.1608
12164405265.82813908.12837095.19850.10420.8630.8060.3989
12256305202.3933801.62477119.29650.3310.10290.65770.3785
12359455940.54924277.7238249.74520.49850.6040.69930.6442
12456706134.59624356.52768638.36380.3580.5590.65650.6889
12551206180.26354330.55428820.03890.21560.64760.63090.6919
12660256233.25854311.49219011.61610.44160.78390.69630.6963







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.1051-0.12350.12350.1163344037.099100-0.76760.7676
1160.11960.02850.0760.072624217.7433184127.4212429.10070.20370.4857
1170.12810.0520.0680.066275978.035148077.6258384.80860.36070.444
1180.14150.04880.06320.062286362.3089132648.7966364.20980.38460.4292
1190.1554-0.06180.06290.061790312.6025124181.5578352.394-0.39330.422
1200.1666-0.11310.07130.0693230318.8054141871.099376.6578-0.62810.4563
1210.17720.18230.08720.0881378679.5883318558.0261564.40941.53670.6107
1220.1880.0760.08580.0869182847.7129301594.2369549.1760.55960.6043
1230.19837e-040.07630.077319.8094268085.9672517.77020.00580.5378
1240.2082-0.08190.07690.0775215849.6433262862.3348512.701-0.6080.5448
1250.2179-0.20710.08870.08751124158.5862341161.994584.0907-1.38760.6214
1260.2274-0.03460.08420.08343371.6152316346.1291562.4466-0.27260.5924

\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.1051 & -0.1235 & 0.1235 & 0.1163 & 344037.0991 & 0 & 0 & -0.7676 & 0.7676 \tabularnewline
116 & 0.1196 & 0.0285 & 0.076 & 0.0726 & 24217.7433 & 184127.4212 & 429.1007 & 0.2037 & 0.4857 \tabularnewline
117 & 0.1281 & 0.052 & 0.068 & 0.0662 & 75978.035 & 148077.6258 & 384.8086 & 0.3607 & 0.444 \tabularnewline
118 & 0.1415 & 0.0488 & 0.0632 & 0.0622 & 86362.3089 & 132648.7966 & 364.2098 & 0.3846 & 0.4292 \tabularnewline
119 & 0.1554 & -0.0618 & 0.0629 & 0.0617 & 90312.6025 & 124181.5578 & 352.394 & -0.3933 & 0.422 \tabularnewline
120 & 0.1666 & -0.1131 & 0.0713 & 0.0693 & 230318.8054 & 141871.099 & 376.6578 & -0.6281 & 0.4563 \tabularnewline
121 & 0.1772 & 0.1823 & 0.0872 & 0.088 & 1378679.5883 & 318558.0261 & 564.4094 & 1.5367 & 0.6107 \tabularnewline
122 & 0.188 & 0.076 & 0.0858 & 0.0869 & 182847.7129 & 301594.2369 & 549.176 & 0.5596 & 0.6043 \tabularnewline
123 & 0.1983 & 7e-04 & 0.0763 & 0.0773 & 19.8094 & 268085.9672 & 517.7702 & 0.0058 & 0.5378 \tabularnewline
124 & 0.2082 & -0.0819 & 0.0769 & 0.0775 & 215849.6433 & 262862.3348 & 512.701 & -0.608 & 0.5448 \tabularnewline
125 & 0.2179 & -0.2071 & 0.0887 & 0.0875 & 1124158.5862 & 341161.994 & 584.0907 & -1.3876 & 0.6214 \tabularnewline
126 & 0.2274 & -0.0346 & 0.0842 & 0.083 & 43371.6152 & 316346.1291 & 562.4466 & -0.2726 & 0.5924 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298457&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.1051[/C][C]-0.1235[/C][C]0.1235[/C][C]0.1163[/C][C]344037.0991[/C][C]0[/C][C]0[/C][C]-0.7676[/C][C]0.7676[/C][/ROW]
[ROW][C]116[/C][C]0.1196[/C][C]0.0285[/C][C]0.076[/C][C]0.0726[/C][C]24217.7433[/C][C]184127.4212[/C][C]429.1007[/C][C]0.2037[/C][C]0.4857[/C][/ROW]
[ROW][C]117[/C][C]0.1281[/C][C]0.052[/C][C]0.068[/C][C]0.0662[/C][C]75978.035[/C][C]148077.6258[/C][C]384.8086[/C][C]0.3607[/C][C]0.444[/C][/ROW]
[ROW][C]118[/C][C]0.1415[/C][C]0.0488[/C][C]0.0632[/C][C]0.0622[/C][C]86362.3089[/C][C]132648.7966[/C][C]364.2098[/C][C]0.3846[/C][C]0.4292[/C][/ROW]
[ROW][C]119[/C][C]0.1554[/C][C]-0.0618[/C][C]0.0629[/C][C]0.0617[/C][C]90312.6025[/C][C]124181.5578[/C][C]352.394[/C][C]-0.3933[/C][C]0.422[/C][/ROW]
[ROW][C]120[/C][C]0.1666[/C][C]-0.1131[/C][C]0.0713[/C][C]0.0693[/C][C]230318.8054[/C][C]141871.099[/C][C]376.6578[/C][C]-0.6281[/C][C]0.4563[/C][/ROW]
[ROW][C]121[/C][C]0.1772[/C][C]0.1823[/C][C]0.0872[/C][C]0.088[/C][C]1378679.5883[/C][C]318558.0261[/C][C]564.4094[/C][C]1.5367[/C][C]0.6107[/C][/ROW]
[ROW][C]122[/C][C]0.188[/C][C]0.076[/C][C]0.0858[/C][C]0.0869[/C][C]182847.7129[/C][C]301594.2369[/C][C]549.176[/C][C]0.5596[/C][C]0.6043[/C][/ROW]
[ROW][C]123[/C][C]0.1983[/C][C]7e-04[/C][C]0.0763[/C][C]0.0773[/C][C]19.8094[/C][C]268085.9672[/C][C]517.7702[/C][C]0.0058[/C][C]0.5378[/C][/ROW]
[ROW][C]124[/C][C]0.2082[/C][C]-0.0819[/C][C]0.0769[/C][C]0.0775[/C][C]215849.6433[/C][C]262862.3348[/C][C]512.701[/C][C]-0.608[/C][C]0.5448[/C][/ROW]
[ROW][C]125[/C][C]0.2179[/C][C]-0.2071[/C][C]0.0887[/C][C]0.0875[/C][C]1124158.5862[/C][C]341161.994[/C][C]584.0907[/C][C]-1.3876[/C][C]0.6214[/C][/ROW]
[ROW][C]126[/C][C]0.2274[/C][C]-0.0346[/C][C]0.0842[/C][C]0.083[/C][C]43371.6152[/C][C]316346.1291[/C][C]562.4466[/C][C]-0.2726[/C][C]0.5924[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298457&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298457&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.1051-0.12350.12350.1163344037.099100-0.76760.7676
1160.11960.02850.0760.072624217.7433184127.4212429.10070.20370.4857
1170.12810.0520.0680.066275978.035148077.6258384.80860.36070.444
1180.14150.04880.06320.062286362.3089132648.7966364.20980.38460.4292
1190.1554-0.06180.06290.061790312.6025124181.5578352.394-0.39330.422
1200.1666-0.11310.07130.0693230318.8054141871.099376.6578-0.62810.4563
1210.17720.18230.08720.0881378679.5883318558.0261564.40941.53670.6107
1220.1880.0760.08580.0869182847.7129301594.2369549.1760.55960.6043
1230.19837e-040.07630.077319.8094268085.9672517.77020.00580.5378
1240.2082-0.08190.07690.0775215849.6433262862.3348512.701-0.6080.5448
1250.2179-0.20710.08870.08751124158.5862341161.994584.0907-1.38760.6214
1260.2274-0.03460.08420.08343371.6152316346.1291562.4466-0.27260.5924



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