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, 16 Dec 2008 03:45:15 -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/16/t1229424573z6l9hb9kp5jkrvp.htm/, Retrieved Wed, 15 May 2024 00:29:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33904, Retrieved Wed, 15 May 2024 00:29:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact237
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [Werkloosheid totalen] [2008-11-28 13:18:02] [6743688719638b0cb1c0a6e0bf433315]
-   P   [Univariate Data Series] [Total unemployment] [2008-12-02 17:54:00] [6743688719638b0cb1c0a6e0bf433315]
- RMP     [(Partial) Autocorrelation Function] [total unemploymen...] [2008-12-03 17:15:32] [6743688719638b0cb1c0a6e0bf433315]
-           [(Partial) Autocorrelation Function] [total unemploymen...] [2008-12-03 17:43:40] [6743688719638b0cb1c0a6e0bf433315]
- RMP         [ARIMA Backward Selection] [total unemployment] [2008-12-15 10:23:09] [6743688719638b0cb1c0a6e0bf433315]
- RMP             [ARIMA Forecasting] [Arima Forec total...] [2008-12-16 10:45:15] [9b05d7ef5dbcfba4217d280d9092f628] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
560576
548854
531673
525919
511038
498662
555362
564591
541657
527070
509846
514258
516922
507561
492622
490243
469357
477580
528379




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 & 2 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33904&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33904&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33904&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'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[49])
37619567-------
38625809-------
39619916-------
40587625-------
41565742-------
42557274-------
43560576-------
44548854-------
45531673-------
46525919-------
47511038-------
48498662-------
49555362-------
50564591559361.8115546133.009572590.6140.21920.723300.7233
51541657551786.304532251.4176571321.19030.15470.099400.3599
52527070521288.309496359.2535546217.36450.32470.054600.0037
53509846497728.8715467795.8773527661.86560.21380.027401e-04
54514258489028.5736454294.3426523762.80470.07730.12011e-041e-04
55516922487928.4905448507.3702527349.61080.07470.09532e-044e-04
56507561475728.0925431686.8542519769.33080.07830.03346e-042e-04
57492622457981.4211409359.1876506603.65450.08130.02280.00150
58490243449360.4376396179.5361502541.33910.06590.05540.00240
59469357435088.0688377360.393492815.74470.12230.03060.0050
60477580423597.1224361328.0635485866.18130.04460.07490.00910
61528379475743.3408934.2698542552.33010.06130.47850.00980.0098

