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 computationFri, 11 Dec 2009 02:35: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/11/t1260524269q10dl7y9nmrewa7.htm/, Retrieved Mon, 29 Apr 2024 02:34:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65920, Retrieved Mon, 29 Apr 2024 02:34:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
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   [Exponential Smoothing] [] [2009-11-27 15:04:36] [b98453cac15ba1066b407e146608df68]
- RMPD    [ARIMA Forecasting] [] [2009-12-03 17:32:19] [315ba876df544ad397193b5931d5f354]
-   P         [ARIMA Forecasting] [Forecasting] [2009-12-11 09:35:03] [950726a732ba3ca782ecb1a5307d0f6f] [Current]
Feedback Forum

Post a new message
Dataseries X:
13132.1
17665.9
16913
17318.8
16224.2
15469.6
16557.5
19414.8
17335
16525.2
18160.4
15553.8
15262.2
18581
17564.1
18948.6
17187.8
17564.8
17668.4
20811.7
17257.8
18984.2
20532.6
17082.3
16894.9
20274.9
20078.6
19900.9
17012.2
19642.9
19024
21691
18835.9
19873.4
21468.2
19406.8
18385.3
20739.3
22268.3
21569
17514.8
21124.7
21251
21393
22145.2
20310.5
23466.9
21264.6
18388.1
22635.4
22014.3
18422.7
16120.2
16037.7
16410.7
17749.8
16349.8
15662.3
17782.3
16398.9




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65920&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]3 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=65920&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65920&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 time3 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[48])
3619406.8-------
3718385.3-------
3820739.3-------
3922268.3-------
4021569-------
4117514.8-------
4221124.7-------
4321251-------
4421393-------
4522145.2-------
4620310.5-------
4723466.9-------
4821264.6-------
4918388.120354.944218795.185721914.70280.00670.12650.99330.1265
5022635.422001.401720430.237423572.5660.214510.94230.821
5122014.324161.37122539.303825783.43830.00470.96740.98890.9998
5218422.723504.306321751.322325257.290300.95210.98480.9939
5316120.219345.59617516.162121175.02983e-040.83860.97510.0199
5416037.722925.225321083.307324767.1432010.97230.9614
5516410.723273.213421340.922825205.5039010.97990.9792
5617749.822884.264220889.138424879.3899010.92850.9442
5716349.824188.451822155.471726221.4319010.97560.9976
5815662.322123.731520043.674424203.7886010.95620.7909
5917782.325680.343523538.539427822.1477010.97861
6016398.923070.018620885.577825254.4594010.94740.9474

