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, 17 Dec 2009 03:39:50 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/17/t1261046483ugec46a0ndhxzax.htm/, Retrieved Tue, 30 Apr 2024 02:03:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68704, Retrieved Tue, 30 Apr 2024 02:03:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact131
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [Workshop 10: Arim...] [2009-12-09 16:55:41] [7c2a5b25a196bd646844b8f5223c9b3e]
- R P       [ARIMA Forecasting] [Workshop 10: arim...] [2009-12-17 10:39:50] [3d2053c5f7c50d3c075d87ce0bd87294] [Current]
Feedback Forum

Post a new message
Dataseries X:
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
246263
255765
264319
268347
273046
273963
267430
271993
292710
295881
293299




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68704&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68704&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68704&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'Gwilym Jenkins' @ 72.249.127.135







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[55])
43258556-------
44260993-------
45254663-------
46250643-------
47243422-------
48247105-------
49248541-------
50245039-------
51237080-------
52237085-------
53225554-------
54226839-------
55247934-------
56248333252146.3708243979.776260312.96550.180.8440.01690.844
57246969247434.5566236794.4121258074.7010.46580.43430.09150.4633
58245098243079.0478229413.9149256744.18070.38610.28840.1390.2431
59246263236558.4853219856.0312253260.93950.12740.15810.21030.091
60255765240374.3878221157.0507259591.7250.05820.27410.24620.2203
61264319241855.3509220168.1037263542.59810.02120.10440.27280.2914
62268347238505.622214564.6851262446.55880.00730.01730.29640.2201
63273046230555.5266204528.6235256582.42967e-040.00220.31160.0953
64273963230596.2771202598.0276258594.52670.00120.00150.32480.1124
65267430219090.3484189246.613248934.08397e-042e-040.33560.0291
66271993220379.6364188787.5788251971.69397e-040.00180.34430.0437
67292710241485.5109208231.2532274739.76870.00130.03610.35190.3519
68295881245701.7169207621.6048283781.8290.00490.00780.44610.4543
69293299240992.1357199200.9196282783.35170.00710.0050.38960.3724

