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, 09 Dec 2009 08:21:03 -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/09/t1260372145jgx1b9la9q290sx.htm/, Retrieved Mon, 29 Apr 2024 11:28:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=64992, Retrieved Mon, 29 Apr 2024 11:28:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordssdws paper
Estimated Impact95
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting] [2009-12-09 15:21:03] [2d672adbf8ae6977476cb9852ecac1a3] [Current]
Feedback Forum

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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64992&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[73])
61527070-------
62509846-------
63514258-------
64516922-------
65507561-------
66492622-------
67490243-------
68469357-------
69477580-------
70528379-------
71533590-------
72517945-------
73506174-------
74501866488097.8685475264.4591500931.27780.01770.00294e-040.0029
75516141490346.6125472124.1269508569.0980.00280.10770.00510.0443
76528222493237.1269469847.35516626.90380.00170.02750.02360.1392
77532638486509.4039457397.9056515620.90229e-040.00250.07820.0928
78536322474875.7023440856.5088508894.89582e-044e-040.15330.0357
79536535470297.143431660.2137508934.07234e-044e-040.15580.0344
80523597456664.9053413651.9678499677.84290.00111e-040.28150.012
81536214460907.7602413865.0216507950.49899e-040.00450.24360.0296
82586570513679.7536462841.5518564517.95550.00250.19250.28550.6139
83596594521864.3372467457.3926576271.28180.00350.00990.33640.714
84580523511856.3906454088.7809569624.00020.00990.0020.41820.5764
85564478498346.0341437384.0025559308.06570.01670.00410.40060.4006

