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 computationMon, 14 Dec 2009 14:16:16 -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/14/t1260825437r5lqpmedm0teucu.htm/, Retrieved Sun, 05 May 2024 18:42:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67686, Retrieved Sun, 05 May 2024 18:42:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact165
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [(Partial) Autocorrelation Function] [Identifying Integ...] [2009-11-22 12:16:10] [b98453cac15ba1066b407e146608df68]
-   PD        [(Partial) Autocorrelation Function] [Workshop 8 - Meth...] [2009-11-24 16:13:45] [1646a2766cb8c4a6f9d3b2fffef409b3]
-    D          [(Partial) Autocorrelation Function] [] [2009-12-07 13:30:32] [3af9fa3d2c04a43d660a9a466bdfbaa0]
- RMP               [ARIMA Forecasting] [] [2009-12-14 21:16:16] [82bf023f1e4d9556a54030fcde33aa09] [Current]
Feedback Forum

Post a new message
Dataseries X:
220206
220115
218444
214912
210705
209673
237041
242081
241878
242621
238545
240337
244752
244576
241572
240541
236089
236997
264579
270349
269645
267037
258113
262813
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
288576




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67686&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]2 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=67686&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67686&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 time2 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[82])
70250643-------
71243422-------
72247105-------
73248541-------
74245039-------
75237080-------
76237085-------
77225554-------
78226839-------
79247934-------
80248333-------
81246969-------
82245098-------
83246263237222.7409231111.6513243333.83040.00190.00580.02340.0058
84255765240056.0698231635.2106248476.92911e-040.07430.05040.1203
85264319242255.3538231431.9131253078.794500.00720.12750.3034
86268347240267.0737226608.7617253925.385703e-040.24670.2441
87273046235327.9418219332.5522251323.3313000.4150.1156
88273963233440.2463215156.4987251723.9939000.3480.1057
89267430226619.6727206122.0598247117.2855000.54060.0386
90271993225582.1539203062.3916248101.916201e-040.45640.0447
91292710248359.4379223903.6339272815.24192e-040.02910.51360.6031
92295881251278.6717224989.9471277567.39644e-040.0010.58690.6775
93293299250494.1834222479.0557278509.31110.00147e-040.59740.6471
94288576247129.7994217464.3889276795.210.00310.00110.55340.5534

