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 computationTue, 07 Dec 2010 21:16:27 +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/2010/Dec/07/t12917564533jhpwtoarl2f5l6.htm/, Retrieved Fri, 03 May 2024 19:02:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=106750, Retrieved Fri, 03 May 2024 19:02:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact155
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]
F RMP   [(Partial) Autocorrelation Function] [WS 9] [2010-12-07 20:24:41] [9b13650c94c5192ca5135ec8a1fa39f7]
F   P     [(Partial) Autocorrelation Function] [WS 9] [2010-12-07 20:31:07] [9b13650c94c5192ca5135ec8a1fa39f7]
F RMP       [ARIMA Backward Selection] [WS 9] [2010-12-07 20:50:44] [9b13650c94c5192ca5135ec8a1fa39f7]
F RM            [ARIMA Forecasting] [WS 9] [2010-12-07 21:16:27] [5fd8c857995b7937a45335fd5ccccdde] [Current]
Feedback Forum
2010-12-10 18:49:03 [48eb36e2c01435ad7e4ea7854a9d98fe] [reply
De student maakt hier een correcte berekening met de software, maar er ontbreekt een conclusie.

Wanneer we de grafiek bekijken, zien we dat de witte lijn de voorspelling op basis van het model voorsteld en dat hierrond een betrouwbaarheidsinterval wordt gebouwd (de oranje zone). We stellen ook vast dat de werkelijke waarden (de zwarte lijn) gelegen is in dit bijzonder smalle betrouwbaarheidsinterval. Hieruit mogen we dus afleiden dat het model dat hier gemaakt wordt een bijzonder goed model is (al moeten we wel rekening houden met het feit dat de normaalverdeling - zie hierboven - niet helemaal goed zit).

Post a new message
Dataseries X:
655362
873127
1107897
1555964
1671159
1493308
2957796
2638691
1305669
1280496
921900
867888
652586
913831
1108544
1555827
1699283
1509458
3268975
2425016
1312703
1365498
934453
775019
651142
843192
1146766
1652601
1465906
1652734
2922334
2702805
1458956
1410363
1019279
936574
708917
885295
1099663
1576220
1487870
1488635
2882530
2677026
1404398
1344370
936865
872705
628151
953712
1160384
1400618
1661511
1495347
2918786
2775677
1407026
1370199
964526
850851
683118
847224
1073256
1514326
1503734
1507712
2865698
2788128
1391596
1366378
946295
859626




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=106750&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 time3 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[60])
48872705-------
49628151-------
50953712-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526-------
60850851-------
61683118665267.6524496636.165833899.13990.41780.01550.66690.0155
62847224928604.2756764.61921100443.78090.17660.99740.38730.8124
6310732561088131.7309915899.81921260363.64270.43280.99690.20550.9965
6415143261551051.91831378846.75561723257.08090.33810.95661
6515037341609910.85611437427.25591782394.45630.11380.86130.27881
6615077121484982.2651312205.98021657758.54970.39830.41580.45321
6728656982997011.86642824254.09073169769.64210.068110.81261
6827881282674686.62712501766.27432847606.97980.09930.01520.12621
6913915961353721.49611180467.09381526975.89830.334200.27321
7013663781392186.19621218889.56811565482.82430.38520.50270.59821
71946295952979.4513779623.73911126335.16340.469900.44810.8759
72859626834884.332661272.14471008496.51930.390.10420.42850.4285

