Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 17 Dec 2007 13:20:32 -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/2007/Dec/17/t1197921840nkjk5nq82gg52rb.htm/, Retrieved Fri, 03 May 2024 15:10:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4425, Retrieved Fri, 03 May 2024 15:10:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordspersonenwagens
Estimated Impact191
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper II ARIMAfor...] [2007-12-17 20:20:32] [fd802f308f037a9692de8c23f8b60e49] [Current]
Feedback Forum

Post a new message
Dataseries X:
37702
30364
32609
30212
29965
28352
25814
22414
20506
28806
22228
13971
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4425&T=0

[TABLE]
[ROW][C]Summary of compuational 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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4425&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4425&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[48])
3615548-------
3728029-------
3829383-------
3936438-------
4032034-------
4122679-------
4224319-------
4318004-------
4417537-------
4520366-------
4622782-------
4719169-------
4813807-------
492974330692.192124051.177440517.71180.42490.99960.70240.9996
502559128220.647822207.897937052.01720.27970.36770.39820.9993
512909633642.003525486.002946445.30470.24320.89110.33430.9988
522648228798.526822187.266738873.5130.32610.47690.26450.9982
532240522442.165817749.89829274.41520.49570.12320.47290.9934
542704424494.830819167.502832396.14810.26360.69790.51740.996
551797019408.98815572.029824860.75040.30250.0030.69330.978
561873018107.131514628.541922991.84530.40130.52190.59050.9578
571968420459.642416318.409726403.29150.39910.71580.51230.9859
581978524018.629318818.393231714.75990.14050.86520.62360.9953
591847918848.249615161.981824062.50230.44480.36240.4520.971
601069815189.167612480.261818886.21630.00860.04060.76810.7681

