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 computationSun, 18 Jan 2015 16:28:44 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2015/Jan/18/t1421598621hjgpjvhjry11f8t.htm/, Retrieved Fri, 01 Nov 2024 00:30:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=274254, Retrieved Fri, 01 Nov 2024 00:30:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact91
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2015-01-18 16:28:44] [c7f962214140f976f2c4b1bb2571d9df] [Current]
Feedback Forum

Post a new message
Dataseries X:
1775
2197
2920
4240
5415
6136
6719
6234
7152
3646
2165
2803
1615
2350
3350
3536
5834
6767
5993
7276
5641
3477
2247
2466
1567
2237
2598
3729
5715
5776
5852
6878
5488
3583
2054
2282
1552
2261
2446
3519
5161
5085
5711
6057
5224
3363
1899
2115
1491
2061
2419
3430
4778
4862
6176
5664
5529
3418
1941
2402
1579
2146
2462
3695
4831
5134
6250
5760
6249
2917
1741
2359
1511
2059
2635
2867
4403
5720
4502
5749
5627
2846
1762
2429
1169
2154
2249
2687
4359
5382
4459
6398
4596
3024
1887
2070
1351
2218
2461
3028
4784
4975
4607
6249
4809
3157
1910
2228
1594
2467
2222
3607
4685
4962
5770
5480
5000
3228
1993
2288
1588
2105
2191
3591
4668
4885
5822
5599
5340
3082
2010
2301




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274254&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274254&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274254&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net







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[120])
1082228-------
1091594-------
1102467-------
1112222-------
1123607-------
1134685-------
1144962-------
1155770-------
1165480-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881410.93471305.66411535.76530.002700.0020
12221052419.71652111.24442840.99250.07160.99990.41290.73
12321912244.7511972.80592609.51080.38640.77370.54860.4081
12435913279.51212670.10724279.22720.27070.98360.26040.974
12546684730.47253529.92697304.42380.4810.80720.51380.9685
12648855210.2663763.88428685.89520.42720.62010.55570.9503
12758225344.06693814.61129187.08210.40370.59260.4140.9405
12855996002.04154126.200511483.3730.44270.52570.5740.9079
12953404886.563575.06557897.2550.38390.32140.47060.9546
13030823185.54032587.56654172.95440.418600.46640.9626
13120101952.32461719.38532263.16010.35800.39880.0171
13223012199.44411904.6382609.77490.31380.81720.33610.3361

