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, 16 Dec 2009 05:59:16 -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/16/t1260968432q0bvp6504rsv5ux.htm/, Retrieved Tue, 30 Apr 2024 19:14:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68290, Retrieved Tue, 30 Apr 2024 19:14:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact140
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [arima] [2009-12-12 14:22:51] [f84db15a18b564cd160ebc7b4eade151]
- RMP     [ARIMA Forecasting] [Paper. Arima Fore...] [2009-12-16 12:59:16] [852eae237d08746109043531619a60c9] [Current]
Feedback Forum

Post a new message
Dataseries X:
593530
610763
612613
611324
594167
595454
590865
589379
584428
573100
567456
569028
620735
628884
628232
612117
595404
597141
593408
590072
579799
574205
572775
572942
619567
625809
619916
587625
565742
557274
560576
548854
531673
525919
511038
498662
555362
564591
541657
527070
509846
514258
516922
507561
492622
490243
469357
477580
528379
533590
517945
506174
501866
516141
528222
532638
536322
536535
523597
536214
586570




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68290&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[49])
37555362-------
38564591-------
39541657-------
40527070-------
41509846-------
42514258-------
43516922-------
44507561-------
45492622-------
46490243-------
47469357-------
48477580-------
49528379-------
50533590540121.0729523083.7628557158.3830.22620.91160.00240.9116
51517945514967.6363491744.3674538190.90520.40080.0580.01210.1288
52506174502340.7461473624.7032531056.7890.39680.14340.04570.0378
53501866483385.6624450556.2713516215.05350.13490.08680.05710.0036
54516141489326.4802452459.0657526193.89470.0770.25250.09250.0189
55528222490640.2949450445.8787530834.7110.03340.10680.10.0329
56532638482471.7198438951.139525992.30060.01190.01970.12930.0193
57536322466479.622420079.6548512879.58920.00160.00260.13470.0045
58536535465030.6721415744.8956514316.44870.00220.00230.1580.0059
59523597443323.2923391458.2113495188.37340.00122e-040.16267e-04
60536214452271.6992397826.1724506717.22610.00130.00510.18110.0031
61586570502430.0514445625.4208559234.68210.00180.12190.18530.1853