\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[49]) \tabularnewline
37 & 619567 & - & - & - & - & - & - & - \tabularnewline
38 & 625809 & - & - & - & - & - & - & - \tabularnewline
39 & 619916 & - & - & - & - & - & - & - \tabularnewline
40 & 587625 & - & - & - & - & - & - & - \tabularnewline
41 & 565742 & - & - & - & - & - & - & - \tabularnewline
42 & 557274 & - & - & - & - & - & - & - \tabularnewline
43 & 560576 & - & - & - & - & - & - & - \tabularnewline
44 & 548854 & - & - & - & - & - & - & - \tabularnewline
45 & 531673 & - & - & - & - & - & - & - \tabularnewline
46 & 525919 & - & - & - & - & - & - & - \tabularnewline
47 & 511038 & - & - & - & - & - & - & - \tabularnewline
48 & 498662 & - & - & - & - & - & - & - \tabularnewline
49 & 555362 & - & - & - & - & - & - & - \tabularnewline
50 & 564591 & 559361.8115 & 546133.009 & 572590.614 & 0.2192 & 0.7233 & 0 & 0.7233 \tabularnewline
51 & 541657 & 551786.304 & 532251.4176 & 571321.1903 & 0.1547 & 0.0994 & 0 & 0.3599 \tabularnewline
52 & 527070 & 521288.309 & 496359.2535 & 546217.3645 & 0.3247 & 0.0546 & 0 & 0.0037 \tabularnewline
53 & 509846 & 497728.8715 & 467795.8773 & 527661.8656 & 0.2138 & 0.0274 & 0 & 1e-04 \tabularnewline
54 & 514258 & 489028.5736 & 454294.3426 & 523762.8047 & 0.0773 & 0.1201 & 1e-04 & 1e-04 \tabularnewline
55 & 516922 & 487928.4905 & 448507.3702 & 527349.6108 & 0.0747 & 0.0953 & 2e-04 & 4e-04 \tabularnewline
56 & 507561 & 475728.0925 & 431686.8542 & 519769.3308 & 0.0783 & 0.0334 & 6e-04 & 2e-04 \tabularnewline
57 & 492622 & 457981.4211 & 409359.1876 & 506603.6545 & 0.0813 & 0.0228 & 0.0015 & 0 \tabularnewline
58 & 490243 & 449360.4376 & 396179.5361 & 502541.3391 & 0.0659 & 0.0554 & 0.0024 & 0 \tabularnewline
59 & 469357 & 435088.0688 & 377360.393 & 492815.7447 & 0.1223 & 0.0306 & 0.005 & 0 \tabularnewline
60 & 477580 & 423597.1224 & 361328.0635 & 485866.1813 & 0.0446 & 0.0749 & 0.0091 & 0 \tabularnewline
61 & 528379 & 475743.3 & 408934.2698 & 542552.3301 & 0.0613 & 0.4785 & 0.0098 & 0.0098 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33904&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[49])[/C][/ROW]
[ROW][C]37[/C][C]619567[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]625809[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]619916[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]587625[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]565742[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]557274[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]560576[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]548854[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]531673[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]525919[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]511038[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]498662[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]555362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]564591[/C][C]559361.8115[/C][C]546133.009[/C][C]572590.614[/C][C]0.2192[/C][C]0.7233[/C][C]0[/C][C]0.7233[/C][/ROW]
[ROW][C]51[/C][C]541657[/C][C]551786.304[/C][C]532251.4176[/C][C]571321.1903[/C][C]0.1547[/C][C]0.0994[/C][C]0[/C][C]0.3599[/C][/ROW]
[ROW][C]52[/C][C]527070[/C][C]521288.309[/C][C]496359.2535[/C][C]546217.3645[/C][C]0.3247[/C][C]0.0546[/C][C]0[/C][C]0.0037[/C][/ROW]
[ROW][C]53[/C][C]509846[/C][C]497728.8715[/C][C]467795.8773[/C][C]527661.8656[/C][C]0.2138[/C][C]0.0274[/C][C]0[/C][C]1e-04[/C][/ROW]
[ROW][C]54[/C][C]514258[/C][C]489028.5736[/C][C]454294.3426[/C][C]523762.8047[/C][C]0.0773[/C][C]0.1201[/C][C]1e-04[/C][C]1e-04[/C][/ROW]
[ROW][C]55[/C][C]516922[/C][C]487928.4905[/C][C]448507.3702[/C][C]527349.6108[/C][C]0.0747[/C][C]0.0953[/C][C]2e-04[/C][C]4e-04[/C][/ROW]
[ROW][C]56[/C][C]507561[/C][C]475728.0925[/C][C]431686.8542[/C][C]519769.3308[/C][C]0.0783[/C][C]0.0334[/C][C]6e-04[/C][C]2e-04[/C][/ROW]
[ROW][C]57[/C][C]492622[/C][C]457981.4211[/C][C]409359.1876[/C][C]506603.6545[/C][C]0.0813[/C][C]0.0228[/C][C]0.0015[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]490243[/C][C]449360.4376[/C][C]396179.5361[/C][C]502541.3391[/C][C]0.0659[/C][C]0.0554[/C][C]0.0024[/C][C]0[/C][/ROW]
[ROW][C]59[/C][C]469357[/C][C]435088.0688[/C][C]377360.393[/C][C]492815.7447[/C][C]0.1223[/C][C]0.0306[/C][C]0.005[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]477580[/C][C]423597.1224[/C][C]361328.0635[/C][C]485866.1813[/C][C]0.0446[/C][C]0.0749[/C][C]0.0091[/C][C]0[/C][/ROW]
[ROW][C]61[/C][C]528379[/C][C]475743.3[/C][C]408934.2698[/C][C]542552.3301[/C][C]0.0613[/C][C]0.4785[/C][C]0.0098[/C][C]0.0098[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33904&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33904&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[49])
37619567-------
38625809-------
39619916-------
40587625-------
41565742-------
42557274-------
43560576-------
44548854-------
45531673-------
46525919-------
47511038-------
48498662-------
49555362-------
50564591559361.8115546133.009572590.6140.21920.723300.7233
51541657551786.304532251.4176571321.19030.15470.099400.3599
52527070521288.309496359.2535546217.36450.32470.054600.0037
53509846497728.8715467795.8773527661.86560.21380.027401e-04
54514258489028.5736454294.3426523762.80470.07730.12011e-041e-04
55516922487928.4905448507.3702527349.61080.07470.09532e-044e-04
56507561475728.0925431686.8542519769.33080.07830.03346e-042e-04
57492622457981.4211409359.1876506603.65450.08130.02280.00150
58490243449360.4376396179.5361502541.33910.06590.05540.00240
59469357435088.0688377360.393492815.74470.12230.03060.0050
60477580423597.1224361328.0635485866.18130.04460.07490.00910
61528379475743.3408934.2698542552.33010.06130.47850.00980.0098







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.01210.00938e-0427344412.30982278701.02581509.5367
510.0181-0.01840.0015102602798.77368550233.23112924.0782
520.02440.01119e-0433427950.40992785662.53421669.0304
530.03070.02430.002146824803.964912235400.33043497.9137
540.03620.05160.0043636523954.470853043662.87267283.1081
550.04120.05940.005840623591.735570051965.9788369.7053
560.04720.06690.00561013333998.836684444499.90319189.3689
570.05420.07560.00631199969709.743999997475.8129999.8738
580.06040.0910.00761671383907.3238139281992.27711801.7792
590.06770.07880.00661174359643.068597863303.5899892.5883
600.0750.12740.01062914151074.357242845922.863115583.5145
610.07160.11060.00922770516915.2598230876409.60515194.6178

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0121 & 0.0093 & 8e-04 & 27344412.3098 & 2278701.0258 & 1509.5367 \tabularnewline
51 & 0.0181 & -0.0184 & 0.0015 & 102602798.7736 & 8550233.2311 & 2924.0782 \tabularnewline
52 & 0.0244 & 0.0111 & 9e-04 & 33427950.4099 & 2785662.5342 & 1669.0304 \tabularnewline
53 & 0.0307 & 0.0243 & 0.002 & 146824803.9649 & 12235400.3304 & 3497.9137 \tabularnewline
54 & 0.0362 & 0.0516 & 0.0043 & 636523954.4708 & 53043662.8726 & 7283.1081 \tabularnewline
55 & 0.0412 & 0.0594 & 0.005 & 840623591.7355 & 70051965.978 & 8369.7053 \tabularnewline
56 & 0.0472 & 0.0669 & 0.0056 & 1013333998.8366 & 84444499.9031 & 9189.3689 \tabularnewline
57 & 0.0542 & 0.0756 & 0.0063 & 1199969709.7439 & 99997475.812 & 9999.8738 \tabularnewline
58 & 0.0604 & 0.091 & 0.0076 & 1671383907.3238 & 139281992.277 & 11801.7792 \tabularnewline
59 & 0.0677 & 0.0788 & 0.0066 & 1174359643.0685 & 97863303.589 & 9892.5883 \tabularnewline
60 & 0.075 & 0.1274 & 0.0106 & 2914151074.357 & 242845922.8631 & 15583.5145 \tabularnewline
61 & 0.0716 & 0.1106 & 0.0092 & 2770516915.2598 & 230876409.605 & 15194.6178 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33904&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]50[/C][C]0.0121[/C][C]0.0093[/C][C]8e-04[/C][C]27344412.3098[/C][C]2278701.0258[/C][C]1509.5367[/C][/ROW]
[ROW][C]51[/C][C]0.0181[/C][C]-0.0184[/C][C]0.0015[/C][C]102602798.7736[/C][C]8550233.2311[/C][C]2924.0782[/C][/ROW]
[ROW][C]52[/C][C]0.0244[/C][C]0.0111[/C][C]9e-04[/C][C]33427950.4099[/C][C]2785662.5342[/C][C]1669.0304[/C][/ROW]
[ROW][C]53[/C][C]0.0307[/C][C]0.0243[/C][C]0.002[/C][C]146824803.9649[/C][C]12235400.3304[/C][C]3497.9137[/C][/ROW]
[ROW][C]54[/C][C]0.0362[/C][C]0.0516[/C][C]0.0043[/C][C]636523954.4708[/C][C]53043662.8726[/C][C]7283.1081[/C][/ROW]
[ROW][C]55[/C][C]0.0412[/C][C]0.0594[/C][C]0.005[/C][C]840623591.7355[/C][C]70051965.978[/C][C]8369.7053[/C][/ROW]
[ROW][C]56[/C][C]0.0472[/C][C]0.0669[/C][C]0.0056[/C][C]1013333998.8366[/C][C]84444499.9031[/C][C]9189.3689[/C][/ROW]
[ROW][C]57[/C][C]0.0542[/C][C]0.0756[/C][C]0.0063[/C][C]1199969709.7439[/C][C]99997475.812[/C][C]9999.8738[/C][/ROW]
[ROW][C]58[/C][C]0.0604[/C][C]0.091[/C][C]0.0076[/C][C]1671383907.3238[/C][C]139281992.277[/C][C]11801.7792[/C][/ROW]
[ROW][C]59[/C][C]0.0677[/C][C]0.0788[/C][C]0.0066[/C][C]1174359643.0685[/C][C]97863303.589[/C][C]9892.5883[/C][/ROW]
[ROW][C]60[/C][C]0.075[/C][C]0.1274[/C][C]0.0106[/C][C]2914151074.357[/C][C]242845922.8631[/C][C]15583.5145[/C][/ROW]
[ROW][C]61[/C][C]0.0716[/C][C]0.1106[/C][C]0.0092[/C][C]2770516915.2598[/C][C]230876409.605[/C][C]15194.6178[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33904&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33904&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
500.01210.00938e-0427344412.30982278701.02581509.5367
510.0181-0.01840.0015102602798.77368550233.23112924.0782
520.02440.01119e-0433427950.40992785662.53421669.0304
530.03070.02430.002146824803.964912235400.33043497.9137
540.03620.05160.0043636523954.470853043662.87267283.1081
550.04120.05940.005840623591.735570051965.9788369.7053
560.04720.06690.00561013333998.836684444499.90319189.3689
570.05420.07560.00631199969709.743999997475.8129999.8738
580.06040.0910.00761671383907.3238139281992.27711801.7792
590.06770.07880.00661174359643.068597863303.5899892.5883
600.0750.12740.01062914151074.357242845922.863115583.5145
610.07160.11060.00922770516915.2598230876409.60515194.6178



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,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')