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, 14 Dec 2011 13:43:36 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/14/t13238882349z0qqqd8jawjcr4.htm/, Retrieved Wed, 01 May 2024 13:27:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=155188, Retrieved Wed, 01 May 2024 13:27:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact84
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [fout] [2011-12-08 15:49:11] [38c53a789d29c0853de03d9eff8ed4ee]
- RMPD    [ARIMA Forecasting] [peer] [2011-12-14 18:43:36] [6601a4463d1f95e8006e851903a6d39a] [Current]
Feedback Forum

Post a new message
Dataseries X:
547612
563280
581302
572273
518654
520579
530577
540324
547970
555654
551174
548604
563668
586111
604378
600991
544686
537034
551531
563250
574761
580112
575093
557560
564478
580523
596594
586570
536214
523597
536535
536322
532638
528222
516141
501866
506174
517945
533590
528379
477580
469357
490243
492622
507561
516922
514258
509846
527070
541657
564591
555362
498662
511038
525919
531673
548854
560576
557274
565742
587625
619916
625809
619567
572942
572775
574205
579799
590072
593408
597141
595404
612117
628232
628884
620735
569028
567456
573100
584428
589379
590865
595454
594167
611324
612613
610763
593530
542722
536662
543599
555332
560854
562325
554788
547344
565464
577992
579714
569323
506971
500857
509127
509933
517009
519164
512238
509239
518585
522975
525192
516847
455626
454724
461251
470439
474605
476049
471067
470984
502831
512927
509673
484015
431328
436087
442867
447988
460070
467037
460170
464196
485025




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'AstonUniversity' @ aston.wessa.net

\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 & 'AstonUniversity' @ aston.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155188&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]'AstonUniversity' @ aston.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155188&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155188&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'AstonUniversity' @ aston.wessa.net







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[121])
109518585-------
110522975-------
111525192-------
112516847-------
113455626-------
114454724-------
115461251-------
116470439-------
117474605-------
118476049-------
119471067-------
120470984-------
121502831-------
122512927515696.6521503043.5467528349.75740.3340.97690.12980.9769
123509673521823.4868502329.5889541317.38460.11090.81450.36740.9719
124484015514390.2487488673.7836540106.71370.01030.64040.42570.8108
125431328459225.5168427541.3745490909.65920.04220.06260.58810.0035
126436087458388.6192420889.3629495887.87550.12190.92140.57590.0101
127442867467698.1916424501.8131510894.57010.12990.92430.61510.0555
128447988476451.6157427664.5914525238.640.12640.91140.59540.1446
129460070484124.3975429850.2804538398.51460.19250.90410.63450.2497
130467037487733.9177428076.4277547391.40760.24830.81830.64950.3099
131460170484491.0387419554.891549427.18640.23140.70080.65730.2899
132464196483164.1492413054.9385553273.35980.2980.73980.63330.2912
133485025504634.1444429457.8636579810.42520.30460.85410.51870.5187

