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 computationThu, 17 Dec 2009 05:11: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/17/t1261051965illvvze6wiwwd17.htm/, Retrieved Tue, 30 Apr 2024 07:00:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68781, Retrieved Tue, 30 Apr 2024 07:00:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact138
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Workshop 5 Q1] [2007-12-10 15:52:05] [c3fe85a72944c2c83ce86133657c8afd]
- R  D  [ARIMA Forecasting] [ARIMA FORECASTING] [2008-12-22 13:59:19] [072df11bdb18ed8d65d8164df87f26f2]
- RMPD      [ARIMA Forecasting] [] [2009-12-17 12:11:03] [66ffaa9e54a90d3ae4874684602d24e9] [Current]
Feedback Forum

Post a new message
Dataseries X:
17823.2
17872
17420.4
16704.4
15991.2
16583.6
19123.5
17838.7
17209.4
18586.5
16258.1
15141.6
19202.1
17746.5
19090.1
18040.3
17515.5
17751.8
21072.4
17170
19439.5
19795.4
17574.9
16165.4
19464.6
19932.1
19961.2
17343.4
18924.2
18574.1
21350.6
18594.6
19823.1
20844.4
19640.2
17735.4
19813.6
22160
20664.3
17877.4
20906.5
21164.1
21374.4
22952.3
21343.5
23899.3
22392.9
18274.1
22786.7
22321.5
17842.2
16373.5
15993.8
16446.1
17729
16643
16196.7
18252.1
17570.4
15836.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68781&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[48])
3617735.4-------
3719813.6-------
3822160-------
3920664.3-------
4017877.4-------
4120906.5-------
4221164.1-------
4321374.4-------
4422952.3-------
4521343.5-------
4623899.3-------
4722392.9-------
4818274.1-------
4922786.723254.322421472.789525035.85530.303510.99991
5022321.523995.938522180.589125811.2880.03530.90420.97631
5117842.222371.979920433.375524310.584300.52040.95791
5216373.520872.884918730.338323015.431400.99720.99690.9913
5315993.822679.440420530.660724828.2201010.94711
5416446.122885.624920638.044325133.2056010.93341
551772923978.404721635.649626321.1598010.98531
561664324537.511222163.59526911.4274010.90471
5716196.723345.524920893.290225797.7596010.94521
5818252.125713.419723195.177228231.6621010.9211
5917570.424006.683421442.427226570.9397010.89131
6015836.820462.053717835.641423088.4663e-040.98450.94870.9487

