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 computationMon, 22 Dec 2008 09:50:50 -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/2008/Dec/22/t1229964677252a4grsiqyvmra.htm/, Retrieved Sun, 12 May 2024 18:58:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36147, Retrieved Sun, 12 May 2024 18:58:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact154
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ARIMA Forecast We...] [2008-12-12 14:48:47] [1ce0d16c8f4225c977b42c8fa93bc163]
-         [ARIMA Forecasting] [] [2008-12-22 16:50:50] [d96f761aa3e94002e7c05c3c847d2c79] [Current]
Feedback Forum

Post a new message
Dataseries X:
492865
480961
461935
456608
441977
439148
488180
520564
501492
485025
464196
460170
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




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36147&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36147&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36147&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'George Udny Yule' @ 72.249.76.132







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[63])
51555332-------
52543599-------
53536662-------
54542722-------
55593530-------
56610763-------
57612613-------
58611324-------
59594167-------
60595454-------
61590865-------
62589379-------
63584428-------
64573100575896.8792561915.3951589878.36330.34750.115910.1159
65567456568540.449548767.6446588313.25350.45720.32560.99920.0576
66569028573559.7083549343.0675597776.34920.35690.68940.99370.1895
67620735628110.8584600147.8902656073.82660.302610.99230.9989
68628884643501.0534612237.5045674764.60230.17970.92320.97990.9999
69628232643779.944609532.4421678027.44590.18680.8030.96280.9997
70612117638913.8234601922.2935675905.35330.07780.71430.92810.9981
71595404621629.3374582083.7286661174.94630.09680.68130.91330.9674
72597141624390.9351582446.4829666335.38740.10140.91220.91180.9691
73593408624326.6778580113.343668540.01260.08520.88590.9310.9615
74590072622627.7281576256.5061668998.95020.08440.89160.920.9468
75579799617166.5774568733.5153665599.63940.06520.86360.90740.9074

