Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 11:03:56 -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/30/t1262196273ell924118mo9kxw.htm/, Retrieved Mon, 29 Apr 2024 07:07:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71342, Retrieved Mon, 29 Apr 2024 07:07:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact105
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecasting...] [2009-12-30 18:03:56] [dbd46bd47d5f87b1007a5a1708bef00e] [Current]
Feedback Forum

Post a new message
Dataseries X:
32,68
31,54
32,43
26,54
25,85
27,6
25,71
25,38
28,57
27,64
25,36
25,9
26,29
21,74
19,2
19,32
19,82
20,36
24,31
25,97
25,61
24,67
25,59
26,09
28,37
27,34
24,46
27,46
30,23
32,33
29,87
24,87
25,48
27,28
28,24
29,58
26,95
29,08
28,76
29,59
30,7
30,52
32,67
33,19
37,13
35,54
37,75
41,84
42,94
49,14
44,61
40,22
44,23
45,85
53,38
53,26
51,8
55,3
57,81
63,96
63,77
59,15
56,12
57,42
63,52
61,71
63,01
68,18
72,03
69,75
74,41
74,33
64,24
60,03
59,44
62,5
55,04
58,34
61,92
67,65
67,68
70,3
75,26
71,44
76,36
81,71
92,6
90,6
92,23
94,09
102,79
109,65
124,05
132,69
135,81
116,07
101,42
75,73
55,48
43,80
45,29
44,01
47,48
51,07
57,84
69,04
65,61
72,87
68,41
73,25
77,43




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=71342&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=71342&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71342&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[99])
8792.6-------
8890.6-------
8992.23-------
9094.09-------
91102.79-------
92109.65-------
93124.05-------
94132.69-------
95135.81-------
96116.07-------
97101.42-------
9875.73-------
9955.48-------
10043.841.920232.6651.18030.34540.002100.0021
10145.2935.586518.539252.63390.13230.172500.0111
10244.0132.25917.135457.38280.17960.154700.035
10347.4831.1459-0.858563.15040.15860.215400.0681
10451.0730.5855-7.625168.79610.14670.193100.1008
10557.8430.5126-13.102374.12760.10970.177800.1309
10669.0430.4463-18.06878.96060.05950.134200.1559
10765.6130.4786-22.469183.42620.09670.076700.1774
10872.8730.4713-26.583987.52650.07260.11370.00160.1951
10968.4130.4892-30.386591.36490.11110.08620.01120.2105
11073.2530.4861-33.98994.96130.09680.12450.08450.2237
11177.4330.4926-37.387298.37230.08770.10850.23530.2353

