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, 29 Dec 2010 14:38:10 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/29/t1293633411jhjt2fv872ytojn.htm/, Retrieved Fri, 03 May 2024 04:04:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116876, Retrieved Fri, 03 May 2024 04:04:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact117
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [Workshop 9- ARIMA...] [2010-12-14 18:21:47] [ed447cc2ebcc70947ad11d93fa385845]
- R PD        [ARIMA Forecasting] [ARIMA Forecasting...] [2010-12-28 12:19:01] [ed447cc2ebcc70947ad11d93fa385845]
-   PD            [ARIMA Forecasting] [] [2010-12-29 14:38:10] [e8bffe463cbaa638f5c41694f8d1de39] [Current]
Feedback Forum

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




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

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

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







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[37])
25501866-------
26506174-------
27517945-------
28533590-------
29528379-------
30477580-------
31469357-------
32490243-------
33492622-------
34507561-------
35516922-------
36514258-------
37509846-------
38527070520645.4517508484.7538532806.14960.15020.95910.99020.9591
39541657536688.8785513141.3546560236.40230.33960.78830.94060.9873
40564591555145.8274520486.3434589805.31140.29660.77720.88860.9948
41555362551785.5453506658.5936596912.49690.43830.2890.84530.9657
42498662502204.6174447353.0128557056.2220.44960.02880.81050.3924
43511038494783.3062430932.9469558633.66550.30890.45260.78250.3219
44525919516196.9473444012.2805588381.61410.39590.55570.75950.5685
45531673518923.2206438994.3924598852.04890.37730.43190.74050.5881
46548854534090.7827446934.6934621246.8720.36990.52170.72460.7072
47560576543602.2136449669.1771637535.25010.36160.45640.71110.7594
48557274541037.2215440719.3453641355.09760.37550.35130.69960.7289
49565742536690.3847430329.9114643050.8580.29620.35220.68960.6896

