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 computationThu, 15 Jan 2015 18:36:39 +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/15/t142134700951ikpg6jxhzht47.htm/, Retrieved Tue, 14 May 2024 08:46:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=272915, Retrieved Tue, 14 May 2024 08:46:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact80
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [ARIMA Backward Selection] [] [2011-12-06 19:59:13] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [] [2011-12-06 20:08:12] [b98453cac15ba1066b407e146608df68]
- R         [ARIMA Forecasting] [] [2013-11-22 17:39:30] [0307e7a6407eb638caabc417e3a6b260]
- RM          [ARIMA Forecasting] [] [2014-11-26 18:52:52] [d253a55552bf9917a397def3be261e30]
- R PD            [ARIMA Forecasting] [] [2015-01-15 18:36:39] [940a3d9bc049bdd1effc6e8b1116301d] [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'Gertrude Mary Cox' @ cox.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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=272915&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=272915&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=272915&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'Gertrude Mary Cox' @ cox.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.00000000001-------
1165480.00000000001-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881483.39421295.41981701.80940.173900.16050
12221052418.61242093.18692800.55920.053810.40190.7487
12321912316.80211995.30962696.19620.25790.86310.68780.5591
12435913341.49442803.86253994.70840.2270.99970.21280.9992
12546684727.66923937.3085696.06940.45190.98930.53441
12648855179.54864272.88376302.34970.30360.81410.64791
12758225290.59174343.75966469.42140.18850.750.21271
12855995974.98054893.02637325.95090.29270.58780.76371
12953404932.09494031.2526059.34840.23910.12310.4531
13030823222.63952654.36793927.6170.347900.49410.9953
13120101964.86561633.43032371.78460.413900.44610.0598
13223012244.08691855.8732723.5060.4080.83070.42880.4288

\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.00000000001 & - & - & - & - & - & - & - \tabularnewline
116 & 5480.00000000001 & - & - & - & - & - & - & - \tabularnewline
117 & 5000 & - & - & - & - & - & - & - \tabularnewline
118 & 3228 & - & - & - & - & - & - & - \tabularnewline
119 & 1993 & - & - & - & - & - & - & - \tabularnewline
120 & 2288 & - & - & - & - & - & - & - \tabularnewline
121 & 1588 & 1483.3942 & 1295.4198 & 1701.8094 & 0.1739 & 0 & 0.1605 & 0 \tabularnewline
122 & 2105 & 2418.6124 & 2093.1869 & 2800.5592 & 0.0538 & 1 & 0.4019 & 0.7487 \tabularnewline
123 & 2191 & 2316.8021 & 1995.3096 & 2696.1962 & 0.2579 & 0.8631 & 0.6878 & 0.5591 \tabularnewline
124 & 3591 & 3341.4944 & 2803.8625 & 3994.7084 & 0.227 & 0.9997 & 0.2128 & 0.9992 \tabularnewline
125 & 4668 & 4727.6692 & 3937.308 & 5696.0694 & 0.4519 & 0.9893 & 0.5344 & 1 \tabularnewline
126 & 4885 & 5179.5486 & 4272.8837 & 6302.3497 & 0.3036 & 0.8141 & 0.6479 & 1 \tabularnewline
127 & 5822 & 5290.5917 & 4343.7596 & 6469.4214 & 0.1885 & 0.75 & 0.2127 & 1 \tabularnewline
128 & 5599 & 5974.9805 & 4893.0263 & 7325.9509 & 0.2927 & 0.5878 & 0.7637 & 1 \tabularnewline
129 & 5340 & 4932.0949 & 4031.252 & 6059.3484 & 0.2391 & 0.1231 & 0.453 & 1 \tabularnewline
130 & 3082 & 3222.6395 & 2654.3679 & 3927.617 & 0.3479 & 0 & 0.4941 & 0.9953 \tabularnewline
131 & 2010 & 1964.8656 & 1633.4303 & 2371.7846 & 0.4139 & 0 & 0.4461 & 0.0598 \tabularnewline
132 & 2301 & 2244.0869 & 1855.873 & 2723.506 & 0.408 & 0.8307 & 0.4288 & 0.4288 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=272915&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.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]5480.00000000001[/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]1483.3942[/C][C]1295.4198[/C][C]1701.8094[/C][C]0.1739[/C][C]0[/C][C]0.1605[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]2105[/C][C]2418.6124[/C][C]2093.1869[/C][C]2800.5592[/C][C]0.0538[/C][C]1[/C][C]0.4019[/C][C]0.7487[/C][/ROW]
[ROW][C]123[/C][C]2191[/C][C]2316.8021[/C][C]1995.3096[/C][C]2696.1962[/C][C]0.2579[/C][C]0.8631[/C][C]0.6878[/C][C]0.5591[/C][/ROW]
[ROW][C]124[/C][C]3591[/C][C]3341.4944[/C][C]2803.8625[/C][C]3994.7084[/C][C]0.227[/C][C]0.9997[/C][C]0.2128[/C][C]0.9992[/C][/ROW]
[ROW][C]125[/C][C]4668[/C][C]4727.6692[/C][C]3937.308[/C][C]5696.0694[/C][C]0.4519[/C][C]0.9893[/C][C]0.5344[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]4885[/C][C]5179.5486[/C][C]4272.8837[/C][C]6302.3497[/C][C]0.3036[/C][C]0.8141[/C][C]0.6479[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5822[/C][C]5290.5917[/C][C]4343.7596[/C][C]6469.4214[/C][C]0.1885[/C][C]0.75[/C][C]0.2127[/C][C]1[/C][/ROW]
[ROW][C]128[/C][C]5599[/C][C]5974.9805[/C][C]4893.0263[/C][C]7325.9509[/C][C]0.2927[/C][C]0.5878[/C][C]0.7637[/C][C]1[/C][/ROW]
[ROW][C]129[/C][C]5340[/C][C]4932.0949[/C][C]4031.252[/C][C]6059.3484[/C][C]0.2391[/C][C]0.1231[/C][C]0.453[/C][C]1[/C][/ROW]
[ROW][C]130[/C][C]3082[/C][C]3222.6395[/C][C]2654.3679[/C][C]3927.617[/C][C]0.3479[/C][C]0[/C][C]0.4941[/C][C]0.9953[/C][/ROW]
[ROW][C]131[/C][C]2010[/C][C]1964.8656[/C][C]1633.4303[/C][C]2371.7846[/C][C]0.4139[/C][C]0[/C][C]0.4461[/C][C]0.0598[/C][/ROW]
[ROW][C]132[/C][C]2301[/C][C]2244.0869[/C][C]1855.873[/C][C]2723.506[/C][C]0.408[/C][C]0.8307[/C][C]0.4288[/C][C]0.4288[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=272915&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=272915&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.00000000001-------
1165480.00000000001-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881483.39421295.41981701.80940.173900.16050
12221052418.61242093.18692800.55920.053810.40190.7487
12321912316.80211995.30962696.19620.25790.86310.68780.5591
12435913341.49442803.86253994.70840.2270.99970.21280.9992
12546684727.66923937.3085696.06940.45190.98930.53441
12648855179.54864272.88376302.34970.30360.81410.64791
12758225290.59174343.75966469.42140.18850.750.21271
12855995974.98054893.02637325.95090.29270.58780.76371
12953404932.09494031.2526059.34840.23910.12310.4531
13030823222.63952654.36793927.6170.347900.49410.9953
13120101964.86561633.43032371.78460.413900.44610.0598
13223012244.08691855.8732723.5060.4080.83070.42880.4288







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.07510.06590.06590.068110942.3808000.1380.138
1220.0806-0.1490.10740.103498352.750554647.5657233.7682-0.41380.2759
1230.0835-0.05740.09080.087515826.160241707.0972204.2232-0.1660.2393
1240.09970.06950.08540.083662253.063146843.5887216.43380.32920.2617
1250.1045-0.01280.07090.06953560.409138186.9528195.4148-0.07870.2251
1260.1106-0.06030.06910.067686758.881246282.2742215.1332-0.38860.2524
1270.11370.09130.07230.0716282394.794480012.6342282.8650.70120.3165
1280.1154-0.06720.07170.0708141361.33187681.2213296.1102-0.49610.3389
1290.11660.07640.07220.0718166386.578296426.261310.52580.53820.3611
1300.1116-0.04560.06950.06919779.471888761.582297.9288-0.18560.3435
1310.10570.02250.06520.06482037.117580877.5398284.38980.05960.3177
1320.1090.02470.06190.06153239.102674407.67272.77770.07510.2975

\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.0751 & 0.0659 & 0.0659 & 0.0681 & 10942.3808 & 0 & 0 & 0.138 & 0.138 \tabularnewline
122 & 0.0806 & -0.149 & 0.1074 & 0.1034 & 98352.7505 & 54647.5657 & 233.7682 & -0.4138 & 0.2759 \tabularnewline
123 & 0.0835 & -0.0574 & 0.0908 & 0.0875 & 15826.1602 & 41707.0972 & 204.2232 & -0.166 & 0.2393 \tabularnewline
124 & 0.0997 & 0.0695 & 0.0854 & 0.0836 & 62253.0631 & 46843.5887 & 216.4338 & 0.3292 & 0.2617 \tabularnewline
125 & 0.1045 & -0.0128 & 0.0709 & 0.0695 & 3560.4091 & 38186.9528 & 195.4148 & -0.0787 & 0.2251 \tabularnewline
126 & 0.1106 & -0.0603 & 0.0691 & 0.0676 & 86758.8812 & 46282.2742 & 215.1332 & -0.3886 & 0.2524 \tabularnewline
127 & 0.1137 & 0.0913 & 0.0723 & 0.0716 & 282394.7944 & 80012.6342 & 282.865 & 0.7012 & 0.3165 \tabularnewline
128 & 0.1154 & -0.0672 & 0.0717 & 0.0708 & 141361.331 & 87681.2213 & 296.1102 & -0.4961 & 0.3389 \tabularnewline
129 & 0.1166 & 0.0764 & 0.0722 & 0.0718 & 166386.5782 & 96426.261 & 310.5258 & 0.5382 & 0.3611 \tabularnewline
130 & 0.1116 & -0.0456 & 0.0695 & 0.069 & 19779.4718 & 88761.582 & 297.9288 & -0.1856 & 0.3435 \tabularnewline
131 & 0.1057 & 0.0225 & 0.0652 & 0.0648 & 2037.1175 & 80877.5398 & 284.3898 & 0.0596 & 0.3177 \tabularnewline
132 & 0.109 & 0.0247 & 0.0619 & 0.0615 & 3239.1026 & 74407.67 & 272.7777 & 0.0751 & 0.2975 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=272915&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.0751[/C][C]0.0659[/C][C]0.0659[/C][C]0.0681[/C][C]10942.3808[/C][C]0[/C][C]0[/C][C]0.138[/C][C]0.138[/C][/ROW]
[ROW][C]122[/C][C]0.0806[/C][C]-0.149[/C][C]0.1074[/C][C]0.1034[/C][C]98352.7505[/C][C]54647.5657[/C][C]233.7682[/C][C]-0.4138[/C][C]0.2759[/C][/ROW]
[ROW][C]123[/C][C]0.0835[/C][C]-0.0574[/C][C]0.0908[/C][C]0.0875[/C][C]15826.1602[/C][C]41707.0972[/C][C]204.2232[/C][C]-0.166[/C][C]0.2393[/C][/ROW]
[ROW][C]124[/C][C]0.0997[/C][C]0.0695[/C][C]0.0854[/C][C]0.0836[/C][C]62253.0631[/C][C]46843.5887[/C][C]216.4338[/C][C]0.3292[/C][C]0.2617[/C][/ROW]
[ROW][C]125[/C][C]0.1045[/C][C]-0.0128[/C][C]0.0709[/C][C]0.0695[/C][C]3560.4091[/C][C]38186.9528[/C][C]195.4148[/C][C]-0.0787[/C][C]0.2251[/C][/ROW]
[ROW][C]126[/C][C]0.1106[/C][C]-0.0603[/C][C]0.0691[/C][C]0.0676[/C][C]86758.8812[/C][C]46282.2742[/C][C]215.1332[/C][C]-0.3886[/C][C]0.2524[/C][/ROW]
[ROW][C]127[/C][C]0.1137[/C][C]0.0913[/C][C]0.0723[/C][C]0.0716[/C][C]282394.7944[/C][C]80012.6342[/C][C]282.865[/C][C]0.7012[/C][C]0.3165[/C][/ROW]
[ROW][C]128[/C][C]0.1154[/C][C]-0.0672[/C][C]0.0717[/C][C]0.0708[/C][C]141361.331[/C][C]87681.2213[/C][C]296.1102[/C][C]-0.4961[/C][C]0.3389[/C][/ROW]
[ROW][C]129[/C][C]0.1166[/C][C]0.0764[/C][C]0.0722[/C][C]0.0718[/C][C]166386.5782[/C][C]96426.261[/C][C]310.5258[/C][C]0.5382[/C][C]0.3611[/C][/ROW]
[ROW][C]130[/C][C]0.1116[/C][C]-0.0456[/C][C]0.0695[/C][C]0.069[/C][C]19779.4718[/C][C]88761.582[/C][C]297.9288[/C][C]-0.1856[/C][C]0.3435[/C][/ROW]
[ROW][C]131[/C][C]0.1057[/C][C]0.0225[/C][C]0.0652[/C][C]0.0648[/C][C]2037.1175[/C][C]80877.5398[/C][C]284.3898[/C][C]0.0596[/C][C]0.3177[/C][/ROW]
[ROW][C]132[/C][C]0.109[/C][C]0.0247[/C][C]0.0619[/C][C]0.0615[/C][C]3239.1026[/C][C]74407.67[/C][C]272.7777[/C][C]0.0751[/C][C]0.2975[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=272915&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=272915&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.07510.06590.06590.068110942.3808000.1380.138
1220.0806-0.1490.10740.103498352.750554647.5657233.7682-0.41380.2759
1230.0835-0.05740.09080.087515826.160241707.0972204.2232-0.1660.2393
1240.09970.06950.08540.083662253.063146843.5887216.43380.32920.2617
1250.1045-0.01280.07090.06953560.409138186.9528195.4148-0.07870.2251
1260.1106-0.06030.06910.067686758.881246282.2742215.1332-0.38860.2524
1270.11370.09130.07230.0716282394.794480012.6342282.8650.70120.3165
1280.1154-0.06720.07170.0708141361.33187681.2213296.1102-0.49610.3389
1290.11660.07640.07220.0718166386.578296426.261310.52580.53820.3611
1300.1116-0.04560.06950.06919779.471888761.582297.9288-0.18560.3435
1310.10570.02250.06520.06482037.117580877.5398284.38980.05960.3177
1320.1090.02470.06190.06153239.102674407.67272.77770.07510.2975



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