\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 & 17735.4 & - & - & - & - & - & - & - \tabularnewline
37 & 19813.6 & - & - & - & - & - & - & - \tabularnewline
38 & 22160 & - & - & - & - & - & - & - \tabularnewline
39 & 20664.3 & - & - & - & - & - & - & - \tabularnewline
40 & 17877.4 & - & - & - & - & - & - & - \tabularnewline
41 & 20906.5 & - & - & - & - & - & - & - \tabularnewline
42 & 21164.1 & - & - & - & - & - & - & - \tabularnewline
43 & 21374.4 & - & - & - & - & - & - & - \tabularnewline
44 & 22952.3 & - & - & - & - & - & - & - \tabularnewline
45 & 21343.5 & - & - & - & - & - & - & - \tabularnewline
46 & 23899.3 & - & - & - & - & - & - & - \tabularnewline
47 & 22392.9 & - & - & - & - & - & - & - \tabularnewline
48 & 18274.1 & - & - & - & - & - & - & - \tabularnewline
49 & 22786.7 & 23254.3224 & 21472.7895 & 25035.8553 & 0.3035 & 1 & 0.9999 & 1 \tabularnewline
50 & 22321.5 & 23995.9385 & 22180.5891 & 25811.288 & 0.0353 & 0.9042 & 0.9763 & 1 \tabularnewline
51 & 17842.2 & 22371.9799 & 20433.3755 & 24310.5843 & 0 & 0.5204 & 0.9579 & 1 \tabularnewline
52 & 16373.5 & 20872.8849 & 18730.3383 & 23015.4314 & 0 & 0.9972 & 0.9969 & 0.9913 \tabularnewline
53 & 15993.8 & 22679.4404 & 20530.6607 & 24828.2201 & 0 & 1 & 0.9471 & 1 \tabularnewline
54 & 16446.1 & 22885.6249 & 20638.0443 & 25133.2056 & 0 & 1 & 0.9334 & 1 \tabularnewline
55 & 17729 & 23978.4047 & 21635.6496 & 26321.1598 & 0 & 1 & 0.9853 & 1 \tabularnewline
56 & 16643 & 24537.5112 & 22163.595 & 26911.4274 & 0 & 1 & 0.9047 & 1 \tabularnewline
57 & 16196.7 & 23345.5249 & 20893.2902 & 25797.7596 & 0 & 1 & 0.9452 & 1 \tabularnewline
58 & 18252.1 & 25713.4197 & 23195.1772 & 28231.6621 & 0 & 1 & 0.921 & 1 \tabularnewline
59 & 17570.4 & 24006.6834 & 21442.4272 & 26570.9397 & 0 & 1 & 0.8913 & 1 \tabularnewline
60 & 15836.8 & 20462.0537 & 17835.6414 & 23088.466 & 3e-04 & 0.9845 & 0.9487 & 0.9487 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68781&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]17735.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]19813.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]22160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]20664.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17877.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20906.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21164.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]21374.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]22952.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]21343.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]23899.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]22392.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]18274.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22786.7[/C][C]23254.3224[/C][C]21472.7895[/C][C]25035.8553[/C][C]0.3035[/C][C]1[/C][C]0.9999[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]22321.5[/C][C]23995.9385[/C][C]22180.5891[/C][C]25811.288[/C][C]0.0353[/C][C]0.9042[/C][C]0.9763[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]17842.2[/C][C]22371.9799[/C][C]20433.3755[/C][C]24310.5843[/C][C]0[/C][C]0.5204[/C][C]0.9579[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]16373.5[/C][C]20872.8849[/C][C]18730.3383[/C][C]23015.4314[/C][C]0[/C][C]0.9972[/C][C]0.9969[/C][C]0.9913[/C][/ROW]
[ROW][C]53[/C][C]15993.8[/C][C]22679.4404[/C][C]20530.6607[/C][C]24828.2201[/C][C]0[/C][C]1[/C][C]0.9471[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]16446.1[/C][C]22885.6249[/C][C]20638.0443[/C][C]25133.2056[/C][C]0[/C][C]1[/C][C]0.9334[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]17729[/C][C]23978.4047[/C][C]21635.6496[/C][C]26321.1598[/C][C]0[/C][C]1[/C][C]0.9853[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]16643[/C][C]24537.5112[/C][C]22163.595[/C][C]26911.4274[/C][C]0[/C][C]1[/C][C]0.9047[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]16196.7[/C][C]23345.5249[/C][C]20893.2902[/C][C]25797.7596[/C][C]0[/C][C]1[/C][C]0.9452[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]18252.1[/C][C]25713.4197[/C][C]23195.1772[/C][C]28231.6621[/C][C]0[/C][C]1[/C][C]0.921[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]17570.4[/C][C]24006.6834[/C][C]21442.4272[/C][C]26570.9397[/C][C]0[/C][C]1[/C][C]0.8913[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]15836.8[/C][C]20462.0537[/C][C]17835.6414[/C][C]23088.466[/C][C]3e-04[/C][C]0.9845[/C][C]0.9487[/C][C]0.9487[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68781&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68781&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])
3617735.4-------
3719813.6-------
3822160-------
3920664.3-------
4017877.4-------
4120906.5-------
4221164.1-------
4321374.4-------
4422952.3-------
4521343.5-------
4623899.3-------
4722392.9-------
4818274.1-------
4922786.723254.322421472.789525035.85530.303510.99991
5022321.523995.938522180.589125811.2880.03530.90420.97631
5117842.222371.979920433.375524310.584300.52040.95791
5216373.520872.884918730.338323015.431400.99720.99690.9913
5315993.822679.440420530.660724828.2201010.94711
5416446.122885.624920638.044325133.2056010.93341
551772923978.404721635.649626321.1598010.98531
561664324537.511222163.59526911.4274010.90471
5716196.723345.524920893.290225797.7596010.94521
5818252.125713.419723195.177228231.6621010.9211
5917570.424006.683421442.427226570.9397010.89131
6015836.820462.053717835.641423088.4663e-040.98450.94870.9487







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0391-0.02010218670.722700
500.0386-0.06980.04492803744.36051511207.54161229.3118
510.0442-0.20250.097520518906.15827847107.08052801.2688
520.0524-0.21560.12720244464.032310946446.31843308.5414
530.0483-0.29480.160544697787.214917696714.49774206.7463
540.0501-0.28140.180741467481.502121658508.99844653.8703
550.0498-0.26060.192139055059.038224143730.43274913.627
560.0494-0.32170.208362323307.466628916177.56195377.3765
570.0536-0.30620.219251105697.198731381679.74385601.9354
580.05-0.29020.226355671291.481533810640.91765814.6918
590.0545-0.26810.230141425744.502134502923.06165873.9189
600.0655-0.2260.229721392971.661533410427.11165780.1754

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0391 & -0.0201 & 0 & 218670.7227 & 0 & 0 \tabularnewline
50 & 0.0386 & -0.0698 & 0.0449 & 2803744.3605 & 1511207.5416 & 1229.3118 \tabularnewline
51 & 0.0442 & -0.2025 & 0.0975 & 20518906.1582 & 7847107.0805 & 2801.2688 \tabularnewline
52 & 0.0524 & -0.2156 & 0.127 & 20244464.0323 & 10946446.3184 & 3308.5414 \tabularnewline
53 & 0.0483 & -0.2948 & 0.1605 & 44697787.2149 & 17696714.4977 & 4206.7463 \tabularnewline
54 & 0.0501 & -0.2814 & 0.1807 & 41467481.5021 & 21658508.9984 & 4653.8703 \tabularnewline
55 & 0.0498 & -0.2606 & 0.1921 & 39055059.0382 & 24143730.4327 & 4913.627 \tabularnewline
56 & 0.0494 & -0.3217 & 0.2083 & 62323307.4666 & 28916177.5619 & 5377.3765 \tabularnewline
57 & 0.0536 & -0.3062 & 0.2192 & 51105697.1987 & 31381679.7438 & 5601.9354 \tabularnewline
58 & 0.05 & -0.2902 & 0.2263 & 55671291.4815 & 33810640.9176 & 5814.6918 \tabularnewline
59 & 0.0545 & -0.2681 & 0.2301 & 41425744.5021 & 34502923.0616 & 5873.9189 \tabularnewline
60 & 0.0655 & -0.226 & 0.2297 & 21392971.6615 & 33410427.1116 & 5780.1754 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68781&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.0201[/C][C]0[/C][C]218670.7227[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0386[/C][C]-0.0698[/C][C]0.0449[/C][C]2803744.3605[/C][C]1511207.5416[/C][C]1229.3118[/C][/ROW]
[ROW][C]51[/C][C]0.0442[/C][C]-0.2025[/C][C]0.0975[/C][C]20518906.1582[/C][C]7847107.0805[/C][C]2801.2688[/C][/ROW]
[ROW][C]52[/C][C]0.0524[/C][C]-0.2156[/C][C]0.127[/C][C]20244464.0323[/C][C]10946446.3184[/C][C]3308.5414[/C][/ROW]
[ROW][C]53[/C][C]0.0483[/C][C]-0.2948[/C][C]0.1605[/C][C]44697787.2149[/C][C]17696714.4977[/C][C]4206.7463[/C][/ROW]
[ROW][C]54[/C][C]0.0501[/C][C]-0.2814[/C][C]0.1807[/C][C]41467481.5021[/C][C]21658508.9984[/C][C]4653.8703[/C][/ROW]
[ROW][C]55[/C][C]0.0498[/C][C]-0.2606[/C][C]0.1921[/C][C]39055059.0382[/C][C]24143730.4327[/C][C]4913.627[/C][/ROW]
[ROW][C]56[/C][C]0.0494[/C][C]-0.3217[/C][C]0.2083[/C][C]62323307.4666[/C][C]28916177.5619[/C][C]5377.3765[/C][/ROW]
[ROW][C]57[/C][C]0.0536[/C][C]-0.3062[/C][C]0.2192[/C][C]51105697.1987[/C][C]31381679.7438[/C][C]5601.9354[/C][/ROW]
[ROW][C]58[/C][C]0.05[/C][C]-0.2902[/C][C]0.2263[/C][C]55671291.4815[/C][C]33810640.9176[/C][C]5814.6918[/C][/ROW]
[ROW][C]59[/C][C]0.0545[/C][C]-0.2681[/C][C]0.2301[/C][C]41425744.5021[/C][C]34502923.0616[/C][C]5873.9189[/C][/ROW]
[ROW][C]60[/C][C]0.0655[/C][C]-0.226[/C][C]0.2297[/C][C]21392971.6615[/C][C]33410427.1116[/C][C]5780.1754[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68781&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68781&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.02010218670.722700
500.0386-0.06980.04492803744.36051511207.54161229.3118
510.0442-0.20250.097520518906.15827847107.08052801.2688
520.0524-0.21560.12720244464.032310946446.31843308.5414
530.0483-0.29480.160544697787.214917696714.49774206.7463
540.0501-0.28140.180741467481.502121658508.99844653.8703
550.0498-0.26060.192139055059.038224143730.43274913.627
560.0494-0.32170.208362323307.466628916177.56195377.3765
570.0536-0.30620.219251105697.198731381679.74385601.9354
580.05-0.29020.226355671291.481533810640.91765814.6918
590.0545-0.26810.230141425744.502134502923.06165873.9189
600.0655-0.2260.229721392971.661533410427.11165780.1754



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