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 computationTue, 29 Dec 2009 04:07:09 -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/29/t1262084897mu67m3pl7jhenhs.htm/, Retrieved Fri, 03 May 2024 11:43:46 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71092, Retrieved Fri, 03 May 2024 11:43:46 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact176
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- RMP   [ARIMA Backward Selection] [] [2009-12-11 11:25:07] [9b30bff5dd5a100f8196daf92e735633]
- RM D      [ARIMA Forecasting] [] [2009-12-29 11:07:09] [54e293c1fb7c46e2abc5c1dda68d8adb] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
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
596594
580523




Summary of computational 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 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71092&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71092&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71092&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'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[61])
49541657-------
50527070-------
51509846-------
52514258-------
53516922-------
54507561-------
55492622-------
56490243-------
57469357-------
58477580-------
59528379-------
60533590-------
61517945-------
62506174502089.3292488193.0138515985.64460.28230.01272e-040.0127
63501866483276.443463594.3761502958.50990.03210.01130.00413e-04
64516141485925.4962460931.7301510919.26240.00890.10560.01310.006
65528222487824.4971457136.6888518512.30550.00490.03530.03160.0272
66532638480585.5501445022.7522516148.34810.00210.00430.06850.0197
67536322468221.3412428145.1973508297.48514e-048e-040.11640.0075
68536535462788.6863418478.0358507099.33696e-046e-040.11230.0073
69523597447946.9959399743.1008496150.8910.0012e-040.1920.0022
70536214452439.144400586.0179504292.27028e-040.00360.1710.0066
71586570503413.261448137.3403558689.18180.00160.12240.1880.3032
72596594511230.9106452732.2644569729.55680.00210.00580.22690.411
73580523500175.701438614.8275561736.57450.00530.00110.28580.2858