\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[55]) \tabularnewline
43 & 258556 & - & - & - & - & - & - & - \tabularnewline
44 & 260993 & - & - & - & - & - & - & - \tabularnewline
45 & 254663 & - & - & - & - & - & - & - \tabularnewline
46 & 250643 & - & - & - & - & - & - & - \tabularnewline
47 & 243422 & - & - & - & - & - & - & - \tabularnewline
48 & 247105 & - & - & - & - & - & - & - \tabularnewline
49 & 248541 & - & - & - & - & - & - & - \tabularnewline
50 & 245039 & - & - & - & - & - & - & - \tabularnewline
51 & 237080 & - & - & - & - & - & - & - \tabularnewline
52 & 237085 & - & - & - & - & - & - & - \tabularnewline
53 & 225554 & - & - & - & - & - & - & - \tabularnewline
54 & 226839 & - & - & - & - & - & - & - \tabularnewline
55 & 247934 & - & - & - & - & - & - & - \tabularnewline
56 & 248333 & 252146.3708 & 243979.776 & 260312.9655 & 0.18 & 0.844 & 0.0169 & 0.844 \tabularnewline
57 & 246969 & 247434.5566 & 236794.4121 & 258074.701 & 0.4658 & 0.4343 & 0.0915 & 0.4633 \tabularnewline
58 & 245098 & 243079.0478 & 229413.9149 & 256744.1807 & 0.3861 & 0.2884 & 0.139 & 0.2431 \tabularnewline
59 & 246263 & 236558.4853 & 219856.0312 & 253260.9395 & 0.1274 & 0.1581 & 0.2103 & 0.091 \tabularnewline
60 & 255765 & 240374.3878 & 221157.0507 & 259591.725 & 0.0582 & 0.2741 & 0.2462 & 0.2203 \tabularnewline
61 & 264319 & 241855.3509 & 220168.1037 & 263542.5981 & 0.0212 & 0.1044 & 0.2728 & 0.2914 \tabularnewline
62 & 268347 & 238505.622 & 214564.6851 & 262446.5588 & 0.0073 & 0.0173 & 0.2964 & 0.2201 \tabularnewline
63 & 273046 & 230555.5266 & 204528.6235 & 256582.4296 & 7e-04 & 0.0022 & 0.3116 & 0.0953 \tabularnewline
64 & 273963 & 230596.2771 & 202598.0276 & 258594.5267 & 0.0012 & 0.0015 & 0.3248 & 0.1124 \tabularnewline
65 & 267430 & 219090.3484 & 189246.613 & 248934.0839 & 7e-04 & 2e-04 & 0.3356 & 0.0291 \tabularnewline
66 & 271993 & 220379.6364 & 188787.5788 & 251971.6939 & 7e-04 & 0.0018 & 0.3443 & 0.0437 \tabularnewline
67 & 292710 & 241485.5109 & 208231.2532 & 274739.7687 & 0.0013 & 0.0361 & 0.3519 & 0.3519 \tabularnewline
68 & 295881 & 245701.7169 & 207621.6048 & 283781.829 & 0.0049 & 0.0078 & 0.4461 & 0.4543 \tabularnewline
69 & 293299 & 240992.1357 & 199200.9196 & 282783.3517 & 0.0071 & 0.005 & 0.3896 & 0.3724 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68704&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[55])[/C][/ROW]
[ROW][C]43[/C][C]258556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]260993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]254663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]247105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]248541[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]245039[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]237080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]237085[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]225554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]226839[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]247934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]248333[/C][C]252146.3708[/C][C]243979.776[/C][C]260312.9655[/C][C]0.18[/C][C]0.844[/C][C]0.0169[/C][C]0.844[/C][/ROW]
[ROW][C]57[/C][C]246969[/C][C]247434.5566[/C][C]236794.4121[/C][C]258074.701[/C][C]0.4658[/C][C]0.4343[/C][C]0.0915[/C][C]0.4633[/C][/ROW]
[ROW][C]58[/C][C]245098[/C][C]243079.0478[/C][C]229413.9149[/C][C]256744.1807[/C][C]0.3861[/C][C]0.2884[/C][C]0.139[/C][C]0.2431[/C][/ROW]
[ROW][C]59[/C][C]246263[/C][C]236558.4853[/C][C]219856.0312[/C][C]253260.9395[/C][C]0.1274[/C][C]0.1581[/C][C]0.2103[/C][C]0.091[/C][/ROW]
[ROW][C]60[/C][C]255765[/C][C]240374.3878[/C][C]221157.0507[/C][C]259591.725[/C][C]0.0582[/C][C]0.2741[/C][C]0.2462[/C][C]0.2203[/C][/ROW]
[ROW][C]61[/C][C]264319[/C][C]241855.3509[/C][C]220168.1037[/C][C]263542.5981[/C][C]0.0212[/C][C]0.1044[/C][C]0.2728[/C][C]0.2914[/C][/ROW]
[ROW][C]62[/C][C]268347[/C][C]238505.622[/C][C]214564.6851[/C][C]262446.5588[/C][C]0.0073[/C][C]0.0173[/C][C]0.2964[/C][C]0.2201[/C][/ROW]
[ROW][C]63[/C][C]273046[/C][C]230555.5266[/C][C]204528.6235[/C][C]256582.4296[/C][C]7e-04[/C][C]0.0022[/C][C]0.3116[/C][C]0.0953[/C][/ROW]
[ROW][C]64[/C][C]273963[/C][C]230596.2771[/C][C]202598.0276[/C][C]258594.5267[/C][C]0.0012[/C][C]0.0015[/C][C]0.3248[/C][C]0.1124[/C][/ROW]
[ROW][C]65[/C][C]267430[/C][C]219090.3484[/C][C]189246.613[/C][C]248934.0839[/C][C]7e-04[/C][C]2e-04[/C][C]0.3356[/C][C]0.0291[/C][/ROW]
[ROW][C]66[/C][C]271993[/C][C]220379.6364[/C][C]188787.5788[/C][C]251971.6939[/C][C]7e-04[/C][C]0.0018[/C][C]0.3443[/C][C]0.0437[/C][/ROW]
[ROW][C]67[/C][C]292710[/C][C]241485.5109[/C][C]208231.2532[/C][C]274739.7687[/C][C]0.0013[/C][C]0.0361[/C][C]0.3519[/C][C]0.3519[/C][/ROW]
[ROW][C]68[/C][C]295881[/C][C]245701.7169[/C][C]207621.6048[/C][C]283781.829[/C][C]0.0049[/C][C]0.0078[/C][C]0.4461[/C][C]0.4543[/C][/ROW]
[ROW][C]69[/C][C]293299[/C][C]240992.1357[/C][C]199200.9196[/C][C]282783.3517[/C][C]0.0071[/C][C]0.005[/C][C]0.3896[/C][C]0.3724[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68704&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68704&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[55])
43258556-------
44260993-------
45254663-------
46250643-------
47243422-------
48247105-------
49248541-------
50245039-------
51237080-------
52237085-------
53225554-------
54226839-------
55247934-------
56248333252146.3708243979.776260312.96550.180.8440.01690.844
57246969247434.5566236794.4121258074.7010.46580.43430.09150.4633
58245098243079.0478229413.9149256744.18070.38610.28840.1390.2431
59246263236558.4853219856.0312253260.93950.12740.15810.21030.091
60255765240374.3878221157.0507259591.7250.05820.27410.24620.2203
61264319241855.3509220168.1037263542.59810.02120.10440.27280.2914
62268347238505.622214564.6851262446.55880.00730.01730.29640.2201
63273046230555.5266204528.6235256582.42967e-040.00220.31160.0953
64273963230596.2771202598.0276258594.52670.00120.00150.32480.1124
65267430219090.3484189246.613248934.08397e-042e-040.33560.0291
66271993220379.6364188787.5788251971.69397e-040.00180.34430.0437
67292710241485.5109208231.2532274739.76870.00130.03610.35190.3519
68295881245701.7169207621.6048283781.8290.00490.00780.44610.4543
69293299240992.1357199200.9196282783.35170.00710.0050.38960.3724







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.0165-0.0151014541796.556400
570.0219-0.00190.0085216742.90367379269.732716.4811
580.02870.00830.00844076168.08426278235.84812505.6408
590.0360.0410.016694177604.743228253078.07195315.3625
600.04080.0640.0261236870943.095869976651.07668365.2048
610.04580.09290.0372504615530.3763142416464.293311933.8369
620.05120.12510.0498890507842.1188249286661.125515788.8144
630.05760.18430.06661805440332.88443805870.094821066.7005
640.06190.18810.08011880672653.7364603457734.943924565.3768
650.06950.22060.09412336721913.9689776784152.846427870.8477
660.07310.23420.10692663939304.4923948343712.086930795.1898
670.07030.21210.11562623948279.71981087977426.056332984.5028
680.07910.20420.12252517960454.09171197976120.520634611.7916
690.08850.2170.12922736008056.20021307835544.497736164.009

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.0165 & -0.0151 & 0 & 14541796.5564 & 0 & 0 \tabularnewline
57 & 0.0219 & -0.0019 & 0.0085 & 216742.9036 & 7379269.73 & 2716.4811 \tabularnewline
58 & 0.0287 & 0.0083 & 0.0084 & 4076168.0842 & 6278235.8481 & 2505.6408 \tabularnewline
59 & 0.036 & 0.041 & 0.0166 & 94177604.7432 & 28253078.0719 & 5315.3625 \tabularnewline
60 & 0.0408 & 0.064 & 0.0261 & 236870943.0958 & 69976651.0766 & 8365.2048 \tabularnewline
61 & 0.0458 & 0.0929 & 0.0372 & 504615530.3763 & 142416464.2933 & 11933.8369 \tabularnewline
62 & 0.0512 & 0.1251 & 0.0498 & 890507842.1188 & 249286661.1255 & 15788.8144 \tabularnewline
63 & 0.0576 & 0.1843 & 0.0666 & 1805440332.88 & 443805870.0948 & 21066.7005 \tabularnewline
64 & 0.0619 & 0.1881 & 0.0801 & 1880672653.7364 & 603457734.9439 & 24565.3768 \tabularnewline
65 & 0.0695 & 0.2206 & 0.0941 & 2336721913.9689 & 776784152.8464 & 27870.8477 \tabularnewline
66 & 0.0731 & 0.2342 & 0.1069 & 2663939304.4923 & 948343712.0869 & 30795.1898 \tabularnewline
67 & 0.0703 & 0.2121 & 0.1156 & 2623948279.7198 & 1087977426.0563 & 32984.5028 \tabularnewline
68 & 0.0791 & 0.2042 & 0.1225 & 2517960454.0917 & 1197976120.5206 & 34611.7916 \tabularnewline
69 & 0.0885 & 0.217 & 0.1292 & 2736008056.2002 & 1307835544.4977 & 36164.009 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68704&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]56[/C][C]0.0165[/C][C]-0.0151[/C][C]0[/C][C]14541796.5564[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.0219[/C][C]-0.0019[/C][C]0.0085[/C][C]216742.9036[/C][C]7379269.73[/C][C]2716.4811[/C][/ROW]
[ROW][C]58[/C][C]0.0287[/C][C]0.0083[/C][C]0.0084[/C][C]4076168.0842[/C][C]6278235.8481[/C][C]2505.6408[/C][/ROW]
[ROW][C]59[/C][C]0.036[/C][C]0.041[/C][C]0.0166[/C][C]94177604.7432[/C][C]28253078.0719[/C][C]5315.3625[/C][/ROW]
[ROW][C]60[/C][C]0.0408[/C][C]0.064[/C][C]0.0261[/C][C]236870943.0958[/C][C]69976651.0766[/C][C]8365.2048[/C][/ROW]
[ROW][C]61[/C][C]0.0458[/C][C]0.0929[/C][C]0.0372[/C][C]504615530.3763[/C][C]142416464.2933[/C][C]11933.8369[/C][/ROW]
[ROW][C]62[/C][C]0.0512[/C][C]0.1251[/C][C]0.0498[/C][C]890507842.1188[/C][C]249286661.1255[/C][C]15788.8144[/C][/ROW]
[ROW][C]63[/C][C]0.0576[/C][C]0.1843[/C][C]0.0666[/C][C]1805440332.88[/C][C]443805870.0948[/C][C]21066.7005[/C][/ROW]
[ROW][C]64[/C][C]0.0619[/C][C]0.1881[/C][C]0.0801[/C][C]1880672653.7364[/C][C]603457734.9439[/C][C]24565.3768[/C][/ROW]
[ROW][C]65[/C][C]0.0695[/C][C]0.2206[/C][C]0.0941[/C][C]2336721913.9689[/C][C]776784152.8464[/C][C]27870.8477[/C][/ROW]
[ROW][C]66[/C][C]0.0731[/C][C]0.2342[/C][C]0.1069[/C][C]2663939304.4923[/C][C]948343712.0869[/C][C]30795.1898[/C][/ROW]
[ROW][C]67[/C][C]0.0703[/C][C]0.2121[/C][C]0.1156[/C][C]2623948279.7198[/C][C]1087977426.0563[/C][C]32984.5028[/C][/ROW]
[ROW][C]68[/C][C]0.0791[/C][C]0.2042[/C][C]0.1225[/C][C]2517960454.0917[/C][C]1197976120.5206[/C][C]34611.7916[/C][/ROW]
[ROW][C]69[/C][C]0.0885[/C][C]0.217[/C][C]0.1292[/C][C]2736008056.2002[/C][C]1307835544.4977[/C][C]36164.009[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68704&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68704&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.PEMAPESq.EMSERMSE
560.0165-0.0151014541796.556400
570.0219-0.00190.0085216742.90367379269.732716.4811
580.02870.00830.00844076168.08426278235.84812505.6408
590.0360.0410.016694177604.743228253078.07195315.3625
600.04080.0640.0261236870943.095869976651.07668365.2048
610.04580.09290.0372504615530.3763142416464.293311933.8369
620.05120.12510.0498890507842.1188249286661.125515788.8144
630.05760.18430.06661805440332.88443805870.094821066.7005
640.06190.18810.08011880672653.7364603457734.943924565.3768
650.06950.22060.09412336721913.9689776784152.846427870.8477
660.07310.23420.10692663939304.4923948343712.086930795.1898
670.07030.21210.11562623948279.71981087977426.056332984.5028
680.07910.20420.12252517960454.09171197976120.520634611.7916
690.08850.2170.12922736008056.20021307835544.497736164.009



Parameters (Session):
par1 = 14 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 14 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')