Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 08 Dec 2007 01:49:29 -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/08/t1197102973zyrp2thff8x9mvh.htm/, Retrieved Sun, 28 Apr 2024 20:22:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2897, Retrieved Sun, 28 Apr 2024 20:22:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact240
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [WS9Q1(lambda-0,39)] [2007-12-08 08:49:29] [77c9c0d97755c69877fabe95ec1f485a] [Current]
Feedback Forum

Post a new message
Dataseries X:
467037
460070
447988
442867
436087
431328
484015
509673
512927
502831
470984
471067
476049
474605
470439
461251
454724
455626
516847
525192
522975
518585
509239
512238
519164
517009
509933
509127
500857
506971
569323
579714
577992
565464
547344
554788
562325
560854
555332
543599
536662
542722
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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2897&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[60])
48595454-------
49590865-------
50589379-------
51584428-------
52573100-------
53567456-------
54569028-------
55620735-------
56628884-------
57628232-------
58612117-------
59595404-------
60597141-------
61593408596951.9924613545.0228580980.48030.66820.50930.22750.5093
62590072595214.839618772.2487572894.16320.67420.4370.30420.5672
63579799589508.305618146.271562693.93520.76110.51640.35520.7115
64574205578587.9247610960.7399548566.60290.61260.53150.36010.8871
65572775571972.1002607744.1355539079.84480.51910.55290.39390.9332
66572942575033.4072614681.0928538875.65120.54510.45130.37240.8846
67619567631103.0533680167.7823586853.96650.69530.0050.3230.0662
68625809642522.747696530.639594200.60930.75110.17590.29010.0328
69619916642348.9524699812.4888591280.42380.80540.26280.2940.0414
70587625629649.4425688717.4566577437.62130.94270.35740.25520.1112
71565742611665.4083671294.5696559196.12320.95690.18460.27180.2937
72557274613942.9436676741.8591559009.26150.97840.04270.27440.2744

