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 computationFri, 21 Dec 2012 04:27:49 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Dec/21/t1356082098lwlbvzxqiarwkgu.htm/, Retrieved Fri, 29 Mar 2024 14:19:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=203372, Retrieved Fri, 29 Mar 2024 14:19:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2012-12-21 09:27:49] [195a7509fef65339447329cdcf8835cc] [Current]
Feedback Forum

Post a new message
Dataseries X:
59.8
60.7
59.7
60.2
61.3
59.8
61.2
59.3
59.4
63.1
68
69.4
70.2
72.6
72.1
69.7
71.5
75.7
76
76.4
83.8
86.2
88.5
95.9
103.1
113.5
115.7
113.1
112.7
121.9
120.3
108.7
102.8
83.4
79.4
77.8
85.7
83.2
82
86.9
95.7
97.9
89.3
91.5
86.8
91
93.8
96.8
95.7
91.4
88.7
88.2
87.7
89.5
95.6
100.5
106.3
112
117.7
125
132.4
138.1
134.7
136.7
134.3
131.6
129.8
131.9
129.8
119.4
116.7
112.8




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.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 & 3 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203372&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]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203372&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203372&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'Sir Ronald Aylmer Fisher' @ fisher.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[60])
4896.8-------
4995.7-------
5091.4-------
5188.7-------
5288.2-------
5387.7-------
5489.5-------
5595.6-------
56100.5-------
57106.3-------
58112-------
59117.7-------
60125-------
61132.4126.9165117.4756136.35740.12750.654610.6546
62138.1126.9165111.2385142.59450.0810.246510.5947
63134.7126.9165106.8549146.97810.22350.13730.99990.5743
64136.7126.9165103.2705150.56260.20870.25940.99930.5631
65134.3126.9165100.162153.6710.29430.23680.9980.5558
66131.6126.916597.3789156.45420.3780.31210.99350.5506
67129.8126.916594.8363158.99670.43010.38740.97210.5466
68131.9126.916592.4809161.35210.38830.43480.93370.5434
69129.8126.916590.2767163.55640.43870.39490.8650.5408
70119.4126.916588.1977165.63530.35180.4420.77490.5386
71116.7126.916586.2248167.60820.31130.64130.67150.5368
72112.8126.916584.3433169.48980.25790.68090.53520.5352

