Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 05:31:12 -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/07/t1197029926b94kh0wsfvvopqc.htm/, Retrieved Mon, 29 Apr 2024 01:34:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2774, Retrieved Mon, 29 Apr 2024 01:34:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact173
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [voorspellen olie] [2007-12-07 12:31:12] [e24e91da8d334fb8882bf413603fde71] [Current]
Feedback Forum

Post a new message
Dataseries X:
87
96.3
107.1
115.2
106.1
89.5
91.3
97.6
100.7
104.6
94.7
101.8
102.5
105.3
110.3
109.8
117.3
118.8
131.3
125.9
133.1
147
145.8
164.4
149.8
137.7
151.7
156.8
180
180.4
170.4
191.6
199.5
218.2
217.5
205
194
199.3
219.3
211.1
215.2
240.2
242.2
240.7
255.4
253
218.2
203.7
205.6
215.6
188.5
202.9
214
230.3
230
241
259.6
247.8
270.3
289.7




Summary of compuational 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 compuational 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=2774&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]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=2774&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2774&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 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[48])
36205-------
37194-------
38199.3-------
39219.3-------
40211.1-------
41215.2-------
42240.2-------
43242.2-------
44240.7-------
45255.4-------
46253-------
47218.2-------
48203.7-------
49205.6191.0674131.0021278.6730.37250.38870.47380.3887
50215.6213.3909146.3078311.2320.48240.5620.61110.577
51188.5221.4803151.8542323.03040.26220.54520.51680.6343
52202.9199.7886136.9817291.3930.47350.59540.40440.4667
53214190.1931130.4026277.39780.29630.38760.2870.3807
54230.3230.6261158.1248336.36960.49760.6210.42960.6911
55230260.6147178.686380.10830.30780.69050.61870.8247
56241221.3511151.7656322.84190.35220.43370.35430.6334
57259.6236.5585162.1923345.02210.33860.4680.36670.7237
58247.8225.3027154.4749328.60540.33470.25760.29960.6591
59270.3188.7548129.4165275.30010.03240.09060.25240.3675
60289.7192.724132.1379281.08920.01570.04270.40380.4038