\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 & 595454 & - & - & - & - & - & - & - \tabularnewline
49 & 590865 & - & - & - & - & - & - & - \tabularnewline
50 & 589379 & - & - & - & - & - & - & - \tabularnewline
51 & 584428 & - & - & - & - & - & - & - \tabularnewline
52 & 573100 & - & - & - & - & - & - & - \tabularnewline
53 & 567456 & - & - & - & - & - & - & - \tabularnewline
54 & 569028 & - & - & - & - & - & - & - \tabularnewline
55 & 620735 & - & - & - & - & - & - & - \tabularnewline
56 & 628884 & - & - & - & - & - & - & - \tabularnewline
57 & 628232 & - & - & - & - & - & - & - \tabularnewline
58 & 612117 & - & - & - & - & - & - & - \tabularnewline
59 & 595404 & - & - & - & - & - & - & - \tabularnewline
60 & 597141 & - & - & - & - & - & - & - \tabularnewline
61 & 593408 & 596951.9924 & 613545.0228 & 580980.4803 & 0.6682 & 0.5093 & 0.2275 & 0.5093 \tabularnewline
62 & 590072 & 595214.839 & 618772.2487 & 572894.1632 & 0.6742 & 0.437 & 0.3042 & 0.5672 \tabularnewline
63 & 579799 & 589508.305 & 618146.271 & 562693.9352 & 0.7611 & 0.5164 & 0.3552 & 0.7115 \tabularnewline
64 & 574205 & 578587.9247 & 610960.7399 & 548566.6029 & 0.6126 & 0.5315 & 0.3601 & 0.8871 \tabularnewline
65 & 572775 & 571972.1002 & 607744.1355 & 539079.8448 & 0.5191 & 0.5529 & 0.3939 & 0.9332 \tabularnewline
66 & 572942 & 575033.4072 & 614681.0928 & 538875.6512 & 0.5451 & 0.4513 & 0.3724 & 0.8846 \tabularnewline
67 & 619567 & 631103.0533 & 680167.7823 & 586853.9665 & 0.6953 & 0.005 & 0.323 & 0.0662 \tabularnewline
68 & 625809 & 642522.747 & 696530.639 & 594200.6093 & 0.7511 & 0.1759 & 0.2901 & 0.0328 \tabularnewline
69 & 619916 & 642348.9524 & 699812.4888 & 591280.4238 & 0.8054 & 0.2628 & 0.294 & 0.0414 \tabularnewline
70 & 587625 & 629649.4425 & 688717.4566 & 577437.6213 & 0.9427 & 0.3574 & 0.2552 & 0.1112 \tabularnewline
71 & 565742 & 611665.4083 & 671294.5696 & 559196.1232 & 0.9569 & 0.1846 & 0.2718 & 0.2937 \tabularnewline
72 & 557274 & 613942.9436 & 676741.8591 & 559009.2615 & 0.9784 & 0.0427 & 0.2744 & 0.2744 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2897&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]595454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]590865[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]589379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]584428[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]573100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]567456[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]569028[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]620735[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]628884[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]628232[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]612117[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]595404[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]597141[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]593408[/C][C]596951.9924[/C][C]613545.0228[/C][C]580980.4803[/C][C]0.6682[/C][C]0.5093[/C][C]0.2275[/C][C]0.5093[/C][/ROW]
[ROW][C]62[/C][C]590072[/C][C]595214.839[/C][C]618772.2487[/C][C]572894.1632[/C][C]0.6742[/C][C]0.437[/C][C]0.3042[/C][C]0.5672[/C][/ROW]
[ROW][C]63[/C][C]579799[/C][C]589508.305[/C][C]618146.271[/C][C]562693.9352[/C][C]0.7611[/C][C]0.5164[/C][C]0.3552[/C][C]0.7115[/C][/ROW]
[ROW][C]64[/C][C]574205[/C][C]578587.9247[/C][C]610960.7399[/C][C]548566.6029[/C][C]0.6126[/C][C]0.5315[/C][C]0.3601[/C][C]0.8871[/C][/ROW]
[ROW][C]65[/C][C]572775[/C][C]571972.1002[/C][C]607744.1355[/C][C]539079.8448[/C][C]0.5191[/C][C]0.5529[/C][C]0.3939[/C][C]0.9332[/C][/ROW]
[ROW][C]66[/C][C]572942[/C][C]575033.4072[/C][C]614681.0928[/C][C]538875.6512[/C][C]0.5451[/C][C]0.4513[/C][C]0.3724[/C][C]0.8846[/C][/ROW]
[ROW][C]67[/C][C]619567[/C][C]631103.0533[/C][C]680167.7823[/C][C]586853.9665[/C][C]0.6953[/C][C]0.005[/C][C]0.323[/C][C]0.0662[/C][/ROW]
[ROW][C]68[/C][C]625809[/C][C]642522.747[/C][C]696530.639[/C][C]594200.6093[/C][C]0.7511[/C][C]0.1759[/C][C]0.2901[/C][C]0.0328[/C][/ROW]
[ROW][C]69[/C][C]619916[/C][C]642348.9524[/C][C]699812.4888[/C][C]591280.4238[/C][C]0.8054[/C][C]0.2628[/C][C]0.294[/C][C]0.0414[/C][/ROW]
[ROW][C]70[/C][C]587625[/C][C]629649.4425[/C][C]688717.4566[/C][C]577437.6213[/C][C]0.9427[/C][C]0.3574[/C][C]0.2552[/C][C]0.1112[/C][/ROW]
[ROW][C]71[/C][C]565742[/C][C]611665.4083[/C][C]671294.5696[/C][C]559196.1232[/C][C]0.9569[/C][C]0.1846[/C][C]0.2718[/C][C]0.2937[/C][/ROW]
[ROW][C]72[/C][C]557274[/C][C]613942.9436[/C][C]676741.8591[/C][C]559009.2615[/C][C]0.9784[/C][C]0.0427[/C][C]0.2744[/C][C]0.2744[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2897&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2897&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])
48595454-------
49590865-------
50589379-------
51584428-------
52573100-------
53567456-------
54569028-------
55620735-------
56628884-------
57628232-------
58612117-------
59595404-------
60597141-------
61593408596951.9924613545.0228580980.48030.66820.50930.22750.5093
62590072595214.839618772.2487572894.16320.67420.4370.30420.5672
63579799589508.305618146.271562693.93520.76110.51640.35520.7115
64574205578587.9247610960.7399548566.60290.61260.53150.36010.8871
65572775571972.1002607744.1355539079.84480.51910.55290.39390.9332
66572942575033.4072614681.0928538875.65120.54510.45130.37240.8846
67619567631103.0533680167.7823586853.96650.69530.0050.3230.0662
68625809642522.747696530.639594200.60930.75110.17590.29010.0328
69619916642348.9524699812.4888591280.42380.80540.26280.2940.0414
70587625629649.4425688717.4566577437.62130.94270.35740.25520.1112
71565742611665.4083671294.5696559196.12320.95690.18460.27180.2937
72557274613942.9436676741.8591559009.26150.97840.04270.27440.2744







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
61-0.0137-0.00595e-0412559882.43191046656.86931023.0625
62-0.0191-0.00867e-0426448792.97732204066.08141484.6097
63-0.0232-0.01650.001494270603.03337855883.58612802.8349
64-0.0265-0.00766e-0419210028.9581600835.74651265.2414
65-0.02930.00141e-04644648.049353720.6708231.7772
66-0.0321-0.00363e-044373984.1398364498.6783603.7373
67-0.0358-0.01830.0015133080525.926511090043.82723330.1717
68-0.0384-0.0260.0022279349337.563323279111.46364824.8432
69-0.0406-0.03490.0029503237354.102241936446.17526475.8356
70-0.0423-0.06670.00561766053771.2168147171147.601412131.4116
71-0.0438-0.07510.00632108959426.4778175746618.873213256.9461
72-0.0457-0.09230.00773211369172.2311267614097.685916358.9149

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & -0.0137 & -0.0059 & 5e-04 & 12559882.4319 & 1046656.8693 & 1023.0625 \tabularnewline
62 & -0.0191 & -0.0086 & 7e-04 & 26448792.9773 & 2204066.0814 & 1484.6097 \tabularnewline
63 & -0.0232 & -0.0165 & 0.0014 & 94270603.0333 & 7855883.5861 & 2802.8349 \tabularnewline
64 & -0.0265 & -0.0076 & 6e-04 & 19210028.958 & 1600835.7465 & 1265.2414 \tabularnewline
65 & -0.0293 & 0.0014 & 1e-04 & 644648.0493 & 53720.6708 & 231.7772 \tabularnewline
66 & -0.0321 & -0.0036 & 3e-04 & 4373984.1398 & 364498.6783 & 603.7373 \tabularnewline
67 & -0.0358 & -0.0183 & 0.0015 & 133080525.9265 & 11090043.8272 & 3330.1717 \tabularnewline
68 & -0.0384 & -0.026 & 0.0022 & 279349337.5633 & 23279111.4636 & 4824.8432 \tabularnewline
69 & -0.0406 & -0.0349 & 0.0029 & 503237354.1022 & 41936446.1752 & 6475.8356 \tabularnewline
70 & -0.0423 & -0.0667 & 0.0056 & 1766053771.2168 & 147171147.6014 & 12131.4116 \tabularnewline
71 & -0.0438 & -0.0751 & 0.0063 & 2108959426.4778 & 175746618.8732 & 13256.9461 \tabularnewline
72 & -0.0457 & -0.0923 & 0.0077 & 3211369172.2311 & 267614097.6859 & 16358.9149 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2897&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.0137[/C][C]-0.0059[/C][C]5e-04[/C][C]12559882.4319[/C][C]1046656.8693[/C][C]1023.0625[/C][/ROW]
[ROW][C]62[/C][C]-0.0191[/C][C]-0.0086[/C][C]7e-04[/C][C]26448792.9773[/C][C]2204066.0814[/C][C]1484.6097[/C][/ROW]
[ROW][C]63[/C][C]-0.0232[/C][C]-0.0165[/C][C]0.0014[/C][C]94270603.0333[/C][C]7855883.5861[/C][C]2802.8349[/C][/ROW]
[ROW][C]64[/C][C]-0.0265[/C][C]-0.0076[/C][C]6e-04[/C][C]19210028.958[/C][C]1600835.7465[/C][C]1265.2414[/C][/ROW]
[ROW][C]65[/C][C]-0.0293[/C][C]0.0014[/C][C]1e-04[/C][C]644648.0493[/C][C]53720.6708[/C][C]231.7772[/C][/ROW]
[ROW][C]66[/C][C]-0.0321[/C][C]-0.0036[/C][C]3e-04[/C][C]4373984.1398[/C][C]364498.6783[/C][C]603.7373[/C][/ROW]
[ROW][C]67[/C][C]-0.0358[/C][C]-0.0183[/C][C]0.0015[/C][C]133080525.9265[/C][C]11090043.8272[/C][C]3330.1717[/C][/ROW]
[ROW][C]68[/C][C]-0.0384[/C][C]-0.026[/C][C]0.0022[/C][C]279349337.5633[/C][C]23279111.4636[/C][C]4824.8432[/C][/ROW]
[ROW][C]69[/C][C]-0.0406[/C][C]-0.0349[/C][C]0.0029[/C][C]503237354.1022[/C][C]41936446.1752[/C][C]6475.8356[/C][/ROW]
[ROW][C]70[/C][C]-0.0423[/C][C]-0.0667[/C][C]0.0056[/C][C]1766053771.2168[/C][C]147171147.6014[/C][C]12131.4116[/C][/ROW]
[ROW][C]71[/C][C]-0.0438[/C][C]-0.0751[/C][C]0.0063[/C][C]2108959426.4778[/C][C]175746618.8732[/C][C]13256.9461[/C][/ROW]
[ROW][C]72[/C][C]-0.0457[/C][C]-0.0923[/C][C]0.0077[/C][C]3211369172.2311[/C][C]267614097.6859[/C][C]16358.9149[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2897&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2897&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
61-0.0137-0.00595e-0412559882.43191046656.86931023.0625
62-0.0191-0.00867e-0426448792.97732204066.08141484.6097
63-0.0232-0.01650.001494270603.03337855883.58612802.8349
64-0.0265-0.00766e-0419210028.9581600835.74651265.2414
65-0.02930.00141e-04644648.049353720.6708231.7772
66-0.0321-0.00363e-044373984.1398364498.6783603.7373
67-0.0358-0.01830.0015133080525.926511090043.82723330.1717
68-0.0384-0.0260.0022279349337.563323279111.46364824.8432
69-0.0406-0.03490.0029503237354.102241936446.17526475.8356
70-0.0423-0.06670.00561766053771.2168147171147.601412131.4116
71-0.0438-0.07510.00632108959426.4778175746618.873213256.9461
72-0.0457-0.09230.00773211369172.2311267614097.685916358.9149



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