\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 & 96.8 & - & - & - & - & - & - & - \tabularnewline
49 & 95.7 & - & - & - & - & - & - & - \tabularnewline
50 & 91.4 & - & - & - & - & - & - & - \tabularnewline
51 & 88.7 & - & - & - & - & - & - & - \tabularnewline
52 & 88.2 & - & - & - & - & - & - & - \tabularnewline
53 & 87.7 & - & - & - & - & - & - & - \tabularnewline
54 & 89.5 & - & - & - & - & - & - & - \tabularnewline
55 & 95.6 & - & - & - & - & - & - & - \tabularnewline
56 & 100.5 & - & - & - & - & - & - & - \tabularnewline
57 & 106.3 & - & - & - & - & - & - & - \tabularnewline
58 & 112 & - & - & - & - & - & - & - \tabularnewline
59 & 117.7 & - & - & - & - & - & - & - \tabularnewline
60 & 125 & - & - & - & - & - & - & - \tabularnewline
61 & 132.4 & 126.9165 & 117.4756 & 136.3574 & 0.1275 & 0.6546 & 1 & 0.6546 \tabularnewline
62 & 138.1 & 126.9165 & 111.2385 & 142.5945 & 0.081 & 0.2465 & 1 & 0.5947 \tabularnewline
63 & 134.7 & 126.9165 & 106.8549 & 146.9781 & 0.2235 & 0.1373 & 0.9999 & 0.5743 \tabularnewline
64 & 136.7 & 126.9165 & 103.2705 & 150.5626 & 0.2087 & 0.2594 & 0.9993 & 0.5631 \tabularnewline
65 & 134.3 & 126.9165 & 100.162 & 153.671 & 0.2943 & 0.2368 & 0.998 & 0.5558 \tabularnewline
66 & 131.6 & 126.9165 & 97.3789 & 156.4542 & 0.378 & 0.3121 & 0.9935 & 0.5506 \tabularnewline
67 & 129.8 & 126.9165 & 94.8363 & 158.9967 & 0.4301 & 0.3874 & 0.9721 & 0.5466 \tabularnewline
68 & 131.9 & 126.9165 & 92.4809 & 161.3521 & 0.3883 & 0.4348 & 0.9337 & 0.5434 \tabularnewline
69 & 129.8 & 126.9165 & 90.2767 & 163.5564 & 0.4387 & 0.3949 & 0.865 & 0.5408 \tabularnewline
70 & 119.4 & 126.9165 & 88.1977 & 165.6353 & 0.3518 & 0.442 & 0.7749 & 0.5386 \tabularnewline
71 & 116.7 & 126.9165 & 86.2248 & 167.6082 & 0.3113 & 0.6413 & 0.6715 & 0.5368 \tabularnewline
72 & 112.8 & 126.9165 & 84.3433 & 169.4898 & 0.2579 & 0.6809 & 0.5352 & 0.5352 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203372&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]96.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]95.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]91.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]88.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]88.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]87.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]89.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]95.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]100.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]106.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]117.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]125[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]132.4[/C][C]126.9165[/C][C]117.4756[/C][C]136.3574[/C][C]0.1275[/C][C]0.6546[/C][C]1[/C][C]0.6546[/C][/ROW]
[ROW][C]62[/C][C]138.1[/C][C]126.9165[/C][C]111.2385[/C][C]142.5945[/C][C]0.081[/C][C]0.2465[/C][C]1[/C][C]0.5947[/C][/ROW]
[ROW][C]63[/C][C]134.7[/C][C]126.9165[/C][C]106.8549[/C][C]146.9781[/C][C]0.2235[/C][C]0.1373[/C][C]0.9999[/C][C]0.5743[/C][/ROW]
[ROW][C]64[/C][C]136.7[/C][C]126.9165[/C][C]103.2705[/C][C]150.5626[/C][C]0.2087[/C][C]0.2594[/C][C]0.9993[/C][C]0.5631[/C][/ROW]
[ROW][C]65[/C][C]134.3[/C][C]126.9165[/C][C]100.162[/C][C]153.671[/C][C]0.2943[/C][C]0.2368[/C][C]0.998[/C][C]0.5558[/C][/ROW]
[ROW][C]66[/C][C]131.6[/C][C]126.9165[/C][C]97.3789[/C][C]156.4542[/C][C]0.378[/C][C]0.3121[/C][C]0.9935[/C][C]0.5506[/C][/ROW]
[ROW][C]67[/C][C]129.8[/C][C]126.9165[/C][C]94.8363[/C][C]158.9967[/C][C]0.4301[/C][C]0.3874[/C][C]0.9721[/C][C]0.5466[/C][/ROW]
[ROW][C]68[/C][C]131.9[/C][C]126.9165[/C][C]92.4809[/C][C]161.3521[/C][C]0.3883[/C][C]0.4348[/C][C]0.9337[/C][C]0.5434[/C][/ROW]
[ROW][C]69[/C][C]129.8[/C][C]126.9165[/C][C]90.2767[/C][C]163.5564[/C][C]0.4387[/C][C]0.3949[/C][C]0.865[/C][C]0.5408[/C][/ROW]
[ROW][C]70[/C][C]119.4[/C][C]126.9165[/C][C]88.1977[/C][C]165.6353[/C][C]0.3518[/C][C]0.442[/C][C]0.7749[/C][C]0.5386[/C][/ROW]
[ROW][C]71[/C][C]116.7[/C][C]126.9165[/C][C]86.2248[/C][C]167.6082[/C][C]0.3113[/C][C]0.6413[/C][C]0.6715[/C][C]0.5368[/C][/ROW]
[ROW][C]72[/C][C]112.8[/C][C]126.9165[/C][C]84.3433[/C][C]169.4898[/C][C]0.2579[/C][C]0.6809[/C][C]0.5352[/C][C]0.5352[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203372&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203372&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])
4896.8-------
4995.7-------
5091.4-------
5188.7-------
5288.2-------
5387.7-------
5489.5-------
5595.6-------
56100.5-------
57106.3-------
58112-------
59117.7-------
60125-------
61132.4126.9165117.4756136.35740.12750.654610.6546
62138.1126.9165111.2385142.59450.0810.246510.5947
63134.7126.9165106.8549146.97810.22350.13730.99990.5743
64136.7126.9165103.2705150.56260.20870.25940.99930.5631
65134.3126.9165100.162153.6710.29430.23680.9980.5558
66131.6126.916597.3789156.45420.3780.31210.99350.5506
67129.8126.916594.8363158.99670.43010.38740.97210.5466
68131.9126.916592.4809161.35210.38830.43480.93370.5434
69129.8126.916590.2767163.55640.43870.39490.8650.5408
70119.4126.916588.1977165.63530.35180.4420.77490.5386
71116.7126.916586.2248167.60820.31130.64130.67150.5368
72112.8126.916584.3433169.48980.25790.68090.53520.5352







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0380.0432030.068500
620.0630.08810.0657125.070177.56938.8073
630.08060.06130.064260.582571.90718.4798
640.09510.07710.067495.716477.85948.8238
650.10760.05820.065654.515773.19078.5552
660.11870.03690.060821.93564.6488.0404
670.1290.02270.05548.314456.60047.5233
680.13840.03930.053324.83552.62977.2546
690.14730.02270.04998.314447.70586.9069
700.1556-0.05920.050956.498148.5856.9703
710.1636-0.08050.0536104.377453.65717.3251
720.1711-0.11120.0584199.276265.7928.1112

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.038 & 0.0432 & 0 & 30.0685 & 0 & 0 \tabularnewline
62 & 0.063 & 0.0881 & 0.0657 & 125.0701 & 77.5693 & 8.8073 \tabularnewline
63 & 0.0806 & 0.0613 & 0.0642 & 60.5825 & 71.9071 & 8.4798 \tabularnewline
64 & 0.0951 & 0.0771 & 0.0674 & 95.7164 & 77.8594 & 8.8238 \tabularnewline
65 & 0.1076 & 0.0582 & 0.0656 & 54.5157 & 73.1907 & 8.5552 \tabularnewline
66 & 0.1187 & 0.0369 & 0.0608 & 21.935 & 64.648 & 8.0404 \tabularnewline
67 & 0.129 & 0.0227 & 0.0554 & 8.3144 & 56.6004 & 7.5233 \tabularnewline
68 & 0.1384 & 0.0393 & 0.0533 & 24.835 & 52.6297 & 7.2546 \tabularnewline
69 & 0.1473 & 0.0227 & 0.0499 & 8.3144 & 47.7058 & 6.9069 \tabularnewline
70 & 0.1556 & -0.0592 & 0.0509 & 56.4981 & 48.585 & 6.9703 \tabularnewline
71 & 0.1636 & -0.0805 & 0.0536 & 104.3774 & 53.6571 & 7.3251 \tabularnewline
72 & 0.1711 & -0.1112 & 0.0584 & 199.2762 & 65.792 & 8.1112 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203372&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.038[/C][C]0.0432[/C][C]0[/C][C]30.0685[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.063[/C][C]0.0881[/C][C]0.0657[/C][C]125.0701[/C][C]77.5693[/C][C]8.8073[/C][/ROW]
[ROW][C]63[/C][C]0.0806[/C][C]0.0613[/C][C]0.0642[/C][C]60.5825[/C][C]71.9071[/C][C]8.4798[/C][/ROW]
[ROW][C]64[/C][C]0.0951[/C][C]0.0771[/C][C]0.0674[/C][C]95.7164[/C][C]77.8594[/C][C]8.8238[/C][/ROW]
[ROW][C]65[/C][C]0.1076[/C][C]0.0582[/C][C]0.0656[/C][C]54.5157[/C][C]73.1907[/C][C]8.5552[/C][/ROW]
[ROW][C]66[/C][C]0.1187[/C][C]0.0369[/C][C]0.0608[/C][C]21.935[/C][C]64.648[/C][C]8.0404[/C][/ROW]
[ROW][C]67[/C][C]0.129[/C][C]0.0227[/C][C]0.0554[/C][C]8.3144[/C][C]56.6004[/C][C]7.5233[/C][/ROW]
[ROW][C]68[/C][C]0.1384[/C][C]0.0393[/C][C]0.0533[/C][C]24.835[/C][C]52.6297[/C][C]7.2546[/C][/ROW]
[ROW][C]69[/C][C]0.1473[/C][C]0.0227[/C][C]0.0499[/C][C]8.3144[/C][C]47.7058[/C][C]6.9069[/C][/ROW]
[ROW][C]70[/C][C]0.1556[/C][C]-0.0592[/C][C]0.0509[/C][C]56.4981[/C][C]48.585[/C][C]6.9703[/C][/ROW]
[ROW][C]71[/C][C]0.1636[/C][C]-0.0805[/C][C]0.0536[/C][C]104.3774[/C][C]53.6571[/C][C]7.3251[/C][/ROW]
[ROW][C]72[/C][C]0.1711[/C][C]-0.1112[/C][C]0.0584[/C][C]199.2762[/C][C]65.792[/C][C]8.1112[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203372&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203372&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.0380.0432030.068500
620.0630.08810.0657125.070177.56938.8073
630.08060.06130.064260.582571.90718.4798
640.09510.07710.067495.716477.85948.8238
650.10760.05820.065654.515773.19078.5552
660.11870.03690.060821.93564.6488.0404
670.1290.02270.05548.314456.60047.5233
680.13840.03930.053324.83552.62977.2546
690.14730.02270.04998.314447.70586.9069
700.1556-0.05920.050956.498148.5856.9703
710.1636-0.08050.0536104.377453.65717.3251
720.1711-0.11120.0584199.276265.7928.1112



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