\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[60]) \tabularnewline
48 & 872705 & - & - & - & - & - & - & - \tabularnewline
49 & 628151 & - & - & - & - & - & - & - \tabularnewline
50 & 953712 & - & - & - & - & - & - & - \tabularnewline
51 & 1160384 & - & - & - & - & - & - & - \tabularnewline
52 & 1400618 & - & - & - & - & - & - & - \tabularnewline
53 & 1661511 & - & - & - & - & - & - & - \tabularnewline
54 & 1495347 & - & - & - & - & - & - & - \tabularnewline
55 & 2918786 & - & - & - & - & - & - & - \tabularnewline
56 & 2775677 & - & - & - & - & - & - & - \tabularnewline
57 & 1407026 & - & - & - & - & - & - & - \tabularnewline
58 & 1370199 & - & - & - & - & - & - & - \tabularnewline
59 & 964526 & - & - & - & - & - & - & - \tabularnewline
60 & 850851 & - & - & - & - & - & - & - \tabularnewline
61 & 683118 & 665267.6524 & 496636.165 & 833899.1399 & 0.4178 & 0.0155 & 0.6669 & 0.0155 \tabularnewline
62 & 847224 & 928604.2 & 756764.6192 & 1100443.7809 & 0.1766 & 0.9974 & 0.3873 & 0.8124 \tabularnewline
63 & 1073256 & 1088131.7309 & 915899.8192 & 1260363.6427 & 0.4328 & 0.9969 & 0.2055 & 0.9965 \tabularnewline
64 & 1514326 & 1551051.9183 & 1378846.7556 & 1723257.0809 & 0.338 & 1 & 0.9566 & 1 \tabularnewline
65 & 1503734 & 1609910.8561 & 1437427.2559 & 1782394.4563 & 0.1138 & 0.8613 & 0.2788 & 1 \tabularnewline
66 & 1507712 & 1484982.265 & 1312205.9802 & 1657758.5497 & 0.3983 & 0.4158 & 0.4532 & 1 \tabularnewline
67 & 2865698 & 2997011.8664 & 2824254.0907 & 3169769.6421 & 0.0681 & 1 & 0.8126 & 1 \tabularnewline
68 & 2788128 & 2674686.6271 & 2501766.2743 & 2847606.9798 & 0.0993 & 0.0152 & 0.1262 & 1 \tabularnewline
69 & 1391596 & 1353721.4961 & 1180467.0938 & 1526975.8983 & 0.3342 & 0 & 0.2732 & 1 \tabularnewline
70 & 1366378 & 1392186.1962 & 1218889.5681 & 1565482.8243 & 0.3852 & 0.5027 & 0.5982 & 1 \tabularnewline
71 & 946295 & 952979.4513 & 779623.7391 & 1126335.1634 & 0.4699 & 0 & 0.4481 & 0.8759 \tabularnewline
72 & 859626 & 834884.332 & 661272.1447 & 1008496.5193 & 0.39 & 0.1042 & 0.4285 & 0.4285 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=106750&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[60])[/C][/ROW]
[ROW][C]48[/C][C]872705[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]628151[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]953712[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]1160384[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]1400618[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]1661511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]1495347[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]2918786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]2775677[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]1407026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]1370199[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]964526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]850851[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]683118[/C][C]665267.6524[/C][C]496636.165[/C][C]833899.1399[/C][C]0.4178[/C][C]0.0155[/C][C]0.6669[/C][C]0.0155[/C][/ROW]
[ROW][C]62[/C][C]847224[/C][C]928604.2[/C][C]756764.6192[/C][C]1100443.7809[/C][C]0.1766[/C][C]0.9974[/C][C]0.3873[/C][C]0.8124[/C][/ROW]
[ROW][C]63[/C][C]1073256[/C][C]1088131.7309[/C][C]915899.8192[/C][C]1260363.6427[/C][C]0.4328[/C][C]0.9969[/C][C]0.2055[/C][C]0.9965[/C][/ROW]
[ROW][C]64[/C][C]1514326[/C][C]1551051.9183[/C][C]1378846.7556[/C][C]1723257.0809[/C][C]0.338[/C][C]1[/C][C]0.9566[/C][C]1[/C][/ROW]
[ROW][C]65[/C][C]1503734[/C][C]1609910.8561[/C][C]1437427.2559[/C][C]1782394.4563[/C][C]0.1138[/C][C]0.8613[/C][C]0.2788[/C][C]1[/C][/ROW]
[ROW][C]66[/C][C]1507712[/C][C]1484982.265[/C][C]1312205.9802[/C][C]1657758.5497[/C][C]0.3983[/C][C]0.4158[/C][C]0.4532[/C][C]1[/C][/ROW]
[ROW][C]67[/C][C]2865698[/C][C]2997011.8664[/C][C]2824254.0907[/C][C]3169769.6421[/C][C]0.0681[/C][C]1[/C][C]0.8126[/C][C]1[/C][/ROW]
[ROW][C]68[/C][C]2788128[/C][C]2674686.6271[/C][C]2501766.2743[/C][C]2847606.9798[/C][C]0.0993[/C][C]0.0152[/C][C]0.1262[/C][C]1[/C][/ROW]
[ROW][C]69[/C][C]1391596[/C][C]1353721.4961[/C][C]1180467.0938[/C][C]1526975.8983[/C][C]0.3342[/C][C]0[/C][C]0.2732[/C][C]1[/C][/ROW]
[ROW][C]70[/C][C]1366378[/C][C]1392186.1962[/C][C]1218889.5681[/C][C]1565482.8243[/C][C]0.3852[/C][C]0.5027[/C][C]0.5982[/C][C]1[/C][/ROW]
[ROW][C]71[/C][C]946295[/C][C]952979.4513[/C][C]779623.7391[/C][C]1126335.1634[/C][C]0.4699[/C][C]0[/C][C]0.4481[/C][C]0.8759[/C][/ROW]
[ROW][C]72[/C][C]859626[/C][C]834884.332[/C][C]661272.1447[/C][C]1008496.5193[/C][C]0.39[/C][C]0.1042[/C][C]0.4285[/C][C]0.4285[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=106750&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=106750&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[60])
48872705-------
49628151-------
50953712-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526-------
60850851-------
61683118665267.6524496636.165833899.13990.41780.01550.66690.0155
62847224928604.2756764.61921100443.78090.17660.99740.38730.8124
6310732561088131.7309915899.81921260363.64270.43280.99690.20550.9965
6415143261551051.91831378846.75561723257.08090.33810.95661
6515037341609910.85611437427.25591782394.45630.11380.86130.27881
6615077121484982.2651312205.98021657758.54970.39830.41580.45321
6728656982997011.86642824254.09073169769.64210.068110.81261
6827881282674686.62712501766.27432847606.97980.09930.01520.12621
6913915961353721.49611180467.09381526975.89830.334200.27321
7013663781392186.19621218889.56811565482.82430.38520.50270.59821
71946295952979.4513779623.73911126335.16340.469900.44810.8759
72859626834884.332661272.14471008496.51930.390.10420.42850.4285







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.12930.02680318634908.45400
620.0944-0.08760.05726622736958.18113470685933.317558912.5278
630.0808-0.01370.0427221287371.05132387553079.228848862.5939
640.0566-0.02370.0381348793071.41912127863077.276446128.7663
650.0547-0.0660.043611273524779.54043956995417.729262904.6534
660.05940.01530.0388516640853.70363383602990.391658168.7458
670.0294-0.04380.039617243331513.05125363564207.914473236.3585
680.0330.04240.039912868945093.66916301736818.633779383.4795
690.06530.0280.03861434478048.82155760930288.654675900.7924
700.0635-0.01850.0366666062992.71295251443559.060472466.8446
710.0928-0.0070.033944681888.86174778101589.042369123.8135
720.10610.02960.0335612150134.9834430938967.870766565.2985

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.1293 & 0.0268 & 0 & 318634908.454 & 0 & 0 \tabularnewline
62 & 0.0944 & -0.0876 & 0.0572 & 6622736958.1811 & 3470685933.3175 & 58912.5278 \tabularnewline
63 & 0.0808 & -0.0137 & 0.0427 & 221287371.0513 & 2387553079.2288 & 48862.5939 \tabularnewline
64 & 0.0566 & -0.0237 & 0.038 & 1348793071.4191 & 2127863077.2764 & 46128.7663 \tabularnewline
65 & 0.0547 & -0.066 & 0.0436 & 11273524779.5404 & 3956995417.7292 & 62904.6534 \tabularnewline
66 & 0.0594 & 0.0153 & 0.0388 & 516640853.7036 & 3383602990.3916 & 58168.7458 \tabularnewline
67 & 0.0294 & -0.0438 & 0.0396 & 17243331513.0512 & 5363564207.9144 & 73236.3585 \tabularnewline
68 & 0.033 & 0.0424 & 0.0399 & 12868945093.6691 & 6301736818.6337 & 79383.4795 \tabularnewline
69 & 0.0653 & 0.028 & 0.0386 & 1434478048.8215 & 5760930288.6546 & 75900.7924 \tabularnewline
70 & 0.0635 & -0.0185 & 0.0366 & 666062992.7129 & 5251443559.0604 & 72466.8446 \tabularnewline
71 & 0.0928 & -0.007 & 0.0339 & 44681888.8617 & 4778101589.0423 & 69123.8135 \tabularnewline
72 & 0.1061 & 0.0296 & 0.0335 & 612150134.983 & 4430938967.8707 & 66565.2985 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=106750&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]61[/C][C]0.1293[/C][C]0.0268[/C][C]0[/C][C]318634908.454[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0944[/C][C]-0.0876[/C][C]0.0572[/C][C]6622736958.1811[/C][C]3470685933.3175[/C][C]58912.5278[/C][/ROW]
[ROW][C]63[/C][C]0.0808[/C][C]-0.0137[/C][C]0.0427[/C][C]221287371.0513[/C][C]2387553079.2288[/C][C]48862.5939[/C][/ROW]
[ROW][C]64[/C][C]0.0566[/C][C]-0.0237[/C][C]0.038[/C][C]1348793071.4191[/C][C]2127863077.2764[/C][C]46128.7663[/C][/ROW]
[ROW][C]65[/C][C]0.0547[/C][C]-0.066[/C][C]0.0436[/C][C]11273524779.5404[/C][C]3956995417.7292[/C][C]62904.6534[/C][/ROW]
[ROW][C]66[/C][C]0.0594[/C][C]0.0153[/C][C]0.0388[/C][C]516640853.7036[/C][C]3383602990.3916[/C][C]58168.7458[/C][/ROW]
[ROW][C]67[/C][C]0.0294[/C][C]-0.0438[/C][C]0.0396[/C][C]17243331513.0512[/C][C]5363564207.9144[/C][C]73236.3585[/C][/ROW]
[ROW][C]68[/C][C]0.033[/C][C]0.0424[/C][C]0.0399[/C][C]12868945093.6691[/C][C]6301736818.6337[/C][C]79383.4795[/C][/ROW]
[ROW][C]69[/C][C]0.0653[/C][C]0.028[/C][C]0.0386[/C][C]1434478048.8215[/C][C]5760930288.6546[/C][C]75900.7924[/C][/ROW]
[ROW][C]70[/C][C]0.0635[/C][C]-0.0185[/C][C]0.0366[/C][C]666062992.7129[/C][C]5251443559.0604[/C][C]72466.8446[/C][/ROW]
[ROW][C]71[/C][C]0.0928[/C][C]-0.007[/C][C]0.0339[/C][C]44681888.8617[/C][C]4778101589.0423[/C][C]69123.8135[/C][/ROW]
[ROW][C]72[/C][C]0.1061[/C][C]0.0296[/C][C]0.0335[/C][C]612150134.983[/C][C]4430938967.8707[/C][C]66565.2985[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=106750&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=106750&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
610.12930.02680318634908.45400
620.0944-0.08760.05726622736958.18113470685933.317558912.5278
630.0808-0.01370.0427221287371.05132387553079.228848862.5939
640.0566-0.02370.0381348793071.41912127863077.276446128.7663
650.0547-0.0660.043611273524779.54043956995417.729262904.6534
660.05940.01530.0388516640853.70363383602990.391658168.7458
670.0294-0.04380.039617243331513.05125363564207.914473236.3585
680.0330.04240.039912868945093.66916301736818.633779383.4795
690.06530.0280.03861434478048.82155760930288.654675900.7924
700.0635-0.01850.0366666062992.71295251443559.060472466.8446
710.0928-0.0070.033944681888.86174778101589.042369123.8135
720.10610.02960.0335612150134.9834430938967.870766565.2985



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