\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[63]) \tabularnewline
51 & 555332 & - & - & - & - & - & - & - \tabularnewline
52 & 543599 & - & - & - & - & - & - & - \tabularnewline
53 & 536662 & - & - & - & - & - & - & - \tabularnewline
54 & 542722 & - & - & - & - & - & - & - \tabularnewline
55 & 593530 & - & - & - & - & - & - & - \tabularnewline
56 & 610763 & - & - & - & - & - & - & - \tabularnewline
57 & 612613 & - & - & - & - & - & - & - \tabularnewline
58 & 611324 & - & - & - & - & - & - & - \tabularnewline
59 & 594167 & - & - & - & - & - & - & - \tabularnewline
60 & 595454 & - & - & - & - & - & - & - \tabularnewline
61 & 590865 & - & - & - & - & - & - & - \tabularnewline
62 & 589379 & - & - & - & - & - & - & - \tabularnewline
63 & 584428 & - & - & - & - & - & - & - \tabularnewline
64 & 573100 & 575896.8792 & 561915.3951 & 589878.3633 & 0.3475 & 0.1159 & 1 & 0.1159 \tabularnewline
65 & 567456 & 568540.449 & 548767.6446 & 588313.2535 & 0.4572 & 0.3256 & 0.9992 & 0.0576 \tabularnewline
66 & 569028 & 573559.7083 & 549343.0675 & 597776.3492 & 0.3569 & 0.6894 & 0.9937 & 0.1895 \tabularnewline
67 & 620735 & 628110.8584 & 600147.8902 & 656073.8266 & 0.3026 & 1 & 0.9923 & 0.9989 \tabularnewline
68 & 628884 & 643501.0534 & 612237.5045 & 674764.6023 & 0.1797 & 0.9232 & 0.9799 & 0.9999 \tabularnewline
69 & 628232 & 643779.944 & 609532.4421 & 678027.4459 & 0.1868 & 0.803 & 0.9628 & 0.9997 \tabularnewline
70 & 612117 & 638913.8234 & 601922.2935 & 675905.3533 & 0.0778 & 0.7143 & 0.9281 & 0.9981 \tabularnewline
71 & 595404 & 621629.3374 & 582083.7286 & 661174.9463 & 0.0968 & 0.6813 & 0.9133 & 0.9674 \tabularnewline
72 & 597141 & 624390.9351 & 582446.4829 & 666335.3874 & 0.1014 & 0.9122 & 0.9118 & 0.9691 \tabularnewline
73 & 593408 & 624326.6778 & 580113.343 & 668540.0126 & 0.0852 & 0.8859 & 0.931 & 0.9615 \tabularnewline
74 & 590072 & 622627.7281 & 576256.5061 & 668998.9502 & 0.0844 & 0.8916 & 0.92 & 0.9468 \tabularnewline
75 & 579799 & 617166.5774 & 568733.5153 & 665599.6394 & 0.0652 & 0.8636 & 0.9074 & 0.9074 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36147&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[63])[/C][/ROW]
[ROW][C]51[/C][C]555332[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]543599[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]536662[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]542722[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]593530[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]610763[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]612613[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]611324[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]594167[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]595454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]590865[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]589379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]584428[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]573100[/C][C]575896.8792[/C][C]561915.3951[/C][C]589878.3633[/C][C]0.3475[/C][C]0.1159[/C][C]1[/C][C]0.1159[/C][/ROW]
[ROW][C]65[/C][C]567456[/C][C]568540.449[/C][C]548767.6446[/C][C]588313.2535[/C][C]0.4572[/C][C]0.3256[/C][C]0.9992[/C][C]0.0576[/C][/ROW]
[ROW][C]66[/C][C]569028[/C][C]573559.7083[/C][C]549343.0675[/C][C]597776.3492[/C][C]0.3569[/C][C]0.6894[/C][C]0.9937[/C][C]0.1895[/C][/ROW]
[ROW][C]67[/C][C]620735[/C][C]628110.8584[/C][C]600147.8902[/C][C]656073.8266[/C][C]0.3026[/C][C]1[/C][C]0.9923[/C][C]0.9989[/C][/ROW]
[ROW][C]68[/C][C]628884[/C][C]643501.0534[/C][C]612237.5045[/C][C]674764.6023[/C][C]0.1797[/C][C]0.9232[/C][C]0.9799[/C][C]0.9999[/C][/ROW]
[ROW][C]69[/C][C]628232[/C][C]643779.944[/C][C]609532.4421[/C][C]678027.4459[/C][C]0.1868[/C][C]0.803[/C][C]0.9628[/C][C]0.9997[/C][/ROW]
[ROW][C]70[/C][C]612117[/C][C]638913.8234[/C][C]601922.2935[/C][C]675905.3533[/C][C]0.0778[/C][C]0.7143[/C][C]0.9281[/C][C]0.9981[/C][/ROW]
[ROW][C]71[/C][C]595404[/C][C]621629.3374[/C][C]582083.7286[/C][C]661174.9463[/C][C]0.0968[/C][C]0.6813[/C][C]0.9133[/C][C]0.9674[/C][/ROW]
[ROW][C]72[/C][C]597141[/C][C]624390.9351[/C][C]582446.4829[/C][C]666335.3874[/C][C]0.1014[/C][C]0.9122[/C][C]0.9118[/C][C]0.9691[/C][/ROW]
[ROW][C]73[/C][C]593408[/C][C]624326.6778[/C][C]580113.343[/C][C]668540.0126[/C][C]0.0852[/C][C]0.8859[/C][C]0.931[/C][C]0.9615[/C][/ROW]
[ROW][C]74[/C][C]590072[/C][C]622627.7281[/C][C]576256.5061[/C][C]668998.9502[/C][C]0.0844[/C][C]0.8916[/C][C]0.92[/C][C]0.9468[/C][/ROW]
[ROW][C]75[/C][C]579799[/C][C]617166.5774[/C][C]568733.5153[/C][C]665599.6394[/C][C]0.0652[/C][C]0.8636[/C][C]0.9074[/C][C]0.9074[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36147&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36147&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[63])
51555332-------
52543599-------
53536662-------
54542722-------
55593530-------
56610763-------
57612613-------
58611324-------
59594167-------
60595454-------
61590865-------
62589379-------
63584428-------
64573100575896.8792561915.3951589878.36330.34750.115910.1159
65567456568540.449548767.6446588313.25350.45720.32560.99920.0576
66569028573559.7083549343.0675597776.34920.35690.68940.99370.1895
67620735628110.8584600147.8902656073.82660.302610.99230.9989
68628884643501.0534612237.5045674764.60230.17970.92320.97990.9999
69628232643779.944609532.4421678027.44590.18680.8030.96280.9997
70612117638913.8234601922.2935675905.35330.07780.71430.92810.9981
71595404621629.3374582083.7286661174.94630.09680.68130.91330.9674
72597141624390.9351582446.4829666335.38740.10140.91220.91180.9691
73593408624326.6778580113.343668540.01260.08520.88590.9310.9615
74590072622627.7281576256.5061668998.95020.08440.89160.920.9468
75579799617166.5774568733.5153665599.63940.06520.86360.90740.9074







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.0124-0.00494e-047822533.3384651877.7782807.3895
650.0177-0.00192e-041176029.639498002.47313.0535
660.0215-0.00797e-0420536380.38561711365.03211308.1915
670.0227-0.01170.00154403287.31054533607.27592129.2269
680.0248-0.02270.0019213658250.546417804854.21224219.5799
690.0271-0.02420.002241738562.714520144880.22624488.3048
700.0295-0.04190.0035718069742.907459839145.24237735.5766
710.0325-0.04220.0035687768322.24457314026.85377570.6028
720.0343-0.04360.0036742558965.100561879913.75847866.3787
730.0361-0.04950.0041955964635.708279663719.64238925.4535
740.038-0.05230.00441059875435.101788322952.92519398.0292
750.04-0.06050.0051396335839.74116361319.978310787.0904

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0124 & -0.0049 & 4e-04 & 7822533.3384 & 651877.7782 & 807.3895 \tabularnewline
65 & 0.0177 & -0.0019 & 2e-04 & 1176029.6394 & 98002.47 & 313.0535 \tabularnewline
66 & 0.0215 & -0.0079 & 7e-04 & 20536380.3856 & 1711365.0321 & 1308.1915 \tabularnewline
67 & 0.0227 & -0.0117 & 0.001 & 54403287.3105 & 4533607.2759 & 2129.2269 \tabularnewline
68 & 0.0248 & -0.0227 & 0.0019 & 213658250.5464 & 17804854.2122 & 4219.5799 \tabularnewline
69 & 0.0271 & -0.0242 & 0.002 & 241738562.7145 & 20144880.2262 & 4488.3048 \tabularnewline
70 & 0.0295 & -0.0419 & 0.0035 & 718069742.9074 & 59839145.2423 & 7735.5766 \tabularnewline
71 & 0.0325 & -0.0422 & 0.0035 & 687768322.244 & 57314026.8537 & 7570.6028 \tabularnewline
72 & 0.0343 & -0.0436 & 0.0036 & 742558965.1005 & 61879913.7584 & 7866.3787 \tabularnewline
73 & 0.0361 & -0.0495 & 0.0041 & 955964635.7082 & 79663719.6423 & 8925.4535 \tabularnewline
74 & 0.038 & -0.0523 & 0.0044 & 1059875435.1017 & 88322952.9251 & 9398.0292 \tabularnewline
75 & 0.04 & -0.0605 & 0.005 & 1396335839.74 & 116361319.9783 & 10787.0904 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36147&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]64[/C][C]0.0124[/C][C]-0.0049[/C][C]4e-04[/C][C]7822533.3384[/C][C]651877.7782[/C][C]807.3895[/C][/ROW]
[ROW][C]65[/C][C]0.0177[/C][C]-0.0019[/C][C]2e-04[/C][C]1176029.6394[/C][C]98002.47[/C][C]313.0535[/C][/ROW]
[ROW][C]66[/C][C]0.0215[/C][C]-0.0079[/C][C]7e-04[/C][C]20536380.3856[/C][C]1711365.0321[/C][C]1308.1915[/C][/ROW]
[ROW][C]67[/C][C]0.0227[/C][C]-0.0117[/C][C]0.001[/C][C]54403287.3105[/C][C]4533607.2759[/C][C]2129.2269[/C][/ROW]
[ROW][C]68[/C][C]0.0248[/C][C]-0.0227[/C][C]0.0019[/C][C]213658250.5464[/C][C]17804854.2122[/C][C]4219.5799[/C][/ROW]
[ROW][C]69[/C][C]0.0271[/C][C]-0.0242[/C][C]0.002[/C][C]241738562.7145[/C][C]20144880.2262[/C][C]4488.3048[/C][/ROW]
[ROW][C]70[/C][C]0.0295[/C][C]-0.0419[/C][C]0.0035[/C][C]718069742.9074[/C][C]59839145.2423[/C][C]7735.5766[/C][/ROW]
[ROW][C]71[/C][C]0.0325[/C][C]-0.0422[/C][C]0.0035[/C][C]687768322.244[/C][C]57314026.8537[/C][C]7570.6028[/C][/ROW]
[ROW][C]72[/C][C]0.0343[/C][C]-0.0436[/C][C]0.0036[/C][C]742558965.1005[/C][C]61879913.7584[/C][C]7866.3787[/C][/ROW]
[ROW][C]73[/C][C]0.0361[/C][C]-0.0495[/C][C]0.0041[/C][C]955964635.7082[/C][C]79663719.6423[/C][C]8925.4535[/C][/ROW]
[ROW][C]74[/C][C]0.038[/C][C]-0.0523[/C][C]0.0044[/C][C]1059875435.1017[/C][C]88322952.9251[/C][C]9398.0292[/C][/ROW]
[ROW][C]75[/C][C]0.04[/C][C]-0.0605[/C][C]0.005[/C][C]1396335839.74[/C][C]116361319.9783[/C][C]10787.0904[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36147&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36147&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
640.0124-0.00494e-047822533.3384651877.7782807.3895
650.0177-0.00192e-041176029.639498002.47313.0535
660.0215-0.00797e-0420536380.38561711365.03211308.1915
670.0227-0.01170.00154403287.31054533607.27592129.2269
680.0248-0.02270.0019213658250.546417804854.21224219.5799
690.0271-0.02420.002241738562.714520144880.22624488.3048
700.0295-0.04190.0035718069742.907459839145.24237735.5766
710.0325-0.04220.0035687768322.24457314026.85377570.6028
720.0343-0.04360.0036742558965.100561879913.75847866.3787
730.0361-0.04950.0041955964635.708279663719.64238925.4535
740.038-0.05230.00441059875435.101788322952.92519398.0292
750.04-0.06050.0051396335839.74116361319.978310787.0904



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