\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[73]) \tabularnewline
61 & 527070 & - & - & - & - & - & - & - \tabularnewline
62 & 509846 & - & - & - & - & - & - & - \tabularnewline
63 & 514258 & - & - & - & - & - & - & - \tabularnewline
64 & 516922 & - & - & - & - & - & - & - \tabularnewline
65 & 507561 & - & - & - & - & - & - & - \tabularnewline
66 & 492622 & - & - & - & - & - & - & - \tabularnewline
67 & 490243 & - & - & - & - & - & - & - \tabularnewline
68 & 469357 & - & - & - & - & - & - & - \tabularnewline
69 & 477580 & - & - & - & - & - & - & - \tabularnewline
70 & 528379 & - & - & - & - & - & - & - \tabularnewline
71 & 533590 & - & - & - & - & - & - & - \tabularnewline
72 & 517945 & - & - & - & - & - & - & - \tabularnewline
73 & 506174 & - & - & - & - & - & - & - \tabularnewline
74 & 501866 & 488097.8685 & 475264.4591 & 500931.2778 & 0.0177 & 0.0029 & 4e-04 & 0.0029 \tabularnewline
75 & 516141 & 490346.6125 & 472124.1269 & 508569.098 & 0.0028 & 0.1077 & 0.0051 & 0.0443 \tabularnewline
76 & 528222 & 493237.1269 & 469847.35 & 516626.9038 & 0.0017 & 0.0275 & 0.0236 & 0.1392 \tabularnewline
77 & 532638 & 486509.4039 & 457397.9056 & 515620.9022 & 9e-04 & 0.0025 & 0.0782 & 0.0928 \tabularnewline
78 & 536322 & 474875.7023 & 440856.5088 & 508894.8958 & 2e-04 & 4e-04 & 0.1533 & 0.0357 \tabularnewline
79 & 536535 & 470297.143 & 431660.2137 & 508934.0723 & 4e-04 & 4e-04 & 0.1558 & 0.0344 \tabularnewline
80 & 523597 & 456664.9053 & 413651.9678 & 499677.8429 & 0.0011 & 1e-04 & 0.2815 & 0.012 \tabularnewline
81 & 536214 & 460907.7602 & 413865.0216 & 507950.4989 & 9e-04 & 0.0045 & 0.2436 & 0.0296 \tabularnewline
82 & 586570 & 513679.7536 & 462841.5518 & 564517.9555 & 0.0025 & 0.1925 & 0.2855 & 0.6139 \tabularnewline
83 & 596594 & 521864.3372 & 467457.3926 & 576271.2818 & 0.0035 & 0.0099 & 0.3364 & 0.714 \tabularnewline
84 & 580523 & 511856.3906 & 454088.7809 & 569624.0002 & 0.0099 & 0.002 & 0.4182 & 0.5764 \tabularnewline
85 & 564478 & 498346.0341 & 437384.0025 & 559308.0657 & 0.0167 & 0.0041 & 0.4006 & 0.4006 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64992&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[73])[/C][/ROW]
[ROW][C]61[/C][C]527070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]509846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]514258[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]516922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]507561[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]492622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]490243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]469357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]477580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]528379[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]533590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]517945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]506174[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]501866[/C][C]488097.8685[/C][C]475264.4591[/C][C]500931.2778[/C][C]0.0177[/C][C]0.0029[/C][C]4e-04[/C][C]0.0029[/C][/ROW]
[ROW][C]75[/C][C]516141[/C][C]490346.6125[/C][C]472124.1269[/C][C]508569.098[/C][C]0.0028[/C][C]0.1077[/C][C]0.0051[/C][C]0.0443[/C][/ROW]
[ROW][C]76[/C][C]528222[/C][C]493237.1269[/C][C]469847.35[/C][C]516626.9038[/C][C]0.0017[/C][C]0.0275[/C][C]0.0236[/C][C]0.1392[/C][/ROW]
[ROW][C]77[/C][C]532638[/C][C]486509.4039[/C][C]457397.9056[/C][C]515620.9022[/C][C]9e-04[/C][C]0.0025[/C][C]0.0782[/C][C]0.0928[/C][/ROW]
[ROW][C]78[/C][C]536322[/C][C]474875.7023[/C][C]440856.5088[/C][C]508894.8958[/C][C]2e-04[/C][C]4e-04[/C][C]0.1533[/C][C]0.0357[/C][/ROW]
[ROW][C]79[/C][C]536535[/C][C]470297.143[/C][C]431660.2137[/C][C]508934.0723[/C][C]4e-04[/C][C]4e-04[/C][C]0.1558[/C][C]0.0344[/C][/ROW]
[ROW][C]80[/C][C]523597[/C][C]456664.9053[/C][C]413651.9678[/C][C]499677.8429[/C][C]0.0011[/C][C]1e-04[/C][C]0.2815[/C][C]0.012[/C][/ROW]
[ROW][C]81[/C][C]536214[/C][C]460907.7602[/C][C]413865.0216[/C][C]507950.4989[/C][C]9e-04[/C][C]0.0045[/C][C]0.2436[/C][C]0.0296[/C][/ROW]
[ROW][C]82[/C][C]586570[/C][C]513679.7536[/C][C]462841.5518[/C][C]564517.9555[/C][C]0.0025[/C][C]0.1925[/C][C]0.2855[/C][C]0.6139[/C][/ROW]
[ROW][C]83[/C][C]596594[/C][C]521864.3372[/C][C]467457.3926[/C][C]576271.2818[/C][C]0.0035[/C][C]0.0099[/C][C]0.3364[/C][C]0.714[/C][/ROW]
[ROW][C]84[/C][C]580523[/C][C]511856.3906[/C][C]454088.7809[/C][C]569624.0002[/C][C]0.0099[/C][C]0.002[/C][C]0.4182[/C][C]0.5764[/C][/ROW]
[ROW][C]85[/C][C]564478[/C][C]498346.0341[/C][C]437384.0025[/C][C]559308.0657[/C][C]0.0167[/C][C]0.0041[/C][C]0.4006[/C][C]0.4006[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64992&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64992&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[73])
61527070-------
62509846-------
63514258-------
64516922-------
65507561-------
66492622-------
67490243-------
68469357-------
69477580-------
70528379-------
71533590-------
72517945-------
73506174-------
74501866488097.8685475264.4591500931.27780.01770.00294e-040.0029
75516141490346.6125472124.1269508569.0980.00280.10770.00510.0443
76528222493237.1269469847.35516626.90380.00170.02750.02360.1392
77532638486509.4039457397.9056515620.90229e-040.00250.07820.0928
78536322474875.7023440856.5088508894.89582e-044e-040.15330.0357
79536535470297.143431660.2137508934.07234e-044e-040.15580.0344
80523597456664.9053413651.9678499677.84290.00111e-040.28150.012
81536214460907.7602413865.0216507950.49899e-040.00450.24360.0296
82586570513679.7536462841.5518564517.95550.00250.19250.28550.6139
83596594521864.3372467457.3926576271.28180.00350.00990.33640.714
84580523511856.3906454088.7809569624.00020.00990.0020.41820.5764
85564478498346.0341437384.0025559308.06570.01670.00410.40060.4006







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
740.01340.02820189561446.098200
750.0190.05260.0404665350426.7186427455936.408420675.0075
760.02420.07090.05061223941346.153692951072.989926323.9639
770.03050.09480.06162127847376.58571051675148.888932429.5413
780.03660.12940.07523775647502.55211596469619.621539955.8459
790.04190.14080.08614387453695.94432061633632.34245405.2159
800.04810.14660.09484479905294.46152407101012.644849062.2157
810.05210.16340.10335671029746.11552815092104.328653057.4416
820.05050.14190.10765312988016.62073092636094.583355611.4745
830.05320.14320.11125584522495.97273341824734.722257808.5178
840.05760.13420.11334715103250.05863466668236.116458878.4191
850.06240.13270.11494373436909.1443542232292.202159516.6556

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
74 & 0.0134 & 0.0282 & 0 & 189561446.0982 & 0 & 0 \tabularnewline
75 & 0.019 & 0.0526 & 0.0404 & 665350426.7186 & 427455936.4084 & 20675.0075 \tabularnewline
76 & 0.0242 & 0.0709 & 0.0506 & 1223941346.153 & 692951072.9899 & 26323.9639 \tabularnewline
77 & 0.0305 & 0.0948 & 0.0616 & 2127847376.5857 & 1051675148.8889 & 32429.5413 \tabularnewline
78 & 0.0366 & 0.1294 & 0.0752 & 3775647502.5521 & 1596469619.6215 & 39955.8459 \tabularnewline
79 & 0.0419 & 0.1408 & 0.0861 & 4387453695.9443 & 2061633632.342 & 45405.2159 \tabularnewline
80 & 0.0481 & 0.1466 & 0.0948 & 4479905294.4615 & 2407101012.6448 & 49062.2157 \tabularnewline
81 & 0.0521 & 0.1634 & 0.1033 & 5671029746.1155 & 2815092104.3286 & 53057.4416 \tabularnewline
82 & 0.0505 & 0.1419 & 0.1076 & 5312988016.6207 & 3092636094.5833 & 55611.4745 \tabularnewline
83 & 0.0532 & 0.1432 & 0.1112 & 5584522495.9727 & 3341824734.7222 & 57808.5178 \tabularnewline
84 & 0.0576 & 0.1342 & 0.1133 & 4715103250.0586 & 3466668236.1164 & 58878.4191 \tabularnewline
85 & 0.0624 & 0.1327 & 0.1149 & 4373436909.144 & 3542232292.2021 & 59516.6556 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64992&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]74[/C][C]0.0134[/C][C]0.0282[/C][C]0[/C][C]189561446.0982[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]75[/C][C]0.019[/C][C]0.0526[/C][C]0.0404[/C][C]665350426.7186[/C][C]427455936.4084[/C][C]20675.0075[/C][/ROW]
[ROW][C]76[/C][C]0.0242[/C][C]0.0709[/C][C]0.0506[/C][C]1223941346.153[/C][C]692951072.9899[/C][C]26323.9639[/C][/ROW]
[ROW][C]77[/C][C]0.0305[/C][C]0.0948[/C][C]0.0616[/C][C]2127847376.5857[/C][C]1051675148.8889[/C][C]32429.5413[/C][/ROW]
[ROW][C]78[/C][C]0.0366[/C][C]0.1294[/C][C]0.0752[/C][C]3775647502.5521[/C][C]1596469619.6215[/C][C]39955.8459[/C][/ROW]
[ROW][C]79[/C][C]0.0419[/C][C]0.1408[/C][C]0.0861[/C][C]4387453695.9443[/C][C]2061633632.342[/C][C]45405.2159[/C][/ROW]
[ROW][C]80[/C][C]0.0481[/C][C]0.1466[/C][C]0.0948[/C][C]4479905294.4615[/C][C]2407101012.6448[/C][C]49062.2157[/C][/ROW]
[ROW][C]81[/C][C]0.0521[/C][C]0.1634[/C][C]0.1033[/C][C]5671029746.1155[/C][C]2815092104.3286[/C][C]53057.4416[/C][/ROW]
[ROW][C]82[/C][C]0.0505[/C][C]0.1419[/C][C]0.1076[/C][C]5312988016.6207[/C][C]3092636094.5833[/C][C]55611.4745[/C][/ROW]
[ROW][C]83[/C][C]0.0532[/C][C]0.1432[/C][C]0.1112[/C][C]5584522495.9727[/C][C]3341824734.7222[/C][C]57808.5178[/C][/ROW]
[ROW][C]84[/C][C]0.0576[/C][C]0.1342[/C][C]0.1133[/C][C]4715103250.0586[/C][C]3466668236.1164[/C][C]58878.4191[/C][/ROW]
[ROW][C]85[/C][C]0.0624[/C][C]0.1327[/C][C]0.1149[/C][C]4373436909.144[/C][C]3542232292.2021[/C][C]59516.6556[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64992&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64992&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
740.01340.02820189561446.098200
750.0190.05260.0404665350426.7186427455936.408420675.0075
760.02420.07090.05061223941346.153692951072.989926323.9639
770.03050.09480.06162127847376.58571051675148.888932429.5413
780.03660.12940.07523775647502.55211596469619.621539955.8459
790.04190.14080.08614387453695.94432061633632.34245405.2159
800.04810.14660.09484479905294.46152407101012.644849062.2157
810.05210.16340.10335671029746.11552815092104.328653057.4416
820.05050.14190.10765312988016.62073092636094.583355611.4745
830.05320.14320.11125584522495.97273341824734.722257808.5178
840.05760.13420.11334715103250.05863466668236.116458878.4191
850.06240.13270.11494373436909.1443542232292.202159516.6556



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