\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 & 205 & - & - & - & - & - & - & - \tabularnewline
37 & 194 & - & - & - & - & - & - & - \tabularnewline
38 & 199.3 & - & - & - & - & - & - & - \tabularnewline
39 & 219.3 & - & - & - & - & - & - & - \tabularnewline
40 & 211.1 & - & - & - & - & - & - & - \tabularnewline
41 & 215.2 & - & - & - & - & - & - & - \tabularnewline
42 & 240.2 & - & - & - & - & - & - & - \tabularnewline
43 & 242.2 & - & - & - & - & - & - & - \tabularnewline
44 & 240.7 & - & - & - & - & - & - & - \tabularnewline
45 & 255.4 & - & - & - & - & - & - & - \tabularnewline
46 & 253 & - & - & - & - & - & - & - \tabularnewline
47 & 218.2 & - & - & - & - & - & - & - \tabularnewline
48 & 203.7 & - & - & - & - & - & - & - \tabularnewline
49 & 205.6 & 191.0674 & 131.0021 & 278.673 & 0.3725 & 0.3887 & 0.4738 & 0.3887 \tabularnewline
50 & 215.6 & 213.3909 & 146.3078 & 311.232 & 0.4824 & 0.562 & 0.6111 & 0.577 \tabularnewline
51 & 188.5 & 221.4803 & 151.8542 & 323.0304 & 0.2622 & 0.5452 & 0.5168 & 0.6343 \tabularnewline
52 & 202.9 & 199.7886 & 136.9817 & 291.393 & 0.4735 & 0.5954 & 0.4044 & 0.4667 \tabularnewline
53 & 214 & 190.1931 & 130.4026 & 277.3978 & 0.2963 & 0.3876 & 0.287 & 0.3807 \tabularnewline
54 & 230.3 & 230.6261 & 158.1248 & 336.3696 & 0.4976 & 0.621 & 0.4296 & 0.6911 \tabularnewline
55 & 230 & 260.6147 & 178.686 & 380.1083 & 0.3078 & 0.6905 & 0.6187 & 0.8247 \tabularnewline
56 & 241 & 221.3511 & 151.7656 & 322.8419 & 0.3522 & 0.4337 & 0.3543 & 0.6334 \tabularnewline
57 & 259.6 & 236.5585 & 162.1923 & 345.0221 & 0.3386 & 0.468 & 0.3667 & 0.7237 \tabularnewline
58 & 247.8 & 225.3027 & 154.4749 & 328.6054 & 0.3347 & 0.2576 & 0.2996 & 0.6591 \tabularnewline
59 & 270.3 & 188.7548 & 129.4165 & 275.3001 & 0.0324 & 0.0906 & 0.2524 & 0.3675 \tabularnewline
60 & 289.7 & 192.724 & 132.1379 & 281.0892 & 0.0157 & 0.0427 & 0.4038 & 0.4038 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2774&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]205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]199.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]219.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]211.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]215.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]240.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]242.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]240.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]255.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]253[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]218.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]203.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]205.6[/C][C]191.0674[/C][C]131.0021[/C][C]278.673[/C][C]0.3725[/C][C]0.3887[/C][C]0.4738[/C][C]0.3887[/C][/ROW]
[ROW][C]50[/C][C]215.6[/C][C]213.3909[/C][C]146.3078[/C][C]311.232[/C][C]0.4824[/C][C]0.562[/C][C]0.6111[/C][C]0.577[/C][/ROW]
[ROW][C]51[/C][C]188.5[/C][C]221.4803[/C][C]151.8542[/C][C]323.0304[/C][C]0.2622[/C][C]0.5452[/C][C]0.5168[/C][C]0.6343[/C][/ROW]
[ROW][C]52[/C][C]202.9[/C][C]199.7886[/C][C]136.9817[/C][C]291.393[/C][C]0.4735[/C][C]0.5954[/C][C]0.4044[/C][C]0.4667[/C][/ROW]
[ROW][C]53[/C][C]214[/C][C]190.1931[/C][C]130.4026[/C][C]277.3978[/C][C]0.2963[/C][C]0.3876[/C][C]0.287[/C][C]0.3807[/C][/ROW]
[ROW][C]54[/C][C]230.3[/C][C]230.6261[/C][C]158.1248[/C][C]336.3696[/C][C]0.4976[/C][C]0.621[/C][C]0.4296[/C][C]0.6911[/C][/ROW]
[ROW][C]55[/C][C]230[/C][C]260.6147[/C][C]178.686[/C][C]380.1083[/C][C]0.3078[/C][C]0.6905[/C][C]0.6187[/C][C]0.8247[/C][/ROW]
[ROW][C]56[/C][C]241[/C][C]221.3511[/C][C]151.7656[/C][C]322.8419[/C][C]0.3522[/C][C]0.4337[/C][C]0.3543[/C][C]0.6334[/C][/ROW]
[ROW][C]57[/C][C]259.6[/C][C]236.5585[/C][C]162.1923[/C][C]345.0221[/C][C]0.3386[/C][C]0.468[/C][C]0.3667[/C][C]0.7237[/C][/ROW]
[ROW][C]58[/C][C]247.8[/C][C]225.3027[/C][C]154.4749[/C][C]328.6054[/C][C]0.3347[/C][C]0.2576[/C][C]0.2996[/C][C]0.6591[/C][/ROW]
[ROW][C]59[/C][C]270.3[/C][C]188.7548[/C][C]129.4165[/C][C]275.3001[/C][C]0.0324[/C][C]0.0906[/C][C]0.2524[/C][C]0.3675[/C][/ROW]
[ROW][C]60[/C][C]289.7[/C][C]192.724[/C][C]132.1379[/C][C]281.0892[/C][C]0.0157[/C][C]0.0427[/C][C]0.4038[/C][C]0.4038[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2774&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2774&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])
36205-------
37194-------
38199.3-------
39219.3-------
40211.1-------
41215.2-------
42240.2-------
43242.2-------
44240.7-------
45255.4-------
46253-------
47218.2-------
48203.7-------
49205.6191.0674131.0021278.6730.37250.38870.47380.3887
50215.6213.3909146.3078311.2320.48240.5620.61110.577
51188.5221.4803151.8542323.03040.26220.54520.51680.6343
52202.9199.7886136.9817291.3930.47350.59540.40440.4667
53214190.1931130.4026277.39780.29630.38760.2870.3807
54230.3230.6261158.1248336.36960.49760.6210.42960.6911
55230260.6147178.686380.10830.30780.69050.61870.8247
56241221.3511151.7656322.84190.35220.43370.35430.6334
57259.6236.5585162.1923345.02210.33860.4680.36670.7237
58247.8225.3027154.4749328.60540.33470.25760.29960.6591
59270.3188.7548129.4165275.30010.03240.09060.25240.3675
60289.7192.724132.1379281.08920.01570.04270.40380.4038







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.23390.07610.0063211.196917.59974.1952
500.23390.01049e-044.88010.40670.6377
510.2339-0.14890.01241087.69990.64169.5206
520.23390.01560.00139.68070.80670.8982
530.23390.12520.0104566.768747.23076.8725
540.2339-0.00141e-040.10630.00890.0941
550.2339-0.11750.0098937.262478.10528.8377
560.23390.08880.0074386.08132.17345.6722
570.23390.09740.0081530.908744.24246.6515
580.23390.09990.0083506.130442.17756.4944
590.23390.4320.0366649.6155554.134623.5401
600.23390.50320.04199404.3447783.695427.9946

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.2339 & 0.0761 & 0.0063 & 211.1969 & 17.5997 & 4.1952 \tabularnewline
50 & 0.2339 & 0.0104 & 9e-04 & 4.8801 & 0.4067 & 0.6377 \tabularnewline
51 & 0.2339 & -0.1489 & 0.0124 & 1087.699 & 90.6416 & 9.5206 \tabularnewline
52 & 0.2339 & 0.0156 & 0.0013 & 9.6807 & 0.8067 & 0.8982 \tabularnewline
53 & 0.2339 & 0.1252 & 0.0104 & 566.7687 & 47.2307 & 6.8725 \tabularnewline
54 & 0.2339 & -0.0014 & 1e-04 & 0.1063 & 0.0089 & 0.0941 \tabularnewline
55 & 0.2339 & -0.1175 & 0.0098 & 937.2624 & 78.1052 & 8.8377 \tabularnewline
56 & 0.2339 & 0.0888 & 0.0074 & 386.081 & 32.1734 & 5.6722 \tabularnewline
57 & 0.2339 & 0.0974 & 0.0081 & 530.9087 & 44.2424 & 6.6515 \tabularnewline
58 & 0.2339 & 0.0999 & 0.0083 & 506.1304 & 42.1775 & 6.4944 \tabularnewline
59 & 0.2339 & 0.432 & 0.036 & 6649.6155 & 554.1346 & 23.5401 \tabularnewline
60 & 0.2339 & 0.5032 & 0.0419 & 9404.3447 & 783.6954 & 27.9946 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2774&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.2339[/C][C]0.0761[/C][C]0.0063[/C][C]211.1969[/C][C]17.5997[/C][C]4.1952[/C][/ROW]
[ROW][C]50[/C][C]0.2339[/C][C]0.0104[/C][C]9e-04[/C][C]4.8801[/C][C]0.4067[/C][C]0.6377[/C][/ROW]
[ROW][C]51[/C][C]0.2339[/C][C]-0.1489[/C][C]0.0124[/C][C]1087.699[/C][C]90.6416[/C][C]9.5206[/C][/ROW]
[ROW][C]52[/C][C]0.2339[/C][C]0.0156[/C][C]0.0013[/C][C]9.6807[/C][C]0.8067[/C][C]0.8982[/C][/ROW]
[ROW][C]53[/C][C]0.2339[/C][C]0.1252[/C][C]0.0104[/C][C]566.7687[/C][C]47.2307[/C][C]6.8725[/C][/ROW]
[ROW][C]54[/C][C]0.2339[/C][C]-0.0014[/C][C]1e-04[/C][C]0.1063[/C][C]0.0089[/C][C]0.0941[/C][/ROW]
[ROW][C]55[/C][C]0.2339[/C][C]-0.1175[/C][C]0.0098[/C][C]937.2624[/C][C]78.1052[/C][C]8.8377[/C][/ROW]
[ROW][C]56[/C][C]0.2339[/C][C]0.0888[/C][C]0.0074[/C][C]386.081[/C][C]32.1734[/C][C]5.6722[/C][/ROW]
[ROW][C]57[/C][C]0.2339[/C][C]0.0974[/C][C]0.0081[/C][C]530.9087[/C][C]44.2424[/C][C]6.6515[/C][/ROW]
[ROW][C]58[/C][C]0.2339[/C][C]0.0999[/C][C]0.0083[/C][C]506.1304[/C][C]42.1775[/C][C]6.4944[/C][/ROW]
[ROW][C]59[/C][C]0.2339[/C][C]0.432[/C][C]0.036[/C][C]6649.6155[/C][C]554.1346[/C][C]23.5401[/C][/ROW]
[ROW][C]60[/C][C]0.2339[/C][C]0.5032[/C][C]0.0419[/C][C]9404.3447[/C][C]783.6954[/C][C]27.9946[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2774&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2774&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.23390.07610.0063211.196917.59974.1952
500.23390.01049e-044.88010.40670.6377
510.2339-0.14890.01241087.69990.64169.5206
520.23390.01560.00139.68070.80670.8982
530.23390.12520.0104566.768747.23076.8725
540.2339-0.00141e-040.10630.00890.0941
550.2339-0.11750.0098937.262478.10528.8377
560.23390.08880.0074386.08132.17345.6722
570.23390.09740.0081530.908744.24246.6515
580.23390.09990.0083506.130442.17756.4944
590.23390.4320.0366649.6155554.134623.5401
600.23390.50320.04199404.3447783.695427.9946



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