\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[99]) \tabularnewline
87 & 92.6 & - & - & - & - & - & - & - \tabularnewline
88 & 90.6 & - & - & - & - & - & - & - \tabularnewline
89 & 92.23 & - & - & - & - & - & - & - \tabularnewline
90 & 94.09 & - & - & - & - & - & - & - \tabularnewline
91 & 102.79 & - & - & - & - & - & - & - \tabularnewline
92 & 109.65 & - & - & - & - & - & - & - \tabularnewline
93 & 124.05 & - & - & - & - & - & - & - \tabularnewline
94 & 132.69 & - & - & - & - & - & - & - \tabularnewline
95 & 135.81 & - & - & - & - & - & - & - \tabularnewline
96 & 116.07 & - & - & - & - & - & - & - \tabularnewline
97 & 101.42 & - & - & - & - & - & - & - \tabularnewline
98 & 75.73 & - & - & - & - & - & - & - \tabularnewline
99 & 55.48 & - & - & - & - & - & - & - \tabularnewline
100 & 43.8 & 41.9202 & 32.66 & 51.1803 & 0.3454 & 0.0021 & 0 & 0.0021 \tabularnewline
101 & 45.29 & 35.5865 & 18.5392 & 52.6339 & 0.1323 & 0.1725 & 0 & 0.0111 \tabularnewline
102 & 44.01 & 32.2591 & 7.1354 & 57.3828 & 0.1796 & 0.1547 & 0 & 0.035 \tabularnewline
103 & 47.48 & 31.1459 & -0.8585 & 63.1504 & 0.1586 & 0.2154 & 0 & 0.0681 \tabularnewline
104 & 51.07 & 30.5855 & -7.6251 & 68.7961 & 0.1467 & 0.1931 & 0 & 0.1008 \tabularnewline
105 & 57.84 & 30.5126 & -13.1023 & 74.1276 & 0.1097 & 0.1778 & 0 & 0.1309 \tabularnewline
106 & 69.04 & 30.4463 & -18.068 & 78.9606 & 0.0595 & 0.1342 & 0 & 0.1559 \tabularnewline
107 & 65.61 & 30.4786 & -22.4691 & 83.4262 & 0.0967 & 0.0767 & 0 & 0.1774 \tabularnewline
108 & 72.87 & 30.4713 & -26.5839 & 87.5265 & 0.0726 & 0.1137 & 0.0016 & 0.1951 \tabularnewline
109 & 68.41 & 30.4892 & -30.3865 & 91.3649 & 0.1111 & 0.0862 & 0.0112 & 0.2105 \tabularnewline
110 & 73.25 & 30.4861 & -33.989 & 94.9613 & 0.0968 & 0.1245 & 0.0845 & 0.2237 \tabularnewline
111 & 77.43 & 30.4926 & -37.3872 & 98.3723 & 0.0877 & 0.1085 & 0.2353 & 0.2353 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71342&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[99])[/C][/ROW]
[ROW][C]87[/C][C]92.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]90.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]92.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]94.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]102.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]109.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]124.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]132.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]135.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]116.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]101.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]75.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]55.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]43.8[/C][C]41.9202[/C][C]32.66[/C][C]51.1803[/C][C]0.3454[/C][C]0.0021[/C][C]0[/C][C]0.0021[/C][/ROW]
[ROW][C]101[/C][C]45.29[/C][C]35.5865[/C][C]18.5392[/C][C]52.6339[/C][C]0.1323[/C][C]0.1725[/C][C]0[/C][C]0.0111[/C][/ROW]
[ROW][C]102[/C][C]44.01[/C][C]32.2591[/C][C]7.1354[/C][C]57.3828[/C][C]0.1796[/C][C]0.1547[/C][C]0[/C][C]0.035[/C][/ROW]
[ROW][C]103[/C][C]47.48[/C][C]31.1459[/C][C]-0.8585[/C][C]63.1504[/C][C]0.1586[/C][C]0.2154[/C][C]0[/C][C]0.0681[/C][/ROW]
[ROW][C]104[/C][C]51.07[/C][C]30.5855[/C][C]-7.6251[/C][C]68.7961[/C][C]0.1467[/C][C]0.1931[/C][C]0[/C][C]0.1008[/C][/ROW]
[ROW][C]105[/C][C]57.84[/C][C]30.5126[/C][C]-13.1023[/C][C]74.1276[/C][C]0.1097[/C][C]0.1778[/C][C]0[/C][C]0.1309[/C][/ROW]
[ROW][C]106[/C][C]69.04[/C][C]30.4463[/C][C]-18.068[/C][C]78.9606[/C][C]0.0595[/C][C]0.1342[/C][C]0[/C][C]0.1559[/C][/ROW]
[ROW][C]107[/C][C]65.61[/C][C]30.4786[/C][C]-22.4691[/C][C]83.4262[/C][C]0.0967[/C][C]0.0767[/C][C]0[/C][C]0.1774[/C][/ROW]
[ROW][C]108[/C][C]72.87[/C][C]30.4713[/C][C]-26.5839[/C][C]87.5265[/C][C]0.0726[/C][C]0.1137[/C][C]0.0016[/C][C]0.1951[/C][/ROW]
[ROW][C]109[/C][C]68.41[/C][C]30.4892[/C][C]-30.3865[/C][C]91.3649[/C][C]0.1111[/C][C]0.0862[/C][C]0.0112[/C][C]0.2105[/C][/ROW]
[ROW][C]110[/C][C]73.25[/C][C]30.4861[/C][C]-33.989[/C][C]94.9613[/C][C]0.0968[/C][C]0.1245[/C][C]0.0845[/C][C]0.2237[/C][/ROW]
[ROW][C]111[/C][C]77.43[/C][C]30.4926[/C][C]-37.3872[/C][C]98.3723[/C][C]0.0877[/C][C]0.1085[/C][C]0.2353[/C][C]0.2353[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71342&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71342&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[99])
8792.6-------
8890.6-------
8992.23-------
9094.09-------
91102.79-------
92109.65-------
93124.05-------
94132.69-------
95135.81-------
96116.07-------
97101.42-------
9875.73-------
9955.48-------
10043.841.920232.6651.18030.34540.002100.0021
10145.2935.586518.539252.63390.13230.172500.0111
10244.0132.25917.135457.38280.17960.154700.035
10347.4831.1459-0.858563.15040.15860.215400.0681
10451.0730.5855-7.625168.79610.14670.193100.1008
10557.8430.5126-13.102374.12760.10970.177800.1309
10669.0430.4463-18.06878.96060.05950.134200.1559
10765.6130.4786-22.469183.42620.09670.076700.1774
10872.8730.4713-26.583987.52650.07260.11370.00160.1951
10968.4130.4892-30.386591.36490.11110.08620.01120.2105
11073.2530.4861-33.98994.96130.09680.12450.08450.2237
11177.4330.4926-37.387298.37230.08770.10850.23530.2353







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1000.11270.044803.533800
1010.24440.27270.158894.15748.84546.989
1020.39740.36430.2273138.083678.59158.8652
1030.52430.52440.3016266.8017125.64411.2091
1040.63740.66970.3752419.6139184.43813.5808
1050.72930.89560.4619746.7853278.162616.6782
1060.8131.26760.5771489.4754451.207321.2416
1070.88631.15270.6491234.2178549.083623.4325
1080.95531.39140.73151797.6511687.813326.2262
1091.01871.24370.78271437.9878762.830727.6194
1101.0791.40270.83911828.7475859.732329.3212
1111.13581.53930.89742203.1219971.681431.1718

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
100 & 0.1127 & 0.0448 & 0 & 3.5338 & 0 & 0 \tabularnewline
101 & 0.2444 & 0.2727 & 0.1588 & 94.157 & 48.8454 & 6.989 \tabularnewline
102 & 0.3974 & 0.3643 & 0.2273 & 138.0836 & 78.5915 & 8.8652 \tabularnewline
103 & 0.5243 & 0.5244 & 0.3016 & 266.8017 & 125.644 & 11.2091 \tabularnewline
104 & 0.6374 & 0.6697 & 0.3752 & 419.6139 & 184.438 & 13.5808 \tabularnewline
105 & 0.7293 & 0.8956 & 0.4619 & 746.7853 & 278.1626 & 16.6782 \tabularnewline
106 & 0.813 & 1.2676 & 0.577 & 1489.4754 & 451.2073 & 21.2416 \tabularnewline
107 & 0.8863 & 1.1527 & 0.649 & 1234.2178 & 549.0836 & 23.4325 \tabularnewline
108 & 0.9553 & 1.3914 & 0.7315 & 1797.6511 & 687.8133 & 26.2262 \tabularnewline
109 & 1.0187 & 1.2437 & 0.7827 & 1437.9878 & 762.8307 & 27.6194 \tabularnewline
110 & 1.079 & 1.4027 & 0.8391 & 1828.7475 & 859.7323 & 29.3212 \tabularnewline
111 & 1.1358 & 1.5393 & 0.8974 & 2203.1219 & 971.6814 & 31.1718 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71342&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]100[/C][C]0.1127[/C][C]0.0448[/C][C]0[/C][C]3.5338[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]101[/C][C]0.2444[/C][C]0.2727[/C][C]0.1588[/C][C]94.157[/C][C]48.8454[/C][C]6.989[/C][/ROW]
[ROW][C]102[/C][C]0.3974[/C][C]0.3643[/C][C]0.2273[/C][C]138.0836[/C][C]78.5915[/C][C]8.8652[/C][/ROW]
[ROW][C]103[/C][C]0.5243[/C][C]0.5244[/C][C]0.3016[/C][C]266.8017[/C][C]125.644[/C][C]11.2091[/C][/ROW]
[ROW][C]104[/C][C]0.6374[/C][C]0.6697[/C][C]0.3752[/C][C]419.6139[/C][C]184.438[/C][C]13.5808[/C][/ROW]
[ROW][C]105[/C][C]0.7293[/C][C]0.8956[/C][C]0.4619[/C][C]746.7853[/C][C]278.1626[/C][C]16.6782[/C][/ROW]
[ROW][C]106[/C][C]0.813[/C][C]1.2676[/C][C]0.577[/C][C]1489.4754[/C][C]451.2073[/C][C]21.2416[/C][/ROW]
[ROW][C]107[/C][C]0.8863[/C][C]1.1527[/C][C]0.649[/C][C]1234.2178[/C][C]549.0836[/C][C]23.4325[/C][/ROW]
[ROW][C]108[/C][C]0.9553[/C][C]1.3914[/C][C]0.7315[/C][C]1797.6511[/C][C]687.8133[/C][C]26.2262[/C][/ROW]
[ROW][C]109[/C][C]1.0187[/C][C]1.2437[/C][C]0.7827[/C][C]1437.9878[/C][C]762.8307[/C][C]27.6194[/C][/ROW]
[ROW][C]110[/C][C]1.079[/C][C]1.4027[/C][C]0.8391[/C][C]1828.7475[/C][C]859.7323[/C][C]29.3212[/C][/ROW]
[ROW][C]111[/C][C]1.1358[/C][C]1.5393[/C][C]0.8974[/C][C]2203.1219[/C][C]971.6814[/C][C]31.1718[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71342&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71342&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
1000.11270.044803.533800
1010.24440.27270.158894.15748.84546.989
1020.39740.36430.2273138.083678.59158.8652
1030.52430.52440.3016266.8017125.64411.2091
1040.63740.66970.3752419.6139184.43813.5808
1050.72930.89560.4619746.7853278.162616.6782
1060.8131.26760.5771489.4754451.207321.2416
1070.88631.15270.6491234.2178549.083623.4325
1080.95531.39140.73151797.6511687.813326.2262
1091.01871.24370.78271437.9878762.830727.6194
1101.0791.40270.83911828.7475859.732329.3212
1111.13581.53930.89742203.1219971.681431.1718



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