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 computationWed, 22 Dec 2010 16:14:39 +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/22/t1293034407rc1xcg0yxa6f36c.htm/, Retrieved Mon, 06 May 2024 03:22:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114352, Retrieved Mon, 06 May 2024 03:22:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact162
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [] [2010-12-07 15:02:49] [dd4fe494cff2ee46c12b15bdc7b848ca]
-             [ARIMA Forecasting] [] [2010-12-07 15:19:10] [dd4fe494cff2ee46c12b15bdc7b848ca]
-   PD            [ARIMA Forecasting] [] [2010-12-22 16:14:39] [6c31f786e793d35ef3a03978bc5de774] [Current]
Feedback Forum

Post a new message
Dataseries X:
320
324
343
295
301
367
196
182
342
361
333
330
345
323
365
323
316
358
235
169
430
409
407
341
326
374
364
349
300
385
304
196
443
414
325
388
356
386
444
387
327
448
225
182
460
411
342
361
377
331
428
340
352
461
221
198
422
329
320
375
364
351
380
319
322
386
221
187
343
342
365
313
356
337
389
326
343
357
220
218
391
425
332
298
360
336
325
393
301
426
265
210
429
440
357
431
442
422
544
420
396
482
261
211
448
468
464
425




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114352&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[96])
84298-------
85360-------
86336-------
87325-------
88393-------
89301-------
90426-------
91265-------
92210-------
93429-------
94440-------
95357-------
96431-------
97442381.2712320.4172442.12510.02520.05460.75340.0546
98422370.2816309.2164431.34670.04850.01070.86440.0257
99544423.9163360.854486.97861e-040.52370.99890.4129
100420354.9797286.721423.23850.03100.13750.0145
101396340.8945272.5884409.20060.05690.01160.87380.0049
102482418.2759348.5889487.96290.03650.73450.4140.3602
103261243.6597173.2173314.10210.314700.27630
104211205.1849134.6772275.69270.43580.06040.44680
105448415.5782344.5624486.5940.185410.35550.3352
106468395.2896324.206466.37310.02250.07310.10880.1624
107464353.1638282.0352424.29250.00118e-040.45790.016
108425356.5675285.3052427.82970.02990.00160.02030.0203

