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 computationThu, 17 Dec 2009 21:24:42 -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/18/t1261110348emba9q75q62zbk2.htm/, Retrieved Sat, 27 Apr 2024 12:17:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69157, Retrieved Sat, 27 Apr 2024 12:17:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
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] [] [2009-11-27 14:40:44] [b98453cac15ba1066b407e146608df68]
-    D    [Standard Deviation-Mean Plot] [Workshop 9 - Stan...] [2009-12-03 15:25:01] [1646a2766cb8c4a6f9d3b2fffef409b3]
- R  D      [Standard Deviation-Mean Plot] [] [2009-12-06 20:01:28] [30e733e0d80e1684893fcdfadcb286e7]
- RMP         [ARIMA Forecasting] [] [2009-12-14 12:33:55] [74be16979710d4c4e7c6647856088456]
-                 [ARIMA Forecasting] [] [2009-12-18 04:24:42] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
269645
267037
258113
262813
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
246263
255765
264319
268347
273046
273963
267430
271993
292710
295881




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69157&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 time1 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])
48260993-------
49254663-------
50250643-------
51243422-------
52247105-------
53248541-------
54245039-------
55237080-------
56237085-------
57225554-------
58226839-------
59247934-------
60248333-------
61246969249146.7519242271.2636256022.24020.26740.59170.05790.5917
62245098242185.7829233002.1223251369.44340.26710.15370.03550.0948
63246263234182.0508222449.9181245914.18350.02180.03410.06130.009
64255765235895.88221088.0997250703.66040.00430.0850.06890.0499
65264319236746.7962219504.8967253988.69579e-040.01530.090.0939
66268347234541.9322214859.4339254224.43054e-040.00150.14790.0848
67273046228750.153206721.184250779.121902e-040.22930.0407
68273963226467.4883202317.2862250617.69041e-041e-040.19440.038
69267430220063.3097193866.2154246260.4042e-0400.34060.0172
70271993217137.0285189009.5985245264.45851e-042e-040.24950.0149
71292710238658.3721208717.1996268599.54452e-040.01450.27190.2633
72295881241139.6793209464.4607272814.89784e-047e-040.32810.3281