\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[37]) \tabularnewline
25 & 501866 & - & - & - & - & - & - & - \tabularnewline
26 & 506174 & - & - & - & - & - & - & - \tabularnewline
27 & 517945 & - & - & - & - & - & - & - \tabularnewline
28 & 533590 & - & - & - & - & - & - & - \tabularnewline
29 & 528379 & - & - & - & - & - & - & - \tabularnewline
30 & 477580 & - & - & - & - & - & - & - \tabularnewline
31 & 469357 & - & - & - & - & - & - & - \tabularnewline
32 & 490243 & - & - & - & - & - & - & - \tabularnewline
33 & 492622 & - & - & - & - & - & - & - \tabularnewline
34 & 507561 & - & - & - & - & - & - & - \tabularnewline
35 & 516922 & - & - & - & - & - & - & - \tabularnewline
36 & 514258 & - & - & - & - & - & - & - \tabularnewline
37 & 509846 & - & - & - & - & - & - & - \tabularnewline
38 & 527070 & 520645.4517 & 508484.7538 & 532806.1496 & 0.1502 & 0.9591 & 0.9902 & 0.9591 \tabularnewline
39 & 541657 & 536688.8785 & 513141.3546 & 560236.4023 & 0.3396 & 0.7883 & 0.9406 & 0.9873 \tabularnewline
40 & 564591 & 555145.8274 & 520486.3434 & 589805.3114 & 0.2966 & 0.7772 & 0.8886 & 0.9948 \tabularnewline
41 & 555362 & 551785.5453 & 506658.5936 & 596912.4969 & 0.4383 & 0.289 & 0.8453 & 0.9657 \tabularnewline
42 & 498662 & 502204.6174 & 447353.0128 & 557056.222 & 0.4496 & 0.0288 & 0.8105 & 0.3924 \tabularnewline
43 & 511038 & 494783.3062 & 430932.9469 & 558633.6655 & 0.3089 & 0.4526 & 0.7825 & 0.3219 \tabularnewline
44 & 525919 & 516196.9473 & 444012.2805 & 588381.6141 & 0.3959 & 0.5557 & 0.7595 & 0.5685 \tabularnewline
45 & 531673 & 518923.2206 & 438994.3924 & 598852.0489 & 0.3773 & 0.4319 & 0.7405 & 0.5881 \tabularnewline
46 & 548854 & 534090.7827 & 446934.6934 & 621246.872 & 0.3699 & 0.5217 & 0.7246 & 0.7072 \tabularnewline
47 & 560576 & 543602.2136 & 449669.1771 & 637535.2501 & 0.3616 & 0.4564 & 0.7111 & 0.7594 \tabularnewline
48 & 557274 & 541037.2215 & 440719.3453 & 641355.0976 & 0.3755 & 0.3513 & 0.6996 & 0.7289 \tabularnewline
49 & 565742 & 536690.3847 & 430329.9114 & 643050.858 & 0.2962 & 0.3522 & 0.6896 & 0.6896 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116876&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[37])[/C][/ROW]
[ROW][C]25[/C][C]501866[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]506174[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]517945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]533590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]528379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]477580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]469357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]490243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]492622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]507561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]516922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]514258[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]509846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]527070[/C][C]520645.4517[/C][C]508484.7538[/C][C]532806.1496[/C][C]0.1502[/C][C]0.9591[/C][C]0.9902[/C][C]0.9591[/C][/ROW]
[ROW][C]39[/C][C]541657[/C][C]536688.8785[/C][C]513141.3546[/C][C]560236.4023[/C][C]0.3396[/C][C]0.7883[/C][C]0.9406[/C][C]0.9873[/C][/ROW]
[ROW][C]40[/C][C]564591[/C][C]555145.8274[/C][C]520486.3434[/C][C]589805.3114[/C][C]0.2966[/C][C]0.7772[/C][C]0.8886[/C][C]0.9948[/C][/ROW]
[ROW][C]41[/C][C]555362[/C][C]551785.5453[/C][C]506658.5936[/C][C]596912.4969[/C][C]0.4383[/C][C]0.289[/C][C]0.8453[/C][C]0.9657[/C][/ROW]
[ROW][C]42[/C][C]498662[/C][C]502204.6174[/C][C]447353.0128[/C][C]557056.222[/C][C]0.4496[/C][C]0.0288[/C][C]0.8105[/C][C]0.3924[/C][/ROW]
[ROW][C]43[/C][C]511038[/C][C]494783.3062[/C][C]430932.9469[/C][C]558633.6655[/C][C]0.3089[/C][C]0.4526[/C][C]0.7825[/C][C]0.3219[/C][/ROW]
[ROW][C]44[/C][C]525919[/C][C]516196.9473[/C][C]444012.2805[/C][C]588381.6141[/C][C]0.3959[/C][C]0.5557[/C][C]0.7595[/C][C]0.5685[/C][/ROW]
[ROW][C]45[/C][C]531673[/C][C]518923.2206[/C][C]438994.3924[/C][C]598852.0489[/C][C]0.3773[/C][C]0.4319[/C][C]0.7405[/C][C]0.5881[/C][/ROW]
[ROW][C]46[/C][C]548854[/C][C]534090.7827[/C][C]446934.6934[/C][C]621246.872[/C][C]0.3699[/C][C]0.5217[/C][C]0.7246[/C][C]0.7072[/C][/ROW]
[ROW][C]47[/C][C]560576[/C][C]543602.2136[/C][C]449669.1771[/C][C]637535.2501[/C][C]0.3616[/C][C]0.4564[/C][C]0.7111[/C][C]0.7594[/C][/ROW]
[ROW][C]48[/C][C]557274[/C][C]541037.2215[/C][C]440719.3453[/C][C]641355.0976[/C][C]0.3755[/C][C]0.3513[/C][C]0.6996[/C][C]0.7289[/C][/ROW]
[ROW][C]49[/C][C]565742[/C][C]536690.3847[/C][C]430329.9114[/C][C]643050.858[/C][C]0.2962[/C][C]0.3522[/C][C]0.6896[/C][C]0.6896[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116876&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116876&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[37])
25501866-------
26506174-------
27517945-------
28533590-------
29528379-------
30477580-------
31469357-------
32490243-------
33492622-------
34507561-------
35516922-------
36514258-------
37509846-------
38527070520645.4517508484.7538532806.14960.15020.95910.99020.9591
39541657536688.8785513141.3546560236.40230.33960.78830.94060.9873
40564591555145.8274520486.3434589805.31140.29660.77720.88860.9948
41555362551785.5453506658.5936596912.49690.43830.2890.84530.9657
42498662502204.6174447353.0128557056.2220.44960.02880.81050.3924
43511038494783.3062430932.9469558633.66550.30890.45260.78250.3219
44525919516196.9473444012.2805588381.61410.39590.55570.75950.5685
45531673518923.2206438994.3924598852.04890.37730.43190.74050.5881
46548854534090.7827446934.6934621246.8720.36990.52170.72460.7072
47560576543602.2136449669.1771637535.25010.36160.45640.71110.7594
48557274541037.2215440719.3453641355.09760.37550.35130.69960.7289
49565742536690.3847430329.9114643050.8580.29620.35220.68960.6896







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
380.01190.0123041274820.824600
390.02240.00930.010824682231.534632978526.17965742.6933
400.03190.0170.012989211285.979451722779.44627191.8551
410.04170.00650.011312791028.542741989841.72036479.9569
420.0557-0.00710.010412550138.179136101901.01216008.4858
430.06580.03290.0142264215069.9474120762.50018609.3416
440.07130.01880.014894518308.446677034697.63538776.9412
450.07860.02460.0161162556874.088587724969.69199366.1609
460.08330.02760.0173217952584.4465102194704.664710109.1397
470.08820.03120.0187288109424.6459120786176.662810990.2765
480.09460.030.0198263632976.3092133772249.357911565.9954
490.10110.05410.0226843996350.2872192957591.10213890.9176

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
38 & 0.0119 & 0.0123 & 0 & 41274820.8246 & 0 & 0 \tabularnewline
39 & 0.0224 & 0.0093 & 0.0108 & 24682231.5346 & 32978526.1796 & 5742.6933 \tabularnewline
40 & 0.0319 & 0.017 & 0.0129 & 89211285.9794 & 51722779.4462 & 7191.8551 \tabularnewline
41 & 0.0417 & 0.0065 & 0.0113 & 12791028.5427 & 41989841.7203 & 6479.9569 \tabularnewline
42 & 0.0557 & -0.0071 & 0.0104 & 12550138.1791 & 36101901.0121 & 6008.4858 \tabularnewline
43 & 0.0658 & 0.0329 & 0.0142 & 264215069.94 & 74120762.5001 & 8609.3416 \tabularnewline
44 & 0.0713 & 0.0188 & 0.0148 & 94518308.4466 & 77034697.6353 & 8776.9412 \tabularnewline
45 & 0.0786 & 0.0246 & 0.0161 & 162556874.0885 & 87724969.6919 & 9366.1609 \tabularnewline
46 & 0.0833 & 0.0276 & 0.0173 & 217952584.4465 & 102194704.6647 & 10109.1397 \tabularnewline
47 & 0.0882 & 0.0312 & 0.0187 & 288109424.6459 & 120786176.6628 & 10990.2765 \tabularnewline
48 & 0.0946 & 0.03 & 0.0198 & 263632976.3092 & 133772249.3579 & 11565.9954 \tabularnewline
49 & 0.1011 & 0.0541 & 0.0226 & 843996350.2872 & 192957591.102 & 13890.9176 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116876&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]38[/C][C]0.0119[/C][C]0.0123[/C][C]0[/C][C]41274820.8246[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]39[/C][C]0.0224[/C][C]0.0093[/C][C]0.0108[/C][C]24682231.5346[/C][C]32978526.1796[/C][C]5742.6933[/C][/ROW]
[ROW][C]40[/C][C]0.0319[/C][C]0.017[/C][C]0.0129[/C][C]89211285.9794[/C][C]51722779.4462[/C][C]7191.8551[/C][/ROW]
[ROW][C]41[/C][C]0.0417[/C][C]0.0065[/C][C]0.0113[/C][C]12791028.5427[/C][C]41989841.7203[/C][C]6479.9569[/C][/ROW]
[ROW][C]42[/C][C]0.0557[/C][C]-0.0071[/C][C]0.0104[/C][C]12550138.1791[/C][C]36101901.0121[/C][C]6008.4858[/C][/ROW]
[ROW][C]43[/C][C]0.0658[/C][C]0.0329[/C][C]0.0142[/C][C]264215069.94[/C][C]74120762.5001[/C][C]8609.3416[/C][/ROW]
[ROW][C]44[/C][C]0.0713[/C][C]0.0188[/C][C]0.0148[/C][C]94518308.4466[/C][C]77034697.6353[/C][C]8776.9412[/C][/ROW]
[ROW][C]45[/C][C]0.0786[/C][C]0.0246[/C][C]0.0161[/C][C]162556874.0885[/C][C]87724969.6919[/C][C]9366.1609[/C][/ROW]
[ROW][C]46[/C][C]0.0833[/C][C]0.0276[/C][C]0.0173[/C][C]217952584.4465[/C][C]102194704.6647[/C][C]10109.1397[/C][/ROW]
[ROW][C]47[/C][C]0.0882[/C][C]0.0312[/C][C]0.0187[/C][C]288109424.6459[/C][C]120786176.6628[/C][C]10990.2765[/C][/ROW]
[ROW][C]48[/C][C]0.0946[/C][C]0.03[/C][C]0.0198[/C][C]263632976.3092[/C][C]133772249.3579[/C][C]11565.9954[/C][/ROW]
[ROW][C]49[/C][C]0.1011[/C][C]0.0541[/C][C]0.0226[/C][C]843996350.2872[/C][C]192957591.102[/C][C]13890.9176[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116876&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116876&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
380.01190.0123041274820.824600
390.02240.00930.010824682231.534632978526.17965742.6933
400.03190.0170.012989211285.979451722779.44627191.8551
410.04170.00650.011312791028.542741989841.72036479.9569
420.0557-0.00710.010412550138.179136101901.01216008.4858
430.06580.03290.0142264215069.9474120762.50018609.3416
440.07130.01880.014894518308.446677034697.63538776.9412
450.07860.02460.0161162556874.088587724969.69199366.1609
460.08330.02760.0173217952584.4465102194704.664710109.1397
470.08820.03120.0187288109424.6459120786176.662810990.2765
480.09460.030.0198263632976.3092133772249.357911565.9954
490.10110.05410.0226843996350.2872192957591.10213890.9176



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 = 1 ; par7 = 0 ; 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')