\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[120]) \tabularnewline
108 & 2228 & - & - & - & - & - & - & - \tabularnewline
109 & 1594 & - & - & - & - & - & - & - \tabularnewline
110 & 2467 & - & - & - & - & - & - & - \tabularnewline
111 & 2222 & - & - & - & - & - & - & - \tabularnewline
112 & 3607 & - & - & - & - & - & - & - \tabularnewline
113 & 4685 & - & - & - & - & - & - & - \tabularnewline
114 & 4962 & - & - & - & - & - & - & - \tabularnewline
115 & 5770 & - & - & - & - & - & - & - \tabularnewline
116 & 5480 & - & - & - & - & - & - & - \tabularnewline
117 & 5000 & - & - & - & - & - & - & - \tabularnewline
118 & 3228 & - & - & - & - & - & - & - \tabularnewline
119 & 1993 & - & - & - & - & - & - & - \tabularnewline
120 & 2288 & - & - & - & - & - & - & - \tabularnewline
121 & 1588 & 1410.9347 & 1305.6641 & 1535.7653 & 0.0027 & 0 & 0.002 & 0 \tabularnewline
122 & 2105 & 2419.7165 & 2111.2444 & 2840.9925 & 0.0716 & 0.9999 & 0.4129 & 0.73 \tabularnewline
123 & 2191 & 2244.751 & 1972.8059 & 2609.5108 & 0.3864 & 0.7737 & 0.5486 & 0.4081 \tabularnewline
124 & 3591 & 3279.5121 & 2670.1072 & 4279.2272 & 0.2707 & 0.9836 & 0.2604 & 0.974 \tabularnewline
125 & 4668 & 4730.4725 & 3529.9269 & 7304.4238 & 0.481 & 0.8072 & 0.5138 & 0.9685 \tabularnewline
126 & 4885 & 5210.266 & 3763.8842 & 8685.8952 & 0.4272 & 0.6201 & 0.5557 & 0.9503 \tabularnewline
127 & 5822 & 5344.0669 & 3814.6112 & 9187.0821 & 0.4037 & 0.5926 & 0.414 & 0.9405 \tabularnewline
128 & 5599 & 6002.0415 & 4126.2005 & 11483.373 & 0.4427 & 0.5257 & 0.574 & 0.9079 \tabularnewline
129 & 5340 & 4886.56 & 3575.0655 & 7897.255 & 0.3839 & 0.3214 & 0.4706 & 0.9546 \tabularnewline
130 & 3082 & 3185.5403 & 2587.5665 & 4172.9544 & 0.4186 & 0 & 0.4664 & 0.9626 \tabularnewline
131 & 2010 & 1952.3246 & 1719.3853 & 2263.1601 & 0.358 & 0 & 0.3988 & 0.0171 \tabularnewline
132 & 2301 & 2199.4441 & 1904.638 & 2609.7749 & 0.3138 & 0.8172 & 0.3361 & 0.3361 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274254&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[120])[/C][/ROW]
[ROW][C]108[/C][C]2228[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]2467[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]2222[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]3607[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]4685[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4962[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5770[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]5480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]5000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]3228[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]1993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]2288[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]1588[/C][C]1410.9347[/C][C]1305.6641[/C][C]1535.7653[/C][C]0.0027[/C][C]0[/C][C]0.002[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]2105[/C][C]2419.7165[/C][C]2111.2444[/C][C]2840.9925[/C][C]0.0716[/C][C]0.9999[/C][C]0.4129[/C][C]0.73[/C][/ROW]
[ROW][C]123[/C][C]2191[/C][C]2244.751[/C][C]1972.8059[/C][C]2609.5108[/C][C]0.3864[/C][C]0.7737[/C][C]0.5486[/C][C]0.4081[/C][/ROW]
[ROW][C]124[/C][C]3591[/C][C]3279.5121[/C][C]2670.1072[/C][C]4279.2272[/C][C]0.2707[/C][C]0.9836[/C][C]0.2604[/C][C]0.974[/C][/ROW]
[ROW][C]125[/C][C]4668[/C][C]4730.4725[/C][C]3529.9269[/C][C]7304.4238[/C][C]0.481[/C][C]0.8072[/C][C]0.5138[/C][C]0.9685[/C][/ROW]
[ROW][C]126[/C][C]4885[/C][C]5210.266[/C][C]3763.8842[/C][C]8685.8952[/C][C]0.4272[/C][C]0.6201[/C][C]0.5557[/C][C]0.9503[/C][/ROW]
[ROW][C]127[/C][C]5822[/C][C]5344.0669[/C][C]3814.6112[/C][C]9187.0821[/C][C]0.4037[/C][C]0.5926[/C][C]0.414[/C][C]0.9405[/C][/ROW]
[ROW][C]128[/C][C]5599[/C][C]6002.0415[/C][C]4126.2005[/C][C]11483.373[/C][C]0.4427[/C][C]0.5257[/C][C]0.574[/C][C]0.9079[/C][/ROW]
[ROW][C]129[/C][C]5340[/C][C]4886.56[/C][C]3575.0655[/C][C]7897.255[/C][C]0.3839[/C][C]0.3214[/C][C]0.4706[/C][C]0.9546[/C][/ROW]
[ROW][C]130[/C][C]3082[/C][C]3185.5403[/C][C]2587.5665[/C][C]4172.9544[/C][C]0.4186[/C][C]0[/C][C]0.4664[/C][C]0.9626[/C][/ROW]
[ROW][C]131[/C][C]2010[/C][C]1952.3246[/C][C]1719.3853[/C][C]2263.1601[/C][C]0.358[/C][C]0[/C][C]0.3988[/C][C]0.0171[/C][/ROW]
[ROW][C]132[/C][C]2301[/C][C]2199.4441[/C][C]1904.638[/C][C]2609.7749[/C][C]0.3138[/C][C]0.8172[/C][C]0.3361[/C][C]0.3361[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274254&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274254&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[120])
1082228-------
1091594-------
1102467-------
1112222-------
1123607-------
1134685-------
1144962-------
1155770-------
1165480-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881410.93471305.66411535.76530.002700.0020
12221052419.71652111.24442840.99250.07160.99990.41290.73
12321912244.7511972.80592609.51080.38640.77370.54860.4081
12435913279.51212670.10724279.22720.27070.98360.26040.974
12546684730.47253529.92697304.42380.4810.80720.51380.9685
12648855210.2663763.88428685.89520.42720.62010.55570.9503
12758225344.06693814.61129187.08210.40370.59260.4140.9405
12855996002.04154126.200511483.3730.44270.52570.5740.9079
12953404886.563575.06557897.2550.38390.32140.47060.9546
13030823185.54032587.56654172.95440.418600.46640.9626
13120101952.32461719.38532263.16010.35800.39880.0171
13223012199.44411904.6382609.77490.31380.81720.33610.3361







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.04510.11150.11150.118131352.1101000.23360.2336
1220.0888-0.14950.13050.128699046.455665199.2828255.3415-0.41520.3244
1230.0829-0.02450.09520.09382889.172244429.246210.7825-0.07090.2399
1240.15550.08670.09310.09397024.698957578.1092239.95440.4110.2827
1250.2776-0.01340.07710.07713902.818446843.051216.4326-0.08240.2426
1260.3403-0.06660.07540.075105797.993756668.8748238.0523-0.42920.2737
1270.36690.08210.07630.0765228420.00781204.7508284.96450.63060.3247
1280.4659-0.0720.07580.0756162442.458991359.4643302.2573-0.53180.3506
1290.31430.08490.07680.0771205607.8121104053.7252322.57360.59830.3781
1300.1581-0.03360.07250.072710720.590994720.4118307.7668-0.13660.354
1310.08120.02870.06850.06873326.446586411.8695293.9590.07610.3287
1320.09520.04410.06650.066710313.606580070.3476282.9670.1340.3125

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
121 & 0.0451 & 0.1115 & 0.1115 & 0.1181 & 31352.1101 & 0 & 0 & 0.2336 & 0.2336 \tabularnewline
122 & 0.0888 & -0.1495 & 0.1305 & 0.1286 & 99046.4556 & 65199.2828 & 255.3415 & -0.4152 & 0.3244 \tabularnewline
123 & 0.0829 & -0.0245 & 0.0952 & 0.0938 & 2889.1722 & 44429.246 & 210.7825 & -0.0709 & 0.2399 \tabularnewline
124 & 0.1555 & 0.0867 & 0.0931 & 0.093 & 97024.6989 & 57578.1092 & 239.9544 & 0.411 & 0.2827 \tabularnewline
125 & 0.2776 & -0.0134 & 0.0771 & 0.0771 & 3902.8184 & 46843.051 & 216.4326 & -0.0824 & 0.2426 \tabularnewline
126 & 0.3403 & -0.0666 & 0.0754 & 0.075 & 105797.9937 & 56668.8748 & 238.0523 & -0.4292 & 0.2737 \tabularnewline
127 & 0.3669 & 0.0821 & 0.0763 & 0.0765 & 228420.007 & 81204.7508 & 284.9645 & 0.6306 & 0.3247 \tabularnewline
128 & 0.4659 & -0.072 & 0.0758 & 0.0756 & 162442.4589 & 91359.4643 & 302.2573 & -0.5318 & 0.3506 \tabularnewline
129 & 0.3143 & 0.0849 & 0.0768 & 0.0771 & 205607.8121 & 104053.7252 & 322.5736 & 0.5983 & 0.3781 \tabularnewline
130 & 0.1581 & -0.0336 & 0.0725 & 0.0727 & 10720.5909 & 94720.4118 & 307.7668 & -0.1366 & 0.354 \tabularnewline
131 & 0.0812 & 0.0287 & 0.0685 & 0.0687 & 3326.4465 & 86411.8695 & 293.959 & 0.0761 & 0.3287 \tabularnewline
132 & 0.0952 & 0.0441 & 0.0665 & 0.0667 & 10313.6065 & 80070.3476 & 282.967 & 0.134 & 0.3125 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274254&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]121[/C][C]0.0451[/C][C]0.1115[/C][C]0.1115[/C][C]0.1181[/C][C]31352.1101[/C][C]0[/C][C]0[/C][C]0.2336[/C][C]0.2336[/C][/ROW]
[ROW][C]122[/C][C]0.0888[/C][C]-0.1495[/C][C]0.1305[/C][C]0.1286[/C][C]99046.4556[/C][C]65199.2828[/C][C]255.3415[/C][C]-0.4152[/C][C]0.3244[/C][/ROW]
[ROW][C]123[/C][C]0.0829[/C][C]-0.0245[/C][C]0.0952[/C][C]0.0938[/C][C]2889.1722[/C][C]44429.246[/C][C]210.7825[/C][C]-0.0709[/C][C]0.2399[/C][/ROW]
[ROW][C]124[/C][C]0.1555[/C][C]0.0867[/C][C]0.0931[/C][C]0.093[/C][C]97024.6989[/C][C]57578.1092[/C][C]239.9544[/C][C]0.411[/C][C]0.2827[/C][/ROW]
[ROW][C]125[/C][C]0.2776[/C][C]-0.0134[/C][C]0.0771[/C][C]0.0771[/C][C]3902.8184[/C][C]46843.051[/C][C]216.4326[/C][C]-0.0824[/C][C]0.2426[/C][/ROW]
[ROW][C]126[/C][C]0.3403[/C][C]-0.0666[/C][C]0.0754[/C][C]0.075[/C][C]105797.9937[/C][C]56668.8748[/C][C]238.0523[/C][C]-0.4292[/C][C]0.2737[/C][/ROW]
[ROW][C]127[/C][C]0.3669[/C][C]0.0821[/C][C]0.0763[/C][C]0.0765[/C][C]228420.007[/C][C]81204.7508[/C][C]284.9645[/C][C]0.6306[/C][C]0.3247[/C][/ROW]
[ROW][C]128[/C][C]0.4659[/C][C]-0.072[/C][C]0.0758[/C][C]0.0756[/C][C]162442.4589[/C][C]91359.4643[/C][C]302.2573[/C][C]-0.5318[/C][C]0.3506[/C][/ROW]
[ROW][C]129[/C][C]0.3143[/C][C]0.0849[/C][C]0.0768[/C][C]0.0771[/C][C]205607.8121[/C][C]104053.7252[/C][C]322.5736[/C][C]0.5983[/C][C]0.3781[/C][/ROW]
[ROW][C]130[/C][C]0.1581[/C][C]-0.0336[/C][C]0.0725[/C][C]0.0727[/C][C]10720.5909[/C][C]94720.4118[/C][C]307.7668[/C][C]-0.1366[/C][C]0.354[/C][/ROW]
[ROW][C]131[/C][C]0.0812[/C][C]0.0287[/C][C]0.0685[/C][C]0.0687[/C][C]3326.4465[/C][C]86411.8695[/C][C]293.959[/C][C]0.0761[/C][C]0.3287[/C][/ROW]
[ROW][C]132[/C][C]0.0952[/C][C]0.0441[/C][C]0.0665[/C][C]0.0667[/C][C]10313.6065[/C][C]80070.3476[/C][C]282.967[/C][C]0.134[/C][C]0.3125[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274254&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274254&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
1210.04510.11150.11150.118131352.1101000.23360.2336
1220.0888-0.14950.13050.128699046.455665199.2828255.3415-0.41520.3244
1230.0829-0.02450.09520.09382889.172244429.246210.7825-0.07090.2399
1240.15550.08670.09310.09397024.698957578.1092239.95440.4110.2827
1250.2776-0.01340.07710.07713902.818446843.051216.4326-0.08240.2426
1260.3403-0.06660.07540.075105797.993756668.8748238.0523-0.42920.2737
1270.36690.08210.07630.0765228420.00781204.7508284.96450.63060.3247
1280.4659-0.0720.07580.0756162442.458991359.4643302.2573-0.53180.3506
1290.31430.08490.07680.0771205607.8121104053.7252322.57360.59830.3781
1300.1581-0.03360.07250.072710720.590994720.4118307.7668-0.13660.354
1310.08120.02870.06850.06873326.446586411.8695293.9590.07610.3287
1320.09520.04410.06650.066710313.606580070.3476282.9670.1340.3125



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