\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 & 260993 & - & - & - & - & - & - & - \tabularnewline
49 & 254663 & - & - & - & - & - & - & - \tabularnewline
50 & 250643 & - & - & - & - & - & - & - \tabularnewline
51 & 243422 & - & - & - & - & - & - & - \tabularnewline
52 & 247105 & - & - & - & - & - & - & - \tabularnewline
53 & 248541 & - & - & - & - & - & - & - \tabularnewline
54 & 245039 & - & - & - & - & - & - & - \tabularnewline
55 & 237080 & - & - & - & - & - & - & - \tabularnewline
56 & 237085 & - & - & - & - & - & - & - \tabularnewline
57 & 225554 & - & - & - & - & - & - & - \tabularnewline
58 & 226839 & - & - & - & - & - & - & - \tabularnewline
59 & 247934 & - & - & - & - & - & - & - \tabularnewline
60 & 248333 & - & - & - & - & - & - & - \tabularnewline
61 & 246969 & 249146.7519 & 242271.2636 & 256022.2402 & 0.2674 & 0.5917 & 0.0579 & 0.5917 \tabularnewline
62 & 245098 & 242185.7829 & 233002.1223 & 251369.4434 & 0.2671 & 0.1537 & 0.0355 & 0.0948 \tabularnewline
63 & 246263 & 234182.0508 & 222449.9181 & 245914.1835 & 0.0218 & 0.0341 & 0.0613 & 0.009 \tabularnewline
64 & 255765 & 235895.88 & 221088.0997 & 250703.6604 & 0.0043 & 0.085 & 0.0689 & 0.0499 \tabularnewline
65 & 264319 & 236746.7962 & 219504.8967 & 253988.6957 & 9e-04 & 0.0153 & 0.09 & 0.0939 \tabularnewline
66 & 268347 & 234541.9322 & 214859.4339 & 254224.4305 & 4e-04 & 0.0015 & 0.1479 & 0.0848 \tabularnewline
67 & 273046 & 228750.153 & 206721.184 & 250779.1219 & 0 & 2e-04 & 0.2293 & 0.0407 \tabularnewline
68 & 273963 & 226467.4883 & 202317.2862 & 250617.6904 & 1e-04 & 1e-04 & 0.1944 & 0.038 \tabularnewline
69 & 267430 & 220063.3097 & 193866.2154 & 246260.404 & 2e-04 & 0 & 0.3406 & 0.0172 \tabularnewline
70 & 271993 & 217137.0285 & 189009.5985 & 245264.4585 & 1e-04 & 2e-04 & 0.2495 & 0.0149 \tabularnewline
71 & 292710 & 238658.3721 & 208717.1996 & 268599.5445 & 2e-04 & 0.0145 & 0.2719 & 0.2633 \tabularnewline
72 & 295881 & 241139.6793 & 209464.4607 & 272814.8978 & 4e-04 & 7e-04 & 0.3281 & 0.3281 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69157&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]260993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]254663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]247105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]248541[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]245039[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]237080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]237085[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]225554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]226839[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]247934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]248333[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]246969[/C][C]249146.7519[/C][C]242271.2636[/C][C]256022.2402[/C][C]0.2674[/C][C]0.5917[/C][C]0.0579[/C][C]0.5917[/C][/ROW]
[ROW][C]62[/C][C]245098[/C][C]242185.7829[/C][C]233002.1223[/C][C]251369.4434[/C][C]0.2671[/C][C]0.1537[/C][C]0.0355[/C][C]0.0948[/C][/ROW]
[ROW][C]63[/C][C]246263[/C][C]234182.0508[/C][C]222449.9181[/C][C]245914.1835[/C][C]0.0218[/C][C]0.0341[/C][C]0.0613[/C][C]0.009[/C][/ROW]
[ROW][C]64[/C][C]255765[/C][C]235895.88[/C][C]221088.0997[/C][C]250703.6604[/C][C]0.0043[/C][C]0.085[/C][C]0.0689[/C][C]0.0499[/C][/ROW]
[ROW][C]65[/C][C]264319[/C][C]236746.7962[/C][C]219504.8967[/C][C]253988.6957[/C][C]9e-04[/C][C]0.0153[/C][C]0.09[/C][C]0.0939[/C][/ROW]
[ROW][C]66[/C][C]268347[/C][C]234541.9322[/C][C]214859.4339[/C][C]254224.4305[/C][C]4e-04[/C][C]0.0015[/C][C]0.1479[/C][C]0.0848[/C][/ROW]
[ROW][C]67[/C][C]273046[/C][C]228750.153[/C][C]206721.184[/C][C]250779.1219[/C][C]0[/C][C]2e-04[/C][C]0.2293[/C][C]0.0407[/C][/ROW]
[ROW][C]68[/C][C]273963[/C][C]226467.4883[/C][C]202317.2862[/C][C]250617.6904[/C][C]1e-04[/C][C]1e-04[/C][C]0.1944[/C][C]0.038[/C][/ROW]
[ROW][C]69[/C][C]267430[/C][C]220063.3097[/C][C]193866.2154[/C][C]246260.404[/C][C]2e-04[/C][C]0[/C][C]0.3406[/C][C]0.0172[/C][/ROW]
[ROW][C]70[/C][C]271993[/C][C]217137.0285[/C][C]189009.5985[/C][C]245264.4585[/C][C]1e-04[/C][C]2e-04[/C][C]0.2495[/C][C]0.0149[/C][/ROW]
[ROW][C]71[/C][C]292710[/C][C]238658.3721[/C][C]208717.1996[/C][C]268599.5445[/C][C]2e-04[/C][C]0.0145[/C][C]0.2719[/C][C]0.2633[/C][/ROW]
[ROW][C]72[/C][C]295881[/C][C]241139.6793[/C][C]209464.4607[/C][C]272814.8978[/C][C]4e-04[/C][C]7e-04[/C][C]0.3281[/C][C]0.3281[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69157&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69157&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])
48260993-------
49254663-------
50250643-------
51243422-------
52247105-------
53248541-------
54245039-------
55237080-------
56237085-------
57225554-------
58226839-------
59247934-------
60248333-------
61246969249146.7519242271.2636256022.24020.26740.59170.05790.5917
62245098242185.7829233002.1223251369.44340.26710.15370.03550.0948
63246263234182.0508222449.9181245914.18350.02180.03410.06130.009
64255765235895.88221088.0997250703.66040.00430.0850.06890.0499
65264319236746.7962219504.8967253988.69579e-040.01530.090.0939
66268347234541.9322214859.4339254224.43054e-040.00150.14790.0848
67273046228750.153206721.184250779.121902e-040.22930.0407
68273963226467.4883202317.2862250617.69041e-041e-040.19440.038
69267430220063.3097193866.2154246260.4042e-0400.34060.0172
70271993217137.0285189009.5985245264.45851e-042e-040.24950.0149
71292710238658.3721208717.1996268599.54452e-040.01450.27190.2633
72295881241139.6793209464.4607272814.89784e-047e-040.32810.3281







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0141-0.008704742603.510100
620.01930.0120.01048481008.69476611806.10242571.3432
630.02560.05160.0241145949333.360553057648.52187284.0681
640.0320.08420.0391394781929.1421138488718.676911768.123
650.03720.11650.0546760226423.2236262836259.586216212.2256
660.04280.14410.06951142782607.0138409493984.157520235.9577
670.04910.19360.08731962122063.0893631297995.433425125.6442
680.05440.20970.10262255823631.3547834363699.923628885.3544
690.06070.21520.11512243603346.998990945882.931931479.2929
700.06610.25260.12883009177613.04631192769055.943334536.4888
710.0640.22650.13772921578480.07221349933549.045936741.4418
720.0670.2270.14522996612197.34261487156769.737338563.6716

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0141 & -0.0087 & 0 & 4742603.5101 & 0 & 0 \tabularnewline
62 & 0.0193 & 0.012 & 0.0104 & 8481008.6947 & 6611806.1024 & 2571.3432 \tabularnewline
63 & 0.0256 & 0.0516 & 0.0241 & 145949333.3605 & 53057648.5218 & 7284.0681 \tabularnewline
64 & 0.032 & 0.0842 & 0.0391 & 394781929.1421 & 138488718.6769 & 11768.123 \tabularnewline
65 & 0.0372 & 0.1165 & 0.0546 & 760226423.2236 & 262836259.5862 & 16212.2256 \tabularnewline
66 & 0.0428 & 0.1441 & 0.0695 & 1142782607.0138 & 409493984.1575 & 20235.9577 \tabularnewline
67 & 0.0491 & 0.1936 & 0.0873 & 1962122063.0893 & 631297995.4334 & 25125.6442 \tabularnewline
68 & 0.0544 & 0.2097 & 0.1026 & 2255823631.3547 & 834363699.9236 & 28885.3544 \tabularnewline
69 & 0.0607 & 0.2152 & 0.1151 & 2243603346.998 & 990945882.9319 & 31479.2929 \tabularnewline
70 & 0.0661 & 0.2526 & 0.1288 & 3009177613.0463 & 1192769055.9433 & 34536.4888 \tabularnewline
71 & 0.064 & 0.2265 & 0.1377 & 2921578480.0722 & 1349933549.0459 & 36741.4418 \tabularnewline
72 & 0.067 & 0.227 & 0.1452 & 2996612197.3426 & 1487156769.7373 & 38563.6716 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69157&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.0141[/C][C]-0.0087[/C][C]0[/C][C]4742603.5101[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0193[/C][C]0.012[/C][C]0.0104[/C][C]8481008.6947[/C][C]6611806.1024[/C][C]2571.3432[/C][/ROW]
[ROW][C]63[/C][C]0.0256[/C][C]0.0516[/C][C]0.0241[/C][C]145949333.3605[/C][C]53057648.5218[/C][C]7284.0681[/C][/ROW]
[ROW][C]64[/C][C]0.032[/C][C]0.0842[/C][C]0.0391[/C][C]394781929.1421[/C][C]138488718.6769[/C][C]11768.123[/C][/ROW]
[ROW][C]65[/C][C]0.0372[/C][C]0.1165[/C][C]0.0546[/C][C]760226423.2236[/C][C]262836259.5862[/C][C]16212.2256[/C][/ROW]
[ROW][C]66[/C][C]0.0428[/C][C]0.1441[/C][C]0.0695[/C][C]1142782607.0138[/C][C]409493984.1575[/C][C]20235.9577[/C][/ROW]
[ROW][C]67[/C][C]0.0491[/C][C]0.1936[/C][C]0.0873[/C][C]1962122063.0893[/C][C]631297995.4334[/C][C]25125.6442[/C][/ROW]
[ROW][C]68[/C][C]0.0544[/C][C]0.2097[/C][C]0.1026[/C][C]2255823631.3547[/C][C]834363699.9236[/C][C]28885.3544[/C][/ROW]
[ROW][C]69[/C][C]0.0607[/C][C]0.2152[/C][C]0.1151[/C][C]2243603346.998[/C][C]990945882.9319[/C][C]31479.2929[/C][/ROW]
[ROW][C]70[/C][C]0.0661[/C][C]0.2526[/C][C]0.1288[/C][C]3009177613.0463[/C][C]1192769055.9433[/C][C]34536.4888[/C][/ROW]
[ROW][C]71[/C][C]0.064[/C][C]0.2265[/C][C]0.1377[/C][C]2921578480.0722[/C][C]1349933549.0459[/C][C]36741.4418[/C][/ROW]
[ROW][C]72[/C][C]0.067[/C][C]0.227[/C][C]0.1452[/C][C]2996612197.3426[/C][C]1487156769.7373[/C][C]38563.6716[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69157&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69157&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.0141-0.008704742603.510100
620.01930.0120.01048481008.69476611806.10242571.3432
630.02560.05160.0241145949333.360553057648.52187284.0681
640.0320.08420.0391394781929.1421138488718.676911768.123
650.03720.11650.0546760226423.2236262836259.586216212.2256
660.04280.14410.06951142782607.0138409493984.157520235.9577
670.04910.19360.08731962122063.0893631297995.433425125.6442
680.05440.20970.10262255823631.3547834363699.923628885.3544
690.06070.21520.11512243603346.998990945882.931931479.2929
700.06610.25260.12883009177613.04631192769055.943334536.4888
710.0640.22650.13772921578480.07221349933549.045936741.4418
720.0670.2270.14522996612197.34261487156769.737338563.6716



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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')