\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[121]) \tabularnewline
109 & 518585 & - & - & - & - & - & - & - \tabularnewline
110 & 522975 & - & - & - & - & - & - & - \tabularnewline
111 & 525192 & - & - & - & - & - & - & - \tabularnewline
112 & 516847 & - & - & - & - & - & - & - \tabularnewline
113 & 455626 & - & - & - & - & - & - & - \tabularnewline
114 & 454724 & - & - & - & - & - & - & - \tabularnewline
115 & 461251 & - & - & - & - & - & - & - \tabularnewline
116 & 470439 & - & - & - & - & - & - & - \tabularnewline
117 & 474605 & - & - & - & - & - & - & - \tabularnewline
118 & 476049 & - & - & - & - & - & - & - \tabularnewline
119 & 471067 & - & - & - & - & - & - & - \tabularnewline
120 & 470984 & - & - & - & - & - & - & - \tabularnewline
121 & 502831 & - & - & - & - & - & - & - \tabularnewline
122 & 512927 & 515696.6521 & 503043.5467 & 528349.7574 & 0.334 & 0.9769 & 0.1298 & 0.9769 \tabularnewline
123 & 509673 & 521823.4868 & 502329.5889 & 541317.3846 & 0.1109 & 0.8145 & 0.3674 & 0.9719 \tabularnewline
124 & 484015 & 514390.2487 & 488673.7836 & 540106.7137 & 0.0103 & 0.6404 & 0.4257 & 0.8108 \tabularnewline
125 & 431328 & 459225.5168 & 427541.3745 & 490909.6592 & 0.0422 & 0.0626 & 0.5881 & 0.0035 \tabularnewline
126 & 436087 & 458388.6192 & 420889.3629 & 495887.8755 & 0.1219 & 0.9214 & 0.5759 & 0.0101 \tabularnewline
127 & 442867 & 467698.1916 & 424501.8131 & 510894.5701 & 0.1299 & 0.9243 & 0.6151 & 0.0555 \tabularnewline
128 & 447988 & 476451.6157 & 427664.5914 & 525238.64 & 0.1264 & 0.9114 & 0.5954 & 0.1446 \tabularnewline
129 & 460070 & 484124.3975 & 429850.2804 & 538398.5146 & 0.1925 & 0.9041 & 0.6345 & 0.2497 \tabularnewline
130 & 467037 & 487733.9177 & 428076.4277 & 547391.4076 & 0.2483 & 0.8183 & 0.6495 & 0.3099 \tabularnewline
131 & 460170 & 484491.0387 & 419554.891 & 549427.1864 & 0.2314 & 0.7008 & 0.6573 & 0.2899 \tabularnewline
132 & 464196 & 483164.1492 & 413054.9385 & 553273.3598 & 0.298 & 0.7398 & 0.6333 & 0.2912 \tabularnewline
133 & 485025 & 504634.1444 & 429457.8636 & 579810.4252 & 0.3046 & 0.8541 & 0.5187 & 0.5187 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155188&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[121])[/C][/ROW]
[ROW][C]109[/C][C]518585[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]522975[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]525192[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]516847[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]455626[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]454724[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]461251[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]470439[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]474605[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]476049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]471067[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]470984[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]502831[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]512927[/C][C]515696.6521[/C][C]503043.5467[/C][C]528349.7574[/C][C]0.334[/C][C]0.9769[/C][C]0.1298[/C][C]0.9769[/C][/ROW]
[ROW][C]123[/C][C]509673[/C][C]521823.4868[/C][C]502329.5889[/C][C]541317.3846[/C][C]0.1109[/C][C]0.8145[/C][C]0.3674[/C][C]0.9719[/C][/ROW]
[ROW][C]124[/C][C]484015[/C][C]514390.2487[/C][C]488673.7836[/C][C]540106.7137[/C][C]0.0103[/C][C]0.6404[/C][C]0.4257[/C][C]0.8108[/C][/ROW]
[ROW][C]125[/C][C]431328[/C][C]459225.5168[/C][C]427541.3745[/C][C]490909.6592[/C][C]0.0422[/C][C]0.0626[/C][C]0.5881[/C][C]0.0035[/C][/ROW]
[ROW][C]126[/C][C]436087[/C][C]458388.6192[/C][C]420889.3629[/C][C]495887.8755[/C][C]0.1219[/C][C]0.9214[/C][C]0.5759[/C][C]0.0101[/C][/ROW]
[ROW][C]127[/C][C]442867[/C][C]467698.1916[/C][C]424501.8131[/C][C]510894.5701[/C][C]0.1299[/C][C]0.9243[/C][C]0.6151[/C][C]0.0555[/C][/ROW]
[ROW][C]128[/C][C]447988[/C][C]476451.6157[/C][C]427664.5914[/C][C]525238.64[/C][C]0.1264[/C][C]0.9114[/C][C]0.5954[/C][C]0.1446[/C][/ROW]
[ROW][C]129[/C][C]460070[/C][C]484124.3975[/C][C]429850.2804[/C][C]538398.5146[/C][C]0.1925[/C][C]0.9041[/C][C]0.6345[/C][C]0.2497[/C][/ROW]
[ROW][C]130[/C][C]467037[/C][C]487733.9177[/C][C]428076.4277[/C][C]547391.4076[/C][C]0.2483[/C][C]0.8183[/C][C]0.6495[/C][C]0.3099[/C][/ROW]
[ROW][C]131[/C][C]460170[/C][C]484491.0387[/C][C]419554.891[/C][C]549427.1864[/C][C]0.2314[/C][C]0.7008[/C][C]0.6573[/C][C]0.2899[/C][/ROW]
[ROW][C]132[/C][C]464196[/C][C]483164.1492[/C][C]413054.9385[/C][C]553273.3598[/C][C]0.298[/C][C]0.7398[/C][C]0.6333[/C][C]0.2912[/C][/ROW]
[ROW][C]133[/C][C]485025[/C][C]504634.1444[/C][C]429457.8636[/C][C]579810.4252[/C][C]0.3046[/C][C]0.8541[/C][C]0.5187[/C][C]0.5187[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155188&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155188&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[121])
109518585-------
110522975-------
111525192-------
112516847-------
113455626-------
114454724-------
115461251-------
116470439-------
117474605-------
118476049-------
119471067-------
120470984-------
121502831-------
122512927515696.6521503043.5467528349.75740.3340.97690.12980.9769
123509673521823.4868502329.5889541317.38460.11090.81450.36740.9719
124484015514390.2487488673.7836540106.71370.01030.64040.42570.8108
125431328459225.5168427541.3745490909.65920.04220.06260.58810.0035
126436087458388.6192420889.3629495887.87550.12190.92140.57590.0101
127442867467698.1916424501.8131510894.57010.12990.92430.61510.0555
128447988476451.6157427664.5914525238.640.12640.91140.59540.1446
129460070484124.3975429850.2804538398.51460.19250.90410.63450.2497
130467037487733.9177428076.4277547391.40760.24830.81830.64950.3099
131460170484491.0387419554.891549427.18640.23140.70080.65730.2899
132464196483164.1492413054.9385553273.35980.2980.73980.63330.2912
133485025504634.1444429457.8636579810.42520.30460.85410.51870.5187







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1220.0125-0.005407670972.484200
1230.0191-0.02330.0143147634328.319677652650.40198812.0741
1240.0255-0.05910.0292922655730.7692359320343.857718955.747
1250.0352-0.06070.0371778271445.2307464058119.200921542.0082
1260.0417-0.04870.0394497362218.4916470718939.05921696.0581
1270.0471-0.05310.0417616588076.9749495030462.04522249.28
1280.0522-0.05970.0443810177418.9571540051455.889623239.0072
1290.0572-0.04970.045578614040.347544871778.946823342.4887
1300.0624-0.04240.0447428362400.5488531926292.458123063.5273
1310.0684-0.05020.0452591512922.4661537884955.458923192.3469
1320.074-0.03930.0447359790682.5602521694567.013622840.6341
1330.076-0.03890.0442384518544.4672510263231.801422589.0069

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
122 & 0.0125 & -0.0054 & 0 & 7670972.4842 & 0 & 0 \tabularnewline
123 & 0.0191 & -0.0233 & 0.0143 & 147634328.3196 & 77652650.4019 & 8812.0741 \tabularnewline
124 & 0.0255 & -0.0591 & 0.0292 & 922655730.7692 & 359320343.8577 & 18955.747 \tabularnewline
125 & 0.0352 & -0.0607 & 0.0371 & 778271445.2307 & 464058119.2009 & 21542.0082 \tabularnewline
126 & 0.0417 & -0.0487 & 0.0394 & 497362218.4916 & 470718939.059 & 21696.0581 \tabularnewline
127 & 0.0471 & -0.0531 & 0.0417 & 616588076.9749 & 495030462.045 & 22249.28 \tabularnewline
128 & 0.0522 & -0.0597 & 0.0443 & 810177418.9571 & 540051455.8896 & 23239.0072 \tabularnewline
129 & 0.0572 & -0.0497 & 0.045 & 578614040.347 & 544871778.9468 & 23342.4887 \tabularnewline
130 & 0.0624 & -0.0424 & 0.0447 & 428362400.5488 & 531926292.4581 & 23063.5273 \tabularnewline
131 & 0.0684 & -0.0502 & 0.0452 & 591512922.4661 & 537884955.4589 & 23192.3469 \tabularnewline
132 & 0.074 & -0.0393 & 0.0447 & 359790682.5602 & 521694567.0136 & 22840.6341 \tabularnewline
133 & 0.076 & -0.0389 & 0.0442 & 384518544.4672 & 510263231.8014 & 22589.0069 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155188&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]122[/C][C]0.0125[/C][C]-0.0054[/C][C]0[/C][C]7670972.4842[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]123[/C][C]0.0191[/C][C]-0.0233[/C][C]0.0143[/C][C]147634328.3196[/C][C]77652650.4019[/C][C]8812.0741[/C][/ROW]
[ROW][C]124[/C][C]0.0255[/C][C]-0.0591[/C][C]0.0292[/C][C]922655730.7692[/C][C]359320343.8577[/C][C]18955.747[/C][/ROW]
[ROW][C]125[/C][C]0.0352[/C][C]-0.0607[/C][C]0.0371[/C][C]778271445.2307[/C][C]464058119.2009[/C][C]21542.0082[/C][/ROW]
[ROW][C]126[/C][C]0.0417[/C][C]-0.0487[/C][C]0.0394[/C][C]497362218.4916[/C][C]470718939.059[/C][C]21696.0581[/C][/ROW]
[ROW][C]127[/C][C]0.0471[/C][C]-0.0531[/C][C]0.0417[/C][C]616588076.9749[/C][C]495030462.045[/C][C]22249.28[/C][/ROW]
[ROW][C]128[/C][C]0.0522[/C][C]-0.0597[/C][C]0.0443[/C][C]810177418.9571[/C][C]540051455.8896[/C][C]23239.0072[/C][/ROW]
[ROW][C]129[/C][C]0.0572[/C][C]-0.0497[/C][C]0.045[/C][C]578614040.347[/C][C]544871778.9468[/C][C]23342.4887[/C][/ROW]
[ROW][C]130[/C][C]0.0624[/C][C]-0.0424[/C][C]0.0447[/C][C]428362400.5488[/C][C]531926292.4581[/C][C]23063.5273[/C][/ROW]
[ROW][C]131[/C][C]0.0684[/C][C]-0.0502[/C][C]0.0452[/C][C]591512922.4661[/C][C]537884955.4589[/C][C]23192.3469[/C][/ROW]
[ROW][C]132[/C][C]0.074[/C][C]-0.0393[/C][C]0.0447[/C][C]359790682.5602[/C][C]521694567.0136[/C][C]22840.6341[/C][/ROW]
[ROW][C]133[/C][C]0.076[/C][C]-0.0389[/C][C]0.0442[/C][C]384518544.4672[/C][C]510263231.8014[/C][C]22589.0069[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155188&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155188&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
1220.0125-0.005407670972.484200
1230.0191-0.02330.0143147634328.319677652650.40198812.0741
1240.0255-0.05910.0292922655730.7692359320343.857718955.747
1250.0352-0.06070.0371778271445.2307464058119.200921542.0082
1260.0417-0.04870.0394497362218.4916470718939.05921696.0581
1270.0471-0.05310.0417616588076.9749495030462.04522249.28
1280.0522-0.05970.0443810177418.9571540051455.889623239.0072
1290.0572-0.04970.045578614040.347544871778.946823342.4887
1300.0624-0.04240.0447428362400.5488531926292.458123063.5273
1310.0684-0.05020.0452591512922.4661537884955.458923192.3469
1320.074-0.03930.0447359790682.5602521694567.013622840.6341
1330.076-0.03890.0442384518544.4672510263231.801422589.0069



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