\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[61]) \tabularnewline
49 & 541657 & - & - & - & - & - & - & - \tabularnewline
50 & 527070 & - & - & - & - & - & - & - \tabularnewline
51 & 509846 & - & - & - & - & - & - & - \tabularnewline
52 & 514258 & - & - & - & - & - & - & - \tabularnewline
53 & 516922 & - & - & - & - & - & - & - \tabularnewline
54 & 507561 & - & - & - & - & - & - & - \tabularnewline
55 & 492622 & - & - & - & - & - & - & - \tabularnewline
56 & 490243 & - & - & - & - & - & - & - \tabularnewline
57 & 469357 & - & - & - & - & - & - & - \tabularnewline
58 & 477580 & - & - & - & - & - & - & - \tabularnewline
59 & 528379 & - & - & - & - & - & - & - \tabularnewline
60 & 533590 & - & - & - & - & - & - & - \tabularnewline
61 & 517945 & - & - & - & - & - & - & - \tabularnewline
62 & 506174 & 502089.3292 & 488193.0138 & 515985.6446 & 0.2823 & 0.0127 & 2e-04 & 0.0127 \tabularnewline
63 & 501866 & 483276.443 & 463594.3761 & 502958.5099 & 0.0321 & 0.0113 & 0.0041 & 3e-04 \tabularnewline
64 & 516141 & 485925.4962 & 460931.7301 & 510919.2624 & 0.0089 & 0.1056 & 0.0131 & 0.006 \tabularnewline
65 & 528222 & 487824.4971 & 457136.6888 & 518512.3055 & 0.0049 & 0.0353 & 0.0316 & 0.0272 \tabularnewline
66 & 532638 & 480585.5501 & 445022.7522 & 516148.3481 & 0.0021 & 0.0043 & 0.0685 & 0.0197 \tabularnewline
67 & 536322 & 468221.3412 & 428145.1973 & 508297.4851 & 4e-04 & 8e-04 & 0.1164 & 0.0075 \tabularnewline
68 & 536535 & 462788.6863 & 418478.0358 & 507099.3369 & 6e-04 & 6e-04 & 0.1123 & 0.0073 \tabularnewline
69 & 523597 & 447946.9959 & 399743.1008 & 496150.891 & 0.001 & 2e-04 & 0.192 & 0.0022 \tabularnewline
70 & 536214 & 452439.144 & 400586.0179 & 504292.2702 & 8e-04 & 0.0036 & 0.171 & 0.0066 \tabularnewline
71 & 586570 & 503413.261 & 448137.3403 & 558689.1818 & 0.0016 & 0.1224 & 0.188 & 0.3032 \tabularnewline
72 & 596594 & 511230.9106 & 452732.2644 & 569729.5568 & 0.0021 & 0.0058 & 0.2269 & 0.411 \tabularnewline
73 & 580523 & 500175.701 & 438614.8275 & 561736.5745 & 0.0053 & 0.0011 & 0.2858 & 0.2858 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71092&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[61])[/C][/ROW]
[ROW][C]49[/C][C]541657[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]527070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]509846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]514258[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]516922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]507561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]492622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]490243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]469357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]477580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]528379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]533590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]517945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]506174[/C][C]502089.3292[/C][C]488193.0138[/C][C]515985.6446[/C][C]0.2823[/C][C]0.0127[/C][C]2e-04[/C][C]0.0127[/C][/ROW]
[ROW][C]63[/C][C]501866[/C][C]483276.443[/C][C]463594.3761[/C][C]502958.5099[/C][C]0.0321[/C][C]0.0113[/C][C]0.0041[/C][C]3e-04[/C][/ROW]
[ROW][C]64[/C][C]516141[/C][C]485925.4962[/C][C]460931.7301[/C][C]510919.2624[/C][C]0.0089[/C][C]0.1056[/C][C]0.0131[/C][C]0.006[/C][/ROW]
[ROW][C]65[/C][C]528222[/C][C]487824.4971[/C][C]457136.6888[/C][C]518512.3055[/C][C]0.0049[/C][C]0.0353[/C][C]0.0316[/C][C]0.0272[/C][/ROW]
[ROW][C]66[/C][C]532638[/C][C]480585.5501[/C][C]445022.7522[/C][C]516148.3481[/C][C]0.0021[/C][C]0.0043[/C][C]0.0685[/C][C]0.0197[/C][/ROW]
[ROW][C]67[/C][C]536322[/C][C]468221.3412[/C][C]428145.1973[/C][C]508297.4851[/C][C]4e-04[/C][C]8e-04[/C][C]0.1164[/C][C]0.0075[/C][/ROW]
[ROW][C]68[/C][C]536535[/C][C]462788.6863[/C][C]418478.0358[/C][C]507099.3369[/C][C]6e-04[/C][C]6e-04[/C][C]0.1123[/C][C]0.0073[/C][/ROW]
[ROW][C]69[/C][C]523597[/C][C]447946.9959[/C][C]399743.1008[/C][C]496150.891[/C][C]0.001[/C][C]2e-04[/C][C]0.192[/C][C]0.0022[/C][/ROW]
[ROW][C]70[/C][C]536214[/C][C]452439.144[/C][C]400586.0179[/C][C]504292.2702[/C][C]8e-04[/C][C]0.0036[/C][C]0.171[/C][C]0.0066[/C][/ROW]
[ROW][C]71[/C][C]586570[/C][C]503413.261[/C][C]448137.3403[/C][C]558689.1818[/C][C]0.0016[/C][C]0.1224[/C][C]0.188[/C][C]0.3032[/C][/ROW]
[ROW][C]72[/C][C]596594[/C][C]511230.9106[/C][C]452732.2644[/C][C]569729.5568[/C][C]0.0021[/C][C]0.0058[/C][C]0.2269[/C][C]0.411[/C][/ROW]
[ROW][C]73[/C][C]580523[/C][C]500175.701[/C][C]438614.8275[/C][C]561736.5745[/C][C]0.0053[/C][C]0.0011[/C][C]0.2858[/C][C]0.2858[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71092&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71092&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[61])
49541657-------
50527070-------
51509846-------
52514258-------
53516922-------
54507561-------
55492622-------
56490243-------
57469357-------
58477580-------
59528379-------
60533590-------
61517945-------
62506174502089.3292488193.0138515985.64460.28230.01272e-040.0127
63501866483276.443463594.3761502958.50990.03210.01130.00413e-04
64516141485925.4962460931.7301510919.26240.00890.10560.01310.006
65528222487824.4971457136.6888518512.30550.00490.03530.03160.0272
66532638480585.5501445022.7522516148.34810.00210.00430.06850.0197
67536322468221.3412428145.1973508297.48514e-048e-040.11640.0075
68536535462788.6863418478.0358507099.33696e-046e-040.11230.0073
69523597447946.9959399743.1008496150.8910.0012e-040.1920.0022
70536214452439.144400586.0179504292.27028e-040.00360.1710.0066
71586570503413.261448137.3403558689.18180.00160.12240.1880.3032
72596594511230.9106452732.2644569729.55680.00210.00580.22690.411
73580523500175.701438614.8275561736.57450.00530.00110.28580.2858







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
620.01410.0081016684535.81900
630.02080.03850.0233345571629.7645181128082.791813458.3834
640.02620.06220.0363912976667.8328425077611.138820617.4104
650.03210.08280.04791631958238.7561726797768.043126959.1871
660.03780.10830.062709457537.1551123329721.865533516.1114
670.04370.14540.07424637699730.21911709058056.591141340.7554
680.04890.15940.08645438518780.3182241838159.980747348.0534
690.05490.16890.09675722923118.54642676973779.801451739.4799
700.05850.18520.10657018226491.93423159335192.260656207.9638
710.0560.16520.11246915043238.56953534905996.891559455.0755
720.05840.1670.11747286857029.75473875992454.424562257.4691
730.06280.16060.1216455688457.31034090967121.331663960.6685

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
62 & 0.0141 & 0.0081 & 0 & 16684535.819 & 0 & 0 \tabularnewline
63 & 0.0208 & 0.0385 & 0.0233 & 345571629.7645 & 181128082.7918 & 13458.3834 \tabularnewline
64 & 0.0262 & 0.0622 & 0.0363 & 912976667.8328 & 425077611.1388 & 20617.4104 \tabularnewline
65 & 0.0321 & 0.0828 & 0.0479 & 1631958238.7561 & 726797768.0431 & 26959.1871 \tabularnewline
66 & 0.0378 & 0.1083 & 0.06 & 2709457537.155 & 1123329721.8655 & 33516.1114 \tabularnewline
67 & 0.0437 & 0.1454 & 0.0742 & 4637699730.2191 & 1709058056.5911 & 41340.7554 \tabularnewline
68 & 0.0489 & 0.1594 & 0.0864 & 5438518780.318 & 2241838159.9807 & 47348.0534 \tabularnewline
69 & 0.0549 & 0.1689 & 0.0967 & 5722923118.5464 & 2676973779.8014 & 51739.4799 \tabularnewline
70 & 0.0585 & 0.1852 & 0.1065 & 7018226491.9342 & 3159335192.2606 & 56207.9638 \tabularnewline
71 & 0.056 & 0.1652 & 0.1124 & 6915043238.5695 & 3534905996.8915 & 59455.0755 \tabularnewline
72 & 0.0584 & 0.167 & 0.1174 & 7286857029.7547 & 3875992454.4245 & 62257.4691 \tabularnewline
73 & 0.0628 & 0.1606 & 0.121 & 6455688457.3103 & 4090967121.3316 & 63960.6685 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71092&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]62[/C][C]0.0141[/C][C]0.0081[/C][C]0[/C][C]16684535.819[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]63[/C][C]0.0208[/C][C]0.0385[/C][C]0.0233[/C][C]345571629.7645[/C][C]181128082.7918[/C][C]13458.3834[/C][/ROW]
[ROW][C]64[/C][C]0.0262[/C][C]0.0622[/C][C]0.0363[/C][C]912976667.8328[/C][C]425077611.1388[/C][C]20617.4104[/C][/ROW]
[ROW][C]65[/C][C]0.0321[/C][C]0.0828[/C][C]0.0479[/C][C]1631958238.7561[/C][C]726797768.0431[/C][C]26959.1871[/C][/ROW]
[ROW][C]66[/C][C]0.0378[/C][C]0.1083[/C][C]0.06[/C][C]2709457537.155[/C][C]1123329721.8655[/C][C]33516.1114[/C][/ROW]
[ROW][C]67[/C][C]0.0437[/C][C]0.1454[/C][C]0.0742[/C][C]4637699730.2191[/C][C]1709058056.5911[/C][C]41340.7554[/C][/ROW]
[ROW][C]68[/C][C]0.0489[/C][C]0.1594[/C][C]0.0864[/C][C]5438518780.318[/C][C]2241838159.9807[/C][C]47348.0534[/C][/ROW]
[ROW][C]69[/C][C]0.0549[/C][C]0.1689[/C][C]0.0967[/C][C]5722923118.5464[/C][C]2676973779.8014[/C][C]51739.4799[/C][/ROW]
[ROW][C]70[/C][C]0.0585[/C][C]0.1852[/C][C]0.1065[/C][C]7018226491.9342[/C][C]3159335192.2606[/C][C]56207.9638[/C][/ROW]
[ROW][C]71[/C][C]0.056[/C][C]0.1652[/C][C]0.1124[/C][C]6915043238.5695[/C][C]3534905996.8915[/C][C]59455.0755[/C][/ROW]
[ROW][C]72[/C][C]0.0584[/C][C]0.167[/C][C]0.1174[/C][C]7286857029.7547[/C][C]3875992454.4245[/C][C]62257.4691[/C][/ROW]
[ROW][C]73[/C][C]0.0628[/C][C]0.1606[/C][C]0.121[/C][C]6455688457.3103[/C][C]4090967121.3316[/C][C]63960.6685[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71092&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71092&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
620.01410.0081016684535.81900
630.02080.03850.0233345571629.7645181128082.791813458.3834
640.02620.06220.0363912976667.8328425077611.138820617.4104
650.03210.08280.04791631958238.7561726797768.043126959.1871
660.03780.10830.062709457537.1551123329721.865533516.1114
670.04370.14540.07424637699730.21911709058056.591141340.7554
680.04890.15940.08645438518780.3182241838159.980747348.0534
690.05490.16890.09675722923118.54642676973779.801451739.4799
700.05850.18520.10657018226491.93423159335192.260656207.9638
710.0560.16520.11246915043238.56953534905996.891559455.0755
720.05840.1670.11747286857029.75473875992454.424562257.4691
730.06280.16060.1216455688457.31034090967121.331663960.6685



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