\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[96]) \tabularnewline
84 & 298 & - & - & - & - & - & - & - \tabularnewline
85 & 360 & - & - & - & - & - & - & - \tabularnewline
86 & 336 & - & - & - & - & - & - & - \tabularnewline
87 & 325 & - & - & - & - & - & - & - \tabularnewline
88 & 393 & - & - & - & - & - & - & - \tabularnewline
89 & 301 & - & - & - & - & - & - & - \tabularnewline
90 & 426 & - & - & - & - & - & - & - \tabularnewline
91 & 265 & - & - & - & - & - & - & - \tabularnewline
92 & 210 & - & - & - & - & - & - & - \tabularnewline
93 & 429 & - & - & - & - & - & - & - \tabularnewline
94 & 440 & - & - & - & - & - & - & - \tabularnewline
95 & 357 & - & - & - & - & - & - & - \tabularnewline
96 & 431 & - & - & - & - & - & - & - \tabularnewline
97 & 442 & 381.2712 & 320.4172 & 442.1251 & 0.0252 & 0.0546 & 0.7534 & 0.0546 \tabularnewline
98 & 422 & 370.2816 & 309.2164 & 431.3467 & 0.0485 & 0.0107 & 0.8644 & 0.0257 \tabularnewline
99 & 544 & 423.9163 & 360.854 & 486.9786 & 1e-04 & 0.5237 & 0.9989 & 0.4129 \tabularnewline
100 & 420 & 354.9797 & 286.721 & 423.2385 & 0.031 & 0 & 0.1375 & 0.0145 \tabularnewline
101 & 396 & 340.8945 & 272.5884 & 409.2006 & 0.0569 & 0.0116 & 0.8738 & 0.0049 \tabularnewline
102 & 482 & 418.2759 & 348.5889 & 487.9629 & 0.0365 & 0.7345 & 0.414 & 0.3602 \tabularnewline
103 & 261 & 243.6597 & 173.2173 & 314.1021 & 0.3147 & 0 & 0.2763 & 0 \tabularnewline
104 & 211 & 205.1849 & 134.6772 & 275.6927 & 0.4358 & 0.0604 & 0.4468 & 0 \tabularnewline
105 & 448 & 415.5782 & 344.5624 & 486.594 & 0.1854 & 1 & 0.3555 & 0.3352 \tabularnewline
106 & 468 & 395.2896 & 324.206 & 466.3731 & 0.0225 & 0.0731 & 0.1088 & 0.1624 \tabularnewline
107 & 464 & 353.1638 & 282.0352 & 424.2925 & 0.0011 & 8e-04 & 0.4579 & 0.016 \tabularnewline
108 & 425 & 356.5675 & 285.3052 & 427.8297 & 0.0299 & 0.0016 & 0.0203 & 0.0203 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114352&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[96])[/C][/ROW]
[ROW][C]84[/C][C]298[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]336[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]325[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]393[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]301[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]426[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]265[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]210[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]429[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]431[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]442[/C][C]381.2712[/C][C]320.4172[/C][C]442.1251[/C][C]0.0252[/C][C]0.0546[/C][C]0.7534[/C][C]0.0546[/C][/ROW]
[ROW][C]98[/C][C]422[/C][C]370.2816[/C][C]309.2164[/C][C]431.3467[/C][C]0.0485[/C][C]0.0107[/C][C]0.8644[/C][C]0.0257[/C][/ROW]
[ROW][C]99[/C][C]544[/C][C]423.9163[/C][C]360.854[/C][C]486.9786[/C][C]1e-04[/C][C]0.5237[/C][C]0.9989[/C][C]0.4129[/C][/ROW]
[ROW][C]100[/C][C]420[/C][C]354.9797[/C][C]286.721[/C][C]423.2385[/C][C]0.031[/C][C]0[/C][C]0.1375[/C][C]0.0145[/C][/ROW]
[ROW][C]101[/C][C]396[/C][C]340.8945[/C][C]272.5884[/C][C]409.2006[/C][C]0.0569[/C][C]0.0116[/C][C]0.8738[/C][C]0.0049[/C][/ROW]
[ROW][C]102[/C][C]482[/C][C]418.2759[/C][C]348.5889[/C][C]487.9629[/C][C]0.0365[/C][C]0.7345[/C][C]0.414[/C][C]0.3602[/C][/ROW]
[ROW][C]103[/C][C]261[/C][C]243.6597[/C][C]173.2173[/C][C]314.1021[/C][C]0.3147[/C][C]0[/C][C]0.2763[/C][C]0[/C][/ROW]
[ROW][C]104[/C][C]211[/C][C]205.1849[/C][C]134.6772[/C][C]275.6927[/C][C]0.4358[/C][C]0.0604[/C][C]0.4468[/C][C]0[/C][/ROW]
[ROW][C]105[/C][C]448[/C][C]415.5782[/C][C]344.5624[/C][C]486.594[/C][C]0.1854[/C][C]1[/C][C]0.3555[/C][C]0.3352[/C][/ROW]
[ROW][C]106[/C][C]468[/C][C]395.2896[/C][C]324.206[/C][C]466.3731[/C][C]0.0225[/C][C]0.0731[/C][C]0.1088[/C][C]0.1624[/C][/ROW]
[ROW][C]107[/C][C]464[/C][C]353.1638[/C][C]282.0352[/C][C]424.2925[/C][C]0.0011[/C][C]8e-04[/C][C]0.4579[/C][C]0.016[/C][/ROW]
[ROW][C]108[/C][C]425[/C][C]356.5675[/C][C]285.3052[/C][C]427.8297[/C][C]0.0299[/C][C]0.0016[/C][C]0.0203[/C][C]0.0203[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114352&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114352&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[96])
84298-------
85360-------
86336-------
87325-------
88393-------
89301-------
90426-------
91265-------
92210-------
93429-------
94440-------
95357-------
96431-------
97442381.2712320.4172442.12510.02520.05460.75340.0546
98422370.2816309.2164431.34670.04850.01070.86440.0257
99544423.9163360.854486.97861e-040.52370.99890.4129
100420354.9797286.721423.23850.03100.13750.0145
101396340.8945272.5884409.20060.05690.01160.87380.0049
102482418.2759348.5889487.96290.03650.73450.4140.3602
103261243.6597173.2173314.10210.314700.27630
104211205.1849134.6772275.69270.43580.06040.44680
105448415.5782344.5624486.5940.185410.35550.3352
106468395.2896324.206466.37310.02250.07310.10880.1624
107464353.1638282.0352424.29250.00118e-040.45790.016
108425356.5675285.3052427.82970.02990.00160.02030.0203







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.08140.159303687.991700
980.08410.13970.14952674.79733181.394556.4039
990.07590.28330.194114420.09366927.627583.2324
1000.09810.18320.19134227.63446252.629279.0736
1010.10220.16160.18543036.61385609.426174.8961
1020.0850.15230.17994060.76345351.315773.1527
1030.14750.07120.1644300.68574629.797168.0426
1040.17530.02830.147433.8154055.299463.6812
1050.08720.0780.13971051.17193721.507461.0042
1060.09170.18390.14415286.80743878.037462.2739
1070.10280.31380.159512284.65474642.275368.1342
1080.1020.19190.16224683.00974645.669968.1592

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0814 & 0.1593 & 0 & 3687.9917 & 0 & 0 \tabularnewline
98 & 0.0841 & 0.1397 & 0.1495 & 2674.7973 & 3181.3945 & 56.4039 \tabularnewline
99 & 0.0759 & 0.2833 & 0.1941 & 14420.0936 & 6927.6275 & 83.2324 \tabularnewline
100 & 0.0981 & 0.1832 & 0.1913 & 4227.6344 & 6252.6292 & 79.0736 \tabularnewline
101 & 0.1022 & 0.1616 & 0.1854 & 3036.6138 & 5609.4261 & 74.8961 \tabularnewline
102 & 0.085 & 0.1523 & 0.1799 & 4060.7634 & 5351.3157 & 73.1527 \tabularnewline
103 & 0.1475 & 0.0712 & 0.1644 & 300.6857 & 4629.7971 & 68.0426 \tabularnewline
104 & 0.1753 & 0.0283 & 0.1474 & 33.815 & 4055.2994 & 63.6812 \tabularnewline
105 & 0.0872 & 0.078 & 0.1397 & 1051.1719 & 3721.5074 & 61.0042 \tabularnewline
106 & 0.0917 & 0.1839 & 0.1441 & 5286.8074 & 3878.0374 & 62.2739 \tabularnewline
107 & 0.1028 & 0.3138 & 0.1595 & 12284.6547 & 4642.2753 & 68.1342 \tabularnewline
108 & 0.102 & 0.1919 & 0.1622 & 4683.0097 & 4645.6699 & 68.1592 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114352&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]97[/C][C]0.0814[/C][C]0.1593[/C][C]0[/C][C]3687.9917[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.0841[/C][C]0.1397[/C][C]0.1495[/C][C]2674.7973[/C][C]3181.3945[/C][C]56.4039[/C][/ROW]
[ROW][C]99[/C][C]0.0759[/C][C]0.2833[/C][C]0.1941[/C][C]14420.0936[/C][C]6927.6275[/C][C]83.2324[/C][/ROW]
[ROW][C]100[/C][C]0.0981[/C][C]0.1832[/C][C]0.1913[/C][C]4227.6344[/C][C]6252.6292[/C][C]79.0736[/C][/ROW]
[ROW][C]101[/C][C]0.1022[/C][C]0.1616[/C][C]0.1854[/C][C]3036.6138[/C][C]5609.4261[/C][C]74.8961[/C][/ROW]
[ROW][C]102[/C][C]0.085[/C][C]0.1523[/C][C]0.1799[/C][C]4060.7634[/C][C]5351.3157[/C][C]73.1527[/C][/ROW]
[ROW][C]103[/C][C]0.1475[/C][C]0.0712[/C][C]0.1644[/C][C]300.6857[/C][C]4629.7971[/C][C]68.0426[/C][/ROW]
[ROW][C]104[/C][C]0.1753[/C][C]0.0283[/C][C]0.1474[/C][C]33.815[/C][C]4055.2994[/C][C]63.6812[/C][/ROW]
[ROW][C]105[/C][C]0.0872[/C][C]0.078[/C][C]0.1397[/C][C]1051.1719[/C][C]3721.5074[/C][C]61.0042[/C][/ROW]
[ROW][C]106[/C][C]0.0917[/C][C]0.1839[/C][C]0.1441[/C][C]5286.8074[/C][C]3878.0374[/C][C]62.2739[/C][/ROW]
[ROW][C]107[/C][C]0.1028[/C][C]0.3138[/C][C]0.1595[/C][C]12284.6547[/C][C]4642.2753[/C][C]68.1342[/C][/ROW]
[ROW][C]108[/C][C]0.102[/C][C]0.1919[/C][C]0.1622[/C][C]4683.0097[/C][C]4645.6699[/C][C]68.1592[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114352&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114352&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
970.08140.159303687.991700
980.08410.13970.14952674.79733181.394556.4039
990.07590.28330.194114420.09366927.627583.2324
1000.09810.18320.19134227.63446252.629279.0736
1010.10220.16160.18543036.61385609.426174.8961
1020.0850.15230.17994060.76345351.315773.1527
1030.14750.07120.1644300.68574629.797168.0426
1040.17530.02830.147433.8154055.299463.6812
1050.08720.0780.13971051.17193721.507461.0042
1060.09170.18390.14415286.80743878.037462.2739
1070.10280.31380.159512284.65474642.275368.1342
1080.1020.19190.16224683.00974645.669968.1592



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