\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[48]) \tabularnewline
36 & 19406.8 & - & - & - & - & - & - & - \tabularnewline
37 & 18385.3 & - & - & - & - & - & - & - \tabularnewline
38 & 20739.3 & - & - & - & - & - & - & - \tabularnewline
39 & 22268.3 & - & - & - & - & - & - & - \tabularnewline
40 & 21569 & - & - & - & - & - & - & - \tabularnewline
41 & 17514.8 & - & - & - & - & - & - & - \tabularnewline
42 & 21124.7 & - & - & - & - & - & - & - \tabularnewline
43 & 21251 & - & - & - & - & - & - & - \tabularnewline
44 & 21393 & - & - & - & - & - & - & - \tabularnewline
45 & 22145.2 & - & - & - & - & - & - & - \tabularnewline
46 & 20310.5 & - & - & - & - & - & - & - \tabularnewline
47 & 23466.9 & - & - & - & - & - & - & - \tabularnewline
48 & 21264.6 & - & - & - & - & - & - & - \tabularnewline
49 & 18388.1 & 20354.9442 & 18795.1857 & 21914.7028 & 0.0067 & 0.1265 & 0.9933 & 0.1265 \tabularnewline
50 & 22635.4 & 22001.4017 & 20430.2374 & 23572.566 & 0.2145 & 1 & 0.9423 & 0.821 \tabularnewline
51 & 22014.3 & 24161.371 & 22539.3038 & 25783.4383 & 0.0047 & 0.9674 & 0.9889 & 0.9998 \tabularnewline
52 & 18422.7 & 23504.3063 & 21751.3223 & 25257.2903 & 0 & 0.9521 & 0.9848 & 0.9939 \tabularnewline
53 & 16120.2 & 19345.596 & 17516.1621 & 21175.0298 & 3e-04 & 0.8386 & 0.9751 & 0.0199 \tabularnewline
54 & 16037.7 & 22925.2253 & 21083.3073 & 24767.1432 & 0 & 1 & 0.9723 & 0.9614 \tabularnewline
55 & 16410.7 & 23273.2134 & 21340.9228 & 25205.5039 & 0 & 1 & 0.9799 & 0.9792 \tabularnewline
56 & 17749.8 & 22884.2642 & 20889.1384 & 24879.3899 & 0 & 1 & 0.9285 & 0.9442 \tabularnewline
57 & 16349.8 & 24188.4518 & 22155.4717 & 26221.4319 & 0 & 1 & 0.9756 & 0.9976 \tabularnewline
58 & 15662.3 & 22123.7315 & 20043.6744 & 24203.7886 & 0 & 1 & 0.9562 & 0.7909 \tabularnewline
59 & 17782.3 & 25680.3435 & 23538.5394 & 27822.1477 & 0 & 1 & 0.9786 & 1 \tabularnewline
60 & 16398.9 & 23070.0186 & 20885.5778 & 25254.4594 & 0 & 1 & 0.9474 & 0.9474 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65920&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[48])[/C][/ROW]
[ROW][C]36[/C][C]19406.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18385.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]20739.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]22268.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21569[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17514.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21124.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]21251[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]21393[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]22145.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]20310.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]23466.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]21264.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]18388.1[/C][C]20354.9442[/C][C]18795.1857[/C][C]21914.7028[/C][C]0.0067[/C][C]0.1265[/C][C]0.9933[/C][C]0.1265[/C][/ROW]
[ROW][C]50[/C][C]22635.4[/C][C]22001.4017[/C][C]20430.2374[/C][C]23572.566[/C][C]0.2145[/C][C]1[/C][C]0.9423[/C][C]0.821[/C][/ROW]
[ROW][C]51[/C][C]22014.3[/C][C]24161.371[/C][C]22539.3038[/C][C]25783.4383[/C][C]0.0047[/C][C]0.9674[/C][C]0.9889[/C][C]0.9998[/C][/ROW]
[ROW][C]52[/C][C]18422.7[/C][C]23504.3063[/C][C]21751.3223[/C][C]25257.2903[/C][C]0[/C][C]0.9521[/C][C]0.9848[/C][C]0.9939[/C][/ROW]
[ROW][C]53[/C][C]16120.2[/C][C]19345.596[/C][C]17516.1621[/C][C]21175.0298[/C][C]3e-04[/C][C]0.8386[/C][C]0.9751[/C][C]0.0199[/C][/ROW]
[ROW][C]54[/C][C]16037.7[/C][C]22925.2253[/C][C]21083.3073[/C][C]24767.1432[/C][C]0[/C][C]1[/C][C]0.9723[/C][C]0.9614[/C][/ROW]
[ROW][C]55[/C][C]16410.7[/C][C]23273.2134[/C][C]21340.9228[/C][C]25205.5039[/C][C]0[/C][C]1[/C][C]0.9799[/C][C]0.9792[/C][/ROW]
[ROW][C]56[/C][C]17749.8[/C][C]22884.2642[/C][C]20889.1384[/C][C]24879.3899[/C][C]0[/C][C]1[/C][C]0.9285[/C][C]0.9442[/C][/ROW]
[ROW][C]57[/C][C]16349.8[/C][C]24188.4518[/C][C]22155.4717[/C][C]26221.4319[/C][C]0[/C][C]1[/C][C]0.9756[/C][C]0.9976[/C][/ROW]
[ROW][C]58[/C][C]15662.3[/C][C]22123.7315[/C][C]20043.6744[/C][C]24203.7886[/C][C]0[/C][C]1[/C][C]0.9562[/C][C]0.7909[/C][/ROW]
[ROW][C]59[/C][C]17782.3[/C][C]25680.3435[/C][C]23538.5394[/C][C]27822.1477[/C][C]0[/C][C]1[/C][C]0.9786[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]16398.9[/C][C]23070.0186[/C][C]20885.5778[/C][C]25254.4594[/C][C]0[/C][C]1[/C][C]0.9474[/C][C]0.9474[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65920&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65920&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[48])
3619406.8-------
3718385.3-------
3820739.3-------
3922268.3-------
4021569-------
4117514.8-------
4221124.7-------
4321251-------
4421393-------
4522145.2-------
4620310.5-------
4723466.9-------
4821264.6-------
4918388.120354.944218795.185721914.70280.00670.12650.99330.1265
5022635.422001.401720430.237423572.5660.214510.94230.821
5122014.324161.37122539.303825783.43830.00470.96740.98890.9998
5218422.723504.306321751.322325257.290300.95210.98480.9939
5316120.219345.59617516.162121175.02983e-040.83860.97510.0199
5416037.722925.225321083.307324767.1432010.97230.9614
5516410.723273.213421340.922825205.5039010.97990.9792
5617749.822884.264220889.138424879.3899010.92850.9442
5716349.824188.451822155.471726221.4319010.97560.9976
5815662.322123.731520043.674424203.7886010.95620.7909
5917782.325680.343523538.539427822.1477010.97861
6016398.923070.018620885.577825254.4594010.94740.9474







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0391-0.09660.00813868476.2742322373.0228567.779
500.03640.02880.0024401953.88133496.1567183.0196
510.0343-0.08890.00744609914.0375384159.5031619.806
520.0381-0.21620.01825822722.55322151893.54611466.9334
530.0482-0.16670.013910403179.157866931.5964931.0916
540.041-0.30040.02547438004.23973953167.021988.2573
550.0424-0.29490.024647094089.50853924507.4591981.037
560.0445-0.22440.018726362722.16362196893.51361482.1921
570.0429-0.32410.02761444461.86385120371.8222262.8239
580.048-0.29210.024341750097.34253479174.77851865.2546
590.0426-0.30760.025662379091.30665198257.60892279.9688
600.0483-0.28920.024144503823.32123708651.94341925.7861

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0391 & -0.0966 & 0.0081 & 3868476.2742 & 322373.0228 & 567.779 \tabularnewline
50 & 0.0364 & 0.0288 & 0.0024 & 401953.881 & 33496.1567 & 183.0196 \tabularnewline
51 & 0.0343 & -0.0889 & 0.0074 & 4609914.0375 & 384159.5031 & 619.806 \tabularnewline
52 & 0.0381 & -0.2162 & 0.018 & 25822722.5532 & 2151893.5461 & 1466.9334 \tabularnewline
53 & 0.0482 & -0.1667 & 0.0139 & 10403179.157 & 866931.5964 & 931.0916 \tabularnewline
54 & 0.041 & -0.3004 & 0.025 & 47438004.2397 & 3953167.02 & 1988.2573 \tabularnewline
55 & 0.0424 & -0.2949 & 0.0246 & 47094089.5085 & 3924507.459 & 1981.037 \tabularnewline
56 & 0.0445 & -0.2244 & 0.0187 & 26362722.1636 & 2196893.5136 & 1482.1921 \tabularnewline
57 & 0.0429 & -0.3241 & 0.027 & 61444461.8638 & 5120371.822 & 2262.8239 \tabularnewline
58 & 0.048 & -0.2921 & 0.0243 & 41750097.3425 & 3479174.7785 & 1865.2546 \tabularnewline
59 & 0.0426 & -0.3076 & 0.0256 & 62379091.3066 & 5198257.6089 & 2279.9688 \tabularnewline
60 & 0.0483 & -0.2892 & 0.0241 & 44503823.3212 & 3708651.9434 & 1925.7861 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65920&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]49[/C][C]0.0391[/C][C]-0.0966[/C][C]0.0081[/C][C]3868476.2742[/C][C]322373.0228[/C][C]567.779[/C][/ROW]
[ROW][C]50[/C][C]0.0364[/C][C]0.0288[/C][C]0.0024[/C][C]401953.881[/C][C]33496.1567[/C][C]183.0196[/C][/ROW]
[ROW][C]51[/C][C]0.0343[/C][C]-0.0889[/C][C]0.0074[/C][C]4609914.0375[/C][C]384159.5031[/C][C]619.806[/C][/ROW]
[ROW][C]52[/C][C]0.0381[/C][C]-0.2162[/C][C]0.018[/C][C]25822722.5532[/C][C]2151893.5461[/C][C]1466.9334[/C][/ROW]
[ROW][C]53[/C][C]0.0482[/C][C]-0.1667[/C][C]0.0139[/C][C]10403179.157[/C][C]866931.5964[/C][C]931.0916[/C][/ROW]
[ROW][C]54[/C][C]0.041[/C][C]-0.3004[/C][C]0.025[/C][C]47438004.2397[/C][C]3953167.02[/C][C]1988.2573[/C][/ROW]
[ROW][C]55[/C][C]0.0424[/C][C]-0.2949[/C][C]0.0246[/C][C]47094089.5085[/C][C]3924507.459[/C][C]1981.037[/C][/ROW]
[ROW][C]56[/C][C]0.0445[/C][C]-0.2244[/C][C]0.0187[/C][C]26362722.1636[/C][C]2196893.5136[/C][C]1482.1921[/C][/ROW]
[ROW][C]57[/C][C]0.0429[/C][C]-0.3241[/C][C]0.027[/C][C]61444461.8638[/C][C]5120371.822[/C][C]2262.8239[/C][/ROW]
[ROW][C]58[/C][C]0.048[/C][C]-0.2921[/C][C]0.0243[/C][C]41750097.3425[/C][C]3479174.7785[/C][C]1865.2546[/C][/ROW]
[ROW][C]59[/C][C]0.0426[/C][C]-0.3076[/C][C]0.0256[/C][C]62379091.3066[/C][C]5198257.6089[/C][C]2279.9688[/C][/ROW]
[ROW][C]60[/C][C]0.0483[/C][C]-0.2892[/C][C]0.0241[/C][C]44503823.3212[/C][C]3708651.9434[/C][C]1925.7861[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65920&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65920&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
490.0391-0.09660.00813868476.2742322373.0228567.779
500.03640.02880.0024401953.88133496.1567183.0196
510.0343-0.08890.00744609914.0375384159.5031619.806
520.0381-0.21620.01825822722.55322151893.54611466.9334
530.0482-0.16670.013910403179.157866931.5964931.0916
540.041-0.30040.02547438004.23973953167.021988.2573
550.0424-0.29490.024647094089.50853924507.4591981.037
560.0445-0.22440.018726362722.16362196893.51361482.1921
570.0429-0.32410.02761444461.86385120371.8222262.8239
580.048-0.29210.024341750097.34253479174.77851865.2546
590.0426-0.30760.025662379091.30665198257.60892279.9688
600.0483-0.28920.024144503823.32123708651.94341925.7861



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