\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[49]) \tabularnewline
37 & 555362 & - & - & - & - & - & - & - \tabularnewline
38 & 564591 & - & - & - & - & - & - & - \tabularnewline
39 & 541657 & - & - & - & - & - & - & - \tabularnewline
40 & 527070 & - & - & - & - & - & - & - \tabularnewline
41 & 509846 & - & - & - & - & - & - & - \tabularnewline
42 & 514258 & - & - & - & - & - & - & - \tabularnewline
43 & 516922 & - & - & - & - & - & - & - \tabularnewline
44 & 507561 & - & - & - & - & - & - & - \tabularnewline
45 & 492622 & - & - & - & - & - & - & - \tabularnewline
46 & 490243 & - & - & - & - & - & - & - \tabularnewline
47 & 469357 & - & - & - & - & - & - & - \tabularnewline
48 & 477580 & - & - & - & - & - & - & - \tabularnewline
49 & 528379 & - & - & - & - & - & - & - \tabularnewline
50 & 533590 & 540121.0729 & 523083.7628 & 557158.383 & 0.2262 & 0.9116 & 0.0024 & 0.9116 \tabularnewline
51 & 517945 & 514967.6363 & 491744.3674 & 538190.9052 & 0.4008 & 0.058 & 0.0121 & 0.1288 \tabularnewline
52 & 506174 & 502340.7461 & 473624.7032 & 531056.789 & 0.3968 & 0.1434 & 0.0457 & 0.0378 \tabularnewline
53 & 501866 & 483385.6624 & 450556.2713 & 516215.0535 & 0.1349 & 0.0868 & 0.0571 & 0.0036 \tabularnewline
54 & 516141 & 489326.4802 & 452459.0657 & 526193.8947 & 0.077 & 0.2525 & 0.0925 & 0.0189 \tabularnewline
55 & 528222 & 490640.2949 & 450445.8787 & 530834.711 & 0.0334 & 0.1068 & 0.1 & 0.0329 \tabularnewline
56 & 532638 & 482471.7198 & 438951.139 & 525992.3006 & 0.0119 & 0.0197 & 0.1293 & 0.0193 \tabularnewline
57 & 536322 & 466479.622 & 420079.6548 & 512879.5892 & 0.0016 & 0.0026 & 0.1347 & 0.0045 \tabularnewline
58 & 536535 & 465030.6721 & 415744.8956 & 514316.4487 & 0.0022 & 0.0023 & 0.158 & 0.0059 \tabularnewline
59 & 523597 & 443323.2923 & 391458.2113 & 495188.3734 & 0.0012 & 2e-04 & 0.1626 & 7e-04 \tabularnewline
60 & 536214 & 452271.6992 & 397826.1724 & 506717.2261 & 0.0013 & 0.0051 & 0.1811 & 0.0031 \tabularnewline
61 & 586570 & 502430.0514 & 445625.4208 & 559234.6821 & 0.0018 & 0.1219 & 0.1853 & 0.1853 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68290&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[49])[/C][/ROW]
[ROW][C]37[/C][C]555362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]564591[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]541657[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]527070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]509846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]514258[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]516922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]507561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]492622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]490243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]469357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]477580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]528379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]533590[/C][C]540121.0729[/C][C]523083.7628[/C][C]557158.383[/C][C]0.2262[/C][C]0.9116[/C][C]0.0024[/C][C]0.9116[/C][/ROW]
[ROW][C]51[/C][C]517945[/C][C]514967.6363[/C][C]491744.3674[/C][C]538190.9052[/C][C]0.4008[/C][C]0.058[/C][C]0.0121[/C][C]0.1288[/C][/ROW]
[ROW][C]52[/C][C]506174[/C][C]502340.7461[/C][C]473624.7032[/C][C]531056.789[/C][C]0.3968[/C][C]0.1434[/C][C]0.0457[/C][C]0.0378[/C][/ROW]
[ROW][C]53[/C][C]501866[/C][C]483385.6624[/C][C]450556.2713[/C][C]516215.0535[/C][C]0.1349[/C][C]0.0868[/C][C]0.0571[/C][C]0.0036[/C][/ROW]
[ROW][C]54[/C][C]516141[/C][C]489326.4802[/C][C]452459.0657[/C][C]526193.8947[/C][C]0.077[/C][C]0.2525[/C][C]0.0925[/C][C]0.0189[/C][/ROW]
[ROW][C]55[/C][C]528222[/C][C]490640.2949[/C][C]450445.8787[/C][C]530834.711[/C][C]0.0334[/C][C]0.1068[/C][C]0.1[/C][C]0.0329[/C][/ROW]
[ROW][C]56[/C][C]532638[/C][C]482471.7198[/C][C]438951.139[/C][C]525992.3006[/C][C]0.0119[/C][C]0.0197[/C][C]0.1293[/C][C]0.0193[/C][/ROW]
[ROW][C]57[/C][C]536322[/C][C]466479.622[/C][C]420079.6548[/C][C]512879.5892[/C][C]0.0016[/C][C]0.0026[/C][C]0.1347[/C][C]0.0045[/C][/ROW]
[ROW][C]58[/C][C]536535[/C][C]465030.6721[/C][C]415744.8956[/C][C]514316.4487[/C][C]0.0022[/C][C]0.0023[/C][C]0.158[/C][C]0.0059[/C][/ROW]
[ROW][C]59[/C][C]523597[/C][C]443323.2923[/C][C]391458.2113[/C][C]495188.3734[/C][C]0.0012[/C][C]2e-04[/C][C]0.1626[/C][C]7e-04[/C][/ROW]
[ROW][C]60[/C][C]536214[/C][C]452271.6992[/C][C]397826.1724[/C][C]506717.2261[/C][C]0.0013[/C][C]0.0051[/C][C]0.1811[/C][C]0.0031[/C][/ROW]
[ROW][C]61[/C][C]586570[/C][C]502430.0514[/C][C]445625.4208[/C][C]559234.6821[/C][C]0.0018[/C][C]0.1219[/C][C]0.1853[/C][C]0.1853[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68290&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68290&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[49])
37555362-------
38564591-------
39541657-------
40527070-------
41509846-------
42514258-------
43516922-------
44507561-------
45492622-------
46490243-------
47469357-------
48477580-------
49528379-------
50533590540121.0729523083.7628557158.3830.22620.91160.00240.9116
51517945514967.6363491744.3674538190.90520.40080.0580.01210.1288
52506174502340.7461473624.7032531056.7890.39680.14340.04570.0378
53501866483385.6624450556.2713516215.05350.13490.08680.05710.0036
54516141489326.4802452459.0657526193.89470.0770.25250.09250.0189
55528222490640.2949450445.8787530834.7110.03340.10680.10.0329
56532638482471.7198438951.139525992.30060.01190.01970.12930.0193
57536322466479.622420079.6548512879.58920.00160.00260.13470.0045
58536535465030.6721415744.8956514316.44870.00220.00230.1580.0059
59523597443323.2923391458.2113495188.37340.00122e-040.16267e-04
60536214452271.6992397826.1724506717.22610.00130.00510.18110.0031
61586570502430.0514445625.4208559234.68210.00180.12190.18530.1853







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0161-0.0121042654913.168300
510.0230.00580.00898864694.659625759803.91395075.4117
520.02920.00760.008514693835.431922071147.75334697.994
530.03470.03820.0159341522876.8433101934080.025810096.2409
540.03840.05480.0237719018472.7141225350958.563415011.6941
550.04180.07660.03251412384559.7765423189892.098920571.5797
560.0460.1040.04272516655671.0534722256431.949626874.829
570.05070.14970.05614877957763.92011241719098.445935238.0348
580.05410.15380.0675112868904.6231671846854.687840888.2239
590.05970.18110.07846443868141.7832149048983.397346357.8363
600.06140.18560.08817046309860.48682594254517.678250933.8249
610.05770.16750.09477079530944.76542968027553.268854479.6068

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0161 & -0.0121 & 0 & 42654913.1683 & 0 & 0 \tabularnewline
51 & 0.023 & 0.0058 & 0.0089 & 8864694.6596 & 25759803.9139 & 5075.4117 \tabularnewline
52 & 0.0292 & 0.0076 & 0.0085 & 14693835.4319 & 22071147.7533 & 4697.994 \tabularnewline
53 & 0.0347 & 0.0382 & 0.0159 & 341522876.8433 & 101934080.0258 & 10096.2409 \tabularnewline
54 & 0.0384 & 0.0548 & 0.0237 & 719018472.7141 & 225350958.5634 & 15011.6941 \tabularnewline
55 & 0.0418 & 0.0766 & 0.0325 & 1412384559.7765 & 423189892.0989 & 20571.5797 \tabularnewline
56 & 0.046 & 0.104 & 0.0427 & 2516655671.0534 & 722256431.9496 & 26874.829 \tabularnewline
57 & 0.0507 & 0.1497 & 0.0561 & 4877957763.9201 & 1241719098.4459 & 35238.0348 \tabularnewline
58 & 0.0541 & 0.1538 & 0.067 & 5112868904.623 & 1671846854.6878 & 40888.2239 \tabularnewline
59 & 0.0597 & 0.1811 & 0.0784 & 6443868141.783 & 2149048983.3973 & 46357.8363 \tabularnewline
60 & 0.0614 & 0.1856 & 0.0881 & 7046309860.4868 & 2594254517.6782 & 50933.8249 \tabularnewline
61 & 0.0577 & 0.1675 & 0.0947 & 7079530944.7654 & 2968027553.2688 & 54479.6068 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68290&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]50[/C][C]0.0161[/C][C]-0.0121[/C][C]0[/C][C]42654913.1683[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.023[/C][C]0.0058[/C][C]0.0089[/C][C]8864694.6596[/C][C]25759803.9139[/C][C]5075.4117[/C][/ROW]
[ROW][C]52[/C][C]0.0292[/C][C]0.0076[/C][C]0.0085[/C][C]14693835.4319[/C][C]22071147.7533[/C][C]4697.994[/C][/ROW]
[ROW][C]53[/C][C]0.0347[/C][C]0.0382[/C][C]0.0159[/C][C]341522876.8433[/C][C]101934080.0258[/C][C]10096.2409[/C][/ROW]
[ROW][C]54[/C][C]0.0384[/C][C]0.0548[/C][C]0.0237[/C][C]719018472.7141[/C][C]225350958.5634[/C][C]15011.6941[/C][/ROW]
[ROW][C]55[/C][C]0.0418[/C][C]0.0766[/C][C]0.0325[/C][C]1412384559.7765[/C][C]423189892.0989[/C][C]20571.5797[/C][/ROW]
[ROW][C]56[/C][C]0.046[/C][C]0.104[/C][C]0.0427[/C][C]2516655671.0534[/C][C]722256431.9496[/C][C]26874.829[/C][/ROW]
[ROW][C]57[/C][C]0.0507[/C][C]0.1497[/C][C]0.0561[/C][C]4877957763.9201[/C][C]1241719098.4459[/C][C]35238.0348[/C][/ROW]
[ROW][C]58[/C][C]0.0541[/C][C]0.1538[/C][C]0.067[/C][C]5112868904.623[/C][C]1671846854.6878[/C][C]40888.2239[/C][/ROW]
[ROW][C]59[/C][C]0.0597[/C][C]0.1811[/C][C]0.0784[/C][C]6443868141.783[/C][C]2149048983.3973[/C][C]46357.8363[/C][/ROW]
[ROW][C]60[/C][C]0.0614[/C][C]0.1856[/C][C]0.0881[/C][C]7046309860.4868[/C][C]2594254517.6782[/C][C]50933.8249[/C][/ROW]
[ROW][C]61[/C][C]0.0577[/C][C]0.1675[/C][C]0.0947[/C][C]7079530944.7654[/C][C]2968027553.2688[/C][C]54479.6068[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68290&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68290&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
500.0161-0.0121042654913.168300
510.0230.00580.00898864694.659625759803.91395075.4117
520.02920.00760.008514693835.431922071147.75334697.994
530.03470.03820.0159341522876.8433101934080.025810096.2409
540.03840.05480.0237719018472.7141225350958.563415011.6941
550.04180.07660.03251412384559.7765423189892.098920571.5797
560.0460.1040.04272516655671.0534722256431.949626874.829
570.05070.14970.05614877957763.92011241719098.445935238.0348
580.05410.15380.0675112868904.6231671846854.687840888.2239
590.05970.18110.07846443868141.7832149048983.397346357.8363
600.06140.18560.08817046309860.48682594254517.678250933.8249
610.05770.16750.09477079530944.76542968027553.268854479.6068



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