\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[82]) \tabularnewline
70 & 250643 & - & - & - & - & - & - & - \tabularnewline
71 & 243422 & - & - & - & - & - & - & - \tabularnewline
72 & 247105 & - & - & - & - & - & - & - \tabularnewline
73 & 248541 & - & - & - & - & - & - & - \tabularnewline
74 & 245039 & - & - & - & - & - & - & - \tabularnewline
75 & 237080 & - & - & - & - & - & - & - \tabularnewline
76 & 237085 & - & - & - & - & - & - & - \tabularnewline
77 & 225554 & - & - & - & - & - & - & - \tabularnewline
78 & 226839 & - & - & - & - & - & - & - \tabularnewline
79 & 247934 & - & - & - & - & - & - & - \tabularnewline
80 & 248333 & - & - & - & - & - & - & - \tabularnewline
81 & 246969 & - & - & - & - & - & - & - \tabularnewline
82 & 245098 & - & - & - & - & - & - & - \tabularnewline
83 & 246263 & 237222.7409 & 231111.6513 & 243333.8304 & 0.0019 & 0.0058 & 0.0234 & 0.0058 \tabularnewline
84 & 255765 & 240056.0698 & 231635.2106 & 248476.9291 & 1e-04 & 0.0743 & 0.0504 & 0.1203 \tabularnewline
85 & 264319 & 242255.3538 & 231431.9131 & 253078.7945 & 0 & 0.0072 & 0.1275 & 0.3034 \tabularnewline
86 & 268347 & 240267.0737 & 226608.7617 & 253925.3857 & 0 & 3e-04 & 0.2467 & 0.2441 \tabularnewline
87 & 273046 & 235327.9418 & 219332.5522 & 251323.3313 & 0 & 0 & 0.415 & 0.1156 \tabularnewline
88 & 273963 & 233440.2463 & 215156.4987 & 251723.9939 & 0 & 0 & 0.348 & 0.1057 \tabularnewline
89 & 267430 & 226619.6727 & 206122.0598 & 247117.2855 & 0 & 0 & 0.5406 & 0.0386 \tabularnewline
90 & 271993 & 225582.1539 & 203062.3916 & 248101.9162 & 0 & 1e-04 & 0.4564 & 0.0447 \tabularnewline
91 & 292710 & 248359.4379 & 223903.6339 & 272815.2419 & 2e-04 & 0.0291 & 0.5136 & 0.6031 \tabularnewline
92 & 295881 & 251278.6717 & 224989.9471 & 277567.3964 & 4e-04 & 0.001 & 0.5869 & 0.6775 \tabularnewline
93 & 293299 & 250494.1834 & 222479.0557 & 278509.3111 & 0.0014 & 7e-04 & 0.5974 & 0.6471 \tabularnewline
94 & 288576 & 247129.7994 & 217464.3889 & 276795.21 & 0.0031 & 0.0011 & 0.5534 & 0.5534 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67686&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[82])[/C][/ROW]
[ROW][C]70[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]247105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]248541[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]245039[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]237080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]237085[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]225554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]226839[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]247934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]248333[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]246969[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]245098[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]246263[/C][C]237222.7409[/C][C]231111.6513[/C][C]243333.8304[/C][C]0.0019[/C][C]0.0058[/C][C]0.0234[/C][C]0.0058[/C][/ROW]
[ROW][C]84[/C][C]255765[/C][C]240056.0698[/C][C]231635.2106[/C][C]248476.9291[/C][C]1e-04[/C][C]0.0743[/C][C]0.0504[/C][C]0.1203[/C][/ROW]
[ROW][C]85[/C][C]264319[/C][C]242255.3538[/C][C]231431.9131[/C][C]253078.7945[/C][C]0[/C][C]0.0072[/C][C]0.1275[/C][C]0.3034[/C][/ROW]
[ROW][C]86[/C][C]268347[/C][C]240267.0737[/C][C]226608.7617[/C][C]253925.3857[/C][C]0[/C][C]3e-04[/C][C]0.2467[/C][C]0.2441[/C][/ROW]
[ROW][C]87[/C][C]273046[/C][C]235327.9418[/C][C]219332.5522[/C][C]251323.3313[/C][C]0[/C][C]0[/C][C]0.415[/C][C]0.1156[/C][/ROW]
[ROW][C]88[/C][C]273963[/C][C]233440.2463[/C][C]215156.4987[/C][C]251723.9939[/C][C]0[/C][C]0[/C][C]0.348[/C][C]0.1057[/C][/ROW]
[ROW][C]89[/C][C]267430[/C][C]226619.6727[/C][C]206122.0598[/C][C]247117.2855[/C][C]0[/C][C]0[/C][C]0.5406[/C][C]0.0386[/C][/ROW]
[ROW][C]90[/C][C]271993[/C][C]225582.1539[/C][C]203062.3916[/C][C]248101.9162[/C][C]0[/C][C]1e-04[/C][C]0.4564[/C][C]0.0447[/C][/ROW]
[ROW][C]91[/C][C]292710[/C][C]248359.4379[/C][C]223903.6339[/C][C]272815.2419[/C][C]2e-04[/C][C]0.0291[/C][C]0.5136[/C][C]0.6031[/C][/ROW]
[ROW][C]92[/C][C]295881[/C][C]251278.6717[/C][C]224989.9471[/C][C]277567.3964[/C][C]4e-04[/C][C]0.001[/C][C]0.5869[/C][C]0.6775[/C][/ROW]
[ROW][C]93[/C][C]293299[/C][C]250494.1834[/C][C]222479.0557[/C][C]278509.3111[/C][C]0.0014[/C][C]7e-04[/C][C]0.5974[/C][C]0.6471[/C][/ROW]
[ROW][C]94[/C][C]288576[/C][C]247129.7994[/C][C]217464.3889[/C][C]276795.21[/C][C]0.0031[/C][C]0.0011[/C][C]0.5534[/C][C]0.5534[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67686&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67686&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[82])
70250643-------
71243422-------
72247105-------
73248541-------
74245039-------
75237080-------
76237085-------
77225554-------
78226839-------
79247934-------
80248333-------
81246969-------
82245098-------
83246263237222.7409231111.6513243333.83040.00190.00580.02340.0058
84255765240056.0698231635.2106248476.92911e-040.07430.05040.1203
85264319242255.3538231431.9131253078.794500.00720.12750.3034
86268347240267.0737226608.7617253925.385703e-040.24670.2441
87273046235327.9418219332.5522251323.3313000.4150.1156
88273963233440.2463215156.4987251723.9939000.3480.1057
89267430226619.6727206122.0598247117.2855000.54060.0386
90271993225582.1539203062.3916248101.916201e-040.45640.0447
91292710248359.4379223903.6339272815.24192e-040.02910.51360.6031
92295881251278.6717224989.9471277567.39644e-040.0010.58690.6775
93293299250494.1834222479.0557278509.31110.00147e-040.59740.6471
94288576247129.7994217464.3889276795.210.00310.00110.55340.5534







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
830.01310.0381081726285.445200
840.01790.06540.0518246770487.5552164248386.500212815.9427
850.02280.09110.0649486804483.34271767085.446816485.3597
860.0290.11690.0779788482262.0357400945879.59420023.633
870.03470.16030.09441422651916.9033605287087.055924602.5829
880.040.17360.10761642093566.6177778088166.982827894.2318
890.04610.18010.11791665482817.0823904858831.282730080.8715
900.05090.20570.12892153966636.15091060997306.891332572.9536
910.05020.17860.13441966972360.121161661201.694534083.1513
920.05340.17750.13871989367685.37051244431850.062135276.5056
930.05710.17090.14161832252322.43771297870074.823536025.9639
940.06120.16770.14381717787541.58091332863197.053336508.399

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
83 & 0.0131 & 0.0381 & 0 & 81726285.4452 & 0 & 0 \tabularnewline
84 & 0.0179 & 0.0654 & 0.0518 & 246770487.5552 & 164248386.5002 & 12815.9427 \tabularnewline
85 & 0.0228 & 0.0911 & 0.0649 & 486804483.34 & 271767085.4468 & 16485.3597 \tabularnewline
86 & 0.029 & 0.1169 & 0.0779 & 788482262.0357 & 400945879.594 & 20023.633 \tabularnewline
87 & 0.0347 & 0.1603 & 0.0944 & 1422651916.9033 & 605287087.0559 & 24602.5829 \tabularnewline
88 & 0.04 & 0.1736 & 0.1076 & 1642093566.6177 & 778088166.9828 & 27894.2318 \tabularnewline
89 & 0.0461 & 0.1801 & 0.1179 & 1665482817.0823 & 904858831.2827 & 30080.8715 \tabularnewline
90 & 0.0509 & 0.2057 & 0.1289 & 2153966636.1509 & 1060997306.8913 & 32572.9536 \tabularnewline
91 & 0.0502 & 0.1786 & 0.1344 & 1966972360.12 & 1161661201.6945 & 34083.1513 \tabularnewline
92 & 0.0534 & 0.1775 & 0.1387 & 1989367685.3705 & 1244431850.0621 & 35276.5056 \tabularnewline
93 & 0.0571 & 0.1709 & 0.1416 & 1832252322.4377 & 1297870074.8235 & 36025.9639 \tabularnewline
94 & 0.0612 & 0.1677 & 0.1438 & 1717787541.5809 & 1332863197.0533 & 36508.399 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67686&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]83[/C][C]0.0131[/C][C]0.0381[/C][C]0[/C][C]81726285.4452[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]84[/C][C]0.0179[/C][C]0.0654[/C][C]0.0518[/C][C]246770487.5552[/C][C]164248386.5002[/C][C]12815.9427[/C][/ROW]
[ROW][C]85[/C][C]0.0228[/C][C]0.0911[/C][C]0.0649[/C][C]486804483.34[/C][C]271767085.4468[/C][C]16485.3597[/C][/ROW]
[ROW][C]86[/C][C]0.029[/C][C]0.1169[/C][C]0.0779[/C][C]788482262.0357[/C][C]400945879.594[/C][C]20023.633[/C][/ROW]
[ROW][C]87[/C][C]0.0347[/C][C]0.1603[/C][C]0.0944[/C][C]1422651916.9033[/C][C]605287087.0559[/C][C]24602.5829[/C][/ROW]
[ROW][C]88[/C][C]0.04[/C][C]0.1736[/C][C]0.1076[/C][C]1642093566.6177[/C][C]778088166.9828[/C][C]27894.2318[/C][/ROW]
[ROW][C]89[/C][C]0.0461[/C][C]0.1801[/C][C]0.1179[/C][C]1665482817.0823[/C][C]904858831.2827[/C][C]30080.8715[/C][/ROW]
[ROW][C]90[/C][C]0.0509[/C][C]0.2057[/C][C]0.1289[/C][C]2153966636.1509[/C][C]1060997306.8913[/C][C]32572.9536[/C][/ROW]
[ROW][C]91[/C][C]0.0502[/C][C]0.1786[/C][C]0.1344[/C][C]1966972360.12[/C][C]1161661201.6945[/C][C]34083.1513[/C][/ROW]
[ROW][C]92[/C][C]0.0534[/C][C]0.1775[/C][C]0.1387[/C][C]1989367685.3705[/C][C]1244431850.0621[/C][C]35276.5056[/C][/ROW]
[ROW][C]93[/C][C]0.0571[/C][C]0.1709[/C][C]0.1416[/C][C]1832252322.4377[/C][C]1297870074.8235[/C][C]36025.9639[/C][/ROW]
[ROW][C]94[/C][C]0.0612[/C][C]0.1677[/C][C]0.1438[/C][C]1717787541.5809[/C][C]1332863197.0533[/C][C]36508.399[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67686&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67686&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
830.01310.0381081726285.445200
840.01790.06540.0518246770487.5552164248386.500212815.9427
850.02280.09110.0649486804483.34271767085.446816485.3597
860.0290.11690.0779788482262.0357400945879.59420023.633
870.03470.16030.09441422651916.9033605287087.055924602.5829
880.040.17360.10761642093566.6177778088166.982827894.2318
890.04610.18010.11791665482817.0823904858831.282730080.8715
900.05090.20570.12892153966636.15091060997306.891332572.9536
910.05020.17860.13441966972360.121161661201.694534083.1513
920.05340.17750.13871989367685.37051244431850.062135276.5056
930.05710.17090.14161832252322.43771297870074.823536025.9639
940.06120.16770.14381717787541.58091332863197.053336508.399



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; 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')