\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[48]) \tabularnewline
36 & 15548 & - & - & - & - & - & - & - \tabularnewline
37 & 28029 & - & - & - & - & - & - & - \tabularnewline
38 & 29383 & - & - & - & - & - & - & - \tabularnewline
39 & 36438 & - & - & - & - & - & - & - \tabularnewline
40 & 32034 & - & - & - & - & - & - & - \tabularnewline
41 & 22679 & - & - & - & - & - & - & - \tabularnewline
42 & 24319 & - & - & - & - & - & - & - \tabularnewline
43 & 18004 & - & - & - & - & - & - & - \tabularnewline
44 & 17537 & - & - & - & - & - & - & - \tabularnewline
45 & 20366 & - & - & - & - & - & - & - \tabularnewline
46 & 22782 & - & - & - & - & - & - & - \tabularnewline
47 & 19169 & - & - & - & - & - & - & - \tabularnewline
48 & 13807 & - & - & - & - & - & - & - \tabularnewline
49 & 29743 & 30692.1921 & 24051.1774 & 40517.7118 & 0.4249 & 0.9996 & 0.7024 & 0.9996 \tabularnewline
50 & 25591 & 28220.6478 & 22207.8979 & 37052.0172 & 0.2797 & 0.3677 & 0.3982 & 0.9993 \tabularnewline
51 & 29096 & 33642.0035 & 25486.0029 & 46445.3047 & 0.2432 & 0.8911 & 0.3343 & 0.9988 \tabularnewline
52 & 26482 & 28798.5268 & 22187.2667 & 38873.513 & 0.3261 & 0.4769 & 0.2645 & 0.9982 \tabularnewline
53 & 22405 & 22442.1658 & 17749.898 & 29274.4152 & 0.4957 & 0.1232 & 0.4729 & 0.9934 \tabularnewline
54 & 27044 & 24494.8308 & 19167.5028 & 32396.1481 & 0.2636 & 0.6979 & 0.5174 & 0.996 \tabularnewline
55 & 17970 & 19408.988 & 15572.0298 & 24860.7504 & 0.3025 & 0.003 & 0.6933 & 0.978 \tabularnewline
56 & 18730 & 18107.1315 & 14628.5419 & 22991.8453 & 0.4013 & 0.5219 & 0.5905 & 0.9578 \tabularnewline
57 & 19684 & 20459.6424 & 16318.4097 & 26403.2915 & 0.3991 & 0.7158 & 0.5123 & 0.9859 \tabularnewline
58 & 19785 & 24018.6293 & 18818.3932 & 31714.7599 & 0.1405 & 0.8652 & 0.6236 & 0.9953 \tabularnewline
59 & 18479 & 18848.2496 & 15161.9818 & 24062.5023 & 0.4448 & 0.3624 & 0.452 & 0.971 \tabularnewline
60 & 10698 & 15189.1676 & 12480.2618 & 18886.2163 & 0.0086 & 0.0406 & 0.7681 & 0.7681 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4425&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[48])[/C][/ROW]
[ROW][C]36[/C][C]15548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]28029[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]29383[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]36438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]32034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]22679[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]24319[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18004[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]20366[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]22782[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]19169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]13807[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]29743[/C][C]30692.1921[/C][C]24051.1774[/C][C]40517.7118[/C][C]0.4249[/C][C]0.9996[/C][C]0.7024[/C][C]0.9996[/C][/ROW]
[ROW][C]50[/C][C]25591[/C][C]28220.6478[/C][C]22207.8979[/C][C]37052.0172[/C][C]0.2797[/C][C]0.3677[/C][C]0.3982[/C][C]0.9993[/C][/ROW]
[ROW][C]51[/C][C]29096[/C][C]33642.0035[/C][C]25486.0029[/C][C]46445.3047[/C][C]0.2432[/C][C]0.8911[/C][C]0.3343[/C][C]0.9988[/C][/ROW]
[ROW][C]52[/C][C]26482[/C][C]28798.5268[/C][C]22187.2667[/C][C]38873.513[/C][C]0.3261[/C][C]0.4769[/C][C]0.2645[/C][C]0.9982[/C][/ROW]
[ROW][C]53[/C][C]22405[/C][C]22442.1658[/C][C]17749.898[/C][C]29274.4152[/C][C]0.4957[/C][C]0.1232[/C][C]0.4729[/C][C]0.9934[/C][/ROW]
[ROW][C]54[/C][C]27044[/C][C]24494.8308[/C][C]19167.5028[/C][C]32396.1481[/C][C]0.2636[/C][C]0.6979[/C][C]0.5174[/C][C]0.996[/C][/ROW]
[ROW][C]55[/C][C]17970[/C][C]19408.988[/C][C]15572.0298[/C][C]24860.7504[/C][C]0.3025[/C][C]0.003[/C][C]0.6933[/C][C]0.978[/C][/ROW]
[ROW][C]56[/C][C]18730[/C][C]18107.1315[/C][C]14628.5419[/C][C]22991.8453[/C][C]0.4013[/C][C]0.5219[/C][C]0.5905[/C][C]0.9578[/C][/ROW]
[ROW][C]57[/C][C]19684[/C][C]20459.6424[/C][C]16318.4097[/C][C]26403.2915[/C][C]0.3991[/C][C]0.7158[/C][C]0.5123[/C][C]0.9859[/C][/ROW]
[ROW][C]58[/C][C]19785[/C][C]24018.6293[/C][C]18818.3932[/C][C]31714.7599[/C][C]0.1405[/C][C]0.8652[/C][C]0.6236[/C][C]0.9953[/C][/ROW]
[ROW][C]59[/C][C]18479[/C][C]18848.2496[/C][C]15161.9818[/C][C]24062.5023[/C][C]0.4448[/C][C]0.3624[/C][C]0.452[/C][C]0.971[/C][/ROW]
[ROW][C]60[/C][C]10698[/C][C]15189.1676[/C][C]12480.2618[/C][C]18886.2163[/C][C]0.0086[/C][C]0.0406[/C][C]0.7681[/C][C]0.7681[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4425&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4425&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[48])
3615548-------
3728029-------
3829383-------
3936438-------
4032034-------
4122679-------
4224319-------
4318004-------
4417537-------
4520366-------
4622782-------
4719169-------
4813807-------
492974330692.192124051.177440517.71180.42490.99960.70240.9996
502559128220.647822207.897937052.01720.27970.36770.39820.9993
512909633642.003525486.002946445.30470.24320.89110.33430.9988
522648228798.526822187.266738873.5130.32610.47690.26450.9982
532240522442.165817749.89829274.41520.49570.12320.47290.9934
542704424494.830819167.502832396.14810.26360.69790.51740.996
551797019408.98815572.029824860.75040.30250.0030.69330.978
561873018107.131514628.541922991.84530.40130.52190.59050.9578
571968420459.642416318.409726403.29150.39910.71580.51230.9859
581978524018.629318818.393231714.75990.14050.86520.62360.9953
591847918848.249615161.981824062.50230.44480.36240.4520.971
601069815189.167612480.261818886.21630.00860.04060.76810.7681







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1633-0.03090.0026900965.583175080.4653274.0081
500.1597-0.09320.00786915047.7974576253.9831759.1139
510.1942-0.13510.011320666147.82671722178.98561312.3182
520.1785-0.08040.00675366296.3428447191.3619668.7237
530.1553-0.00171e-041381.2961115.10810.7288
540.16460.10410.00876498263.5515541521.9626735.8818
550.1433-0.07410.00622070686.5097172557.2091415.4001
560.13760.03440.0029387965.131732330.4276179.8066
570.1482-0.03790.0032601621.188950135.0991223.9087
580.1635-0.17630.014717923617.0311493634.75261222.1435
590.1411-0.01960.0016136345.231711362.1026106.5932
600.1242-0.29570.024620170586.57861680882.21491296.4884

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1633 & -0.0309 & 0.0026 & 900965.5831 & 75080.4653 & 274.0081 \tabularnewline
50 & 0.1597 & -0.0932 & 0.0078 & 6915047.7974 & 576253.9831 & 759.1139 \tabularnewline
51 & 0.1942 & -0.1351 & 0.0113 & 20666147.8267 & 1722178.9856 & 1312.3182 \tabularnewline
52 & 0.1785 & -0.0804 & 0.0067 & 5366296.3428 & 447191.3619 & 668.7237 \tabularnewline
53 & 0.1553 & -0.0017 & 1e-04 & 1381.2961 & 115.108 & 10.7288 \tabularnewline
54 & 0.1646 & 0.1041 & 0.0087 & 6498263.5515 & 541521.9626 & 735.8818 \tabularnewline
55 & 0.1433 & -0.0741 & 0.0062 & 2070686.5097 & 172557.2091 & 415.4001 \tabularnewline
56 & 0.1376 & 0.0344 & 0.0029 & 387965.1317 & 32330.4276 & 179.8066 \tabularnewline
57 & 0.1482 & -0.0379 & 0.0032 & 601621.1889 & 50135.0991 & 223.9087 \tabularnewline
58 & 0.1635 & -0.1763 & 0.0147 & 17923617.031 & 1493634.7526 & 1222.1435 \tabularnewline
59 & 0.1411 & -0.0196 & 0.0016 & 136345.2317 & 11362.1026 & 106.5932 \tabularnewline
60 & 0.1242 & -0.2957 & 0.0246 & 20170586.5786 & 1680882.2149 & 1296.4884 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4425&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]49[/C][C]0.1633[/C][C]-0.0309[/C][C]0.0026[/C][C]900965.5831[/C][C]75080.4653[/C][C]274.0081[/C][/ROW]
[ROW][C]50[/C][C]0.1597[/C][C]-0.0932[/C][C]0.0078[/C][C]6915047.7974[/C][C]576253.9831[/C][C]759.1139[/C][/ROW]
[ROW][C]51[/C][C]0.1942[/C][C]-0.1351[/C][C]0.0113[/C][C]20666147.8267[/C][C]1722178.9856[/C][C]1312.3182[/C][/ROW]
[ROW][C]52[/C][C]0.1785[/C][C]-0.0804[/C][C]0.0067[/C][C]5366296.3428[/C][C]447191.3619[/C][C]668.7237[/C][/ROW]
[ROW][C]53[/C][C]0.1553[/C][C]-0.0017[/C][C]1e-04[/C][C]1381.2961[/C][C]115.108[/C][C]10.7288[/C][/ROW]
[ROW][C]54[/C][C]0.1646[/C][C]0.1041[/C][C]0.0087[/C][C]6498263.5515[/C][C]541521.9626[/C][C]735.8818[/C][/ROW]
[ROW][C]55[/C][C]0.1433[/C][C]-0.0741[/C][C]0.0062[/C][C]2070686.5097[/C][C]172557.2091[/C][C]415.4001[/C][/ROW]
[ROW][C]56[/C][C]0.1376[/C][C]0.0344[/C][C]0.0029[/C][C]387965.1317[/C][C]32330.4276[/C][C]179.8066[/C][/ROW]
[ROW][C]57[/C][C]0.1482[/C][C]-0.0379[/C][C]0.0032[/C][C]601621.1889[/C][C]50135.0991[/C][C]223.9087[/C][/ROW]
[ROW][C]58[/C][C]0.1635[/C][C]-0.1763[/C][C]0.0147[/C][C]17923617.031[/C][C]1493634.7526[/C][C]1222.1435[/C][/ROW]
[ROW][C]59[/C][C]0.1411[/C][C]-0.0196[/C][C]0.0016[/C][C]136345.2317[/C][C]11362.1026[/C][C]106.5932[/C][/ROW]
[ROW][C]60[/C][C]0.1242[/C][C]-0.2957[/C][C]0.0246[/C][C]20170586.5786[/C][C]1680882.2149[/C][C]1296.4884[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4425&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4425&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
490.1633-0.03090.0026900965.583175080.4653274.0081
500.1597-0.09320.00786915047.7974576253.9831759.1139
510.1942-0.13510.011320666147.82671722178.98561312.3182
520.1785-0.08040.00675366296.3428447191.3619668.7237
530.1553-0.00171e-041381.2961115.10810.7288
540.16460.10410.00876498263.5515541521.9626735.8818
550.1433-0.07410.00622070686.5097172557.2091415.4001
560.13760.03440.0029387965.131732330.4276179.8066
570.1482-0.03790.0032601621.188950135.0991223.9087
580.1635-0.17630.014717923617.0311493634.75261222.1435
590.1411-0.01960.0016136345.231711362.1026106.5932
600.1242-0.29570.024620170586.57861680882.21491296.4884



Parameters (Session):
par1 = 12 ; par2 = -0.5 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.5 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; 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,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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')