Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 21 Dec 2007 03:16:28 -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/2007/Dec/21/t1198231179nzlvnkf00zy04vz.htm/, Retrieved Tue, 07 May 2024 18:04:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4786, Retrieved Tue, 07 May 2024 18:04:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact227
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast - Serie ...] [2007-12-21 10:16:28] [921757a21ec3444367392306fe4aab7f] [Current]
Feedback Forum

Post a new message
Dataseries X:
20972
35681
37034
35645
33379
32747
49585
41745
48564
52518
45594
51442
25094
33702
39120
33842
29896
31481
43895
39477
53726
61465
50104
47460
26451
30306
42598
34485
29027
35489
40357
37532
43899
48572
43901
50556
18387
27534
38030
31917
26414
35306
38271
41454
52408
53536
53152
56421
21538
33625
42625
31295
33795
41227
45382
47206
46235
51378
46865
58608




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 7 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4786&T=0

[TABLE]
[ROW][C]Summary of compuational 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]7 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4786&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4786&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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])
3650556-------
3718387-------
3827534-------
3938030-------
4031917-------
4126414-------
4235306-------
4338271-------
4441454-------
4552408-------
4653536-------
4753152-------
4856421-------
492153826451.488918169.078734733.89910.122500.97180
503362533245.740524363.791142127.68990.46670.99510.89620
514262544672.089135228.58754115.59130.33550.98910.9160.0074
523129537645.781127672.294247619.26790.1060.16390.86991e-04
533379532125.700521649.005142602.39590.37740.56180.85740
544122740110.571329153.753651067.3890.42090.87070.8050.0018
554538243694.591532277.824855111.35810.3860.66410.82410.0145
564720644369.411232510.521456228.3010.31960.43350.6850.0232
574623553167.194840882.082965452.30680.13440.82920.54820.3018
585137855711.285643014.251268408.320.25180.92820.63150.4564
594686553691.13140595.124466787.13770.15350.63540.53220.3414
605860858645.953545162.775272129.13170.49780.95660.62680.6268

\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 & 50556 & - & - & - & - & - & - & - \tabularnewline
37 & 18387 & - & - & - & - & - & - & - \tabularnewline
38 & 27534 & - & - & - & - & - & - & - \tabularnewline
39 & 38030 & - & - & - & - & - & - & - \tabularnewline
40 & 31917 & - & - & - & - & - & - & - \tabularnewline
41 & 26414 & - & - & - & - & - & - & - \tabularnewline
42 & 35306 & - & - & - & - & - & - & - \tabularnewline
43 & 38271 & - & - & - & - & - & - & - \tabularnewline
44 & 41454 & - & - & - & - & - & - & - \tabularnewline
45 & 52408 & - & - & - & - & - & - & - \tabularnewline
46 & 53536 & - & - & - & - & - & - & - \tabularnewline
47 & 53152 & - & - & - & - & - & - & - \tabularnewline
48 & 56421 & - & - & - & - & - & - & - \tabularnewline
49 & 21538 & 26451.4889 & 18169.0787 & 34733.8991 & 0.1225 & 0 & 0.9718 & 0 \tabularnewline
50 & 33625 & 33245.7405 & 24363.7911 & 42127.6899 & 0.4667 & 0.9951 & 0.8962 & 0 \tabularnewline
51 & 42625 & 44672.0891 & 35228.587 & 54115.5913 & 0.3355 & 0.9891 & 0.916 & 0.0074 \tabularnewline
52 & 31295 & 37645.7811 & 27672.2942 & 47619.2679 & 0.106 & 0.1639 & 0.8699 & 1e-04 \tabularnewline
53 & 33795 & 32125.7005 & 21649.0051 & 42602.3959 & 0.3774 & 0.5618 & 0.8574 & 0 \tabularnewline
54 & 41227 & 40110.5713 & 29153.7536 & 51067.389 & 0.4209 & 0.8707 & 0.805 & 0.0018 \tabularnewline
55 & 45382 & 43694.5915 & 32277.8248 & 55111.3581 & 0.386 & 0.6641 & 0.8241 & 0.0145 \tabularnewline
56 & 47206 & 44369.4112 & 32510.5214 & 56228.301 & 0.3196 & 0.4335 & 0.685 & 0.0232 \tabularnewline
57 & 46235 & 53167.1948 & 40882.0829 & 65452.3068 & 0.1344 & 0.8292 & 0.5482 & 0.3018 \tabularnewline
58 & 51378 & 55711.2856 & 43014.2512 & 68408.32 & 0.2518 & 0.9282 & 0.6315 & 0.4564 \tabularnewline
59 & 46865 & 53691.131 & 40595.1244 & 66787.1377 & 0.1535 & 0.6354 & 0.5322 & 0.3414 \tabularnewline
60 & 58608 & 58645.9535 & 45162.7752 & 72129.1317 & 0.4978 & 0.9566 & 0.6268 & 0.6268 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4786&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]50556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18387[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]27534[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]38030[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]31917[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]26414[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]35306[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]38271[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]41454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]52408[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]53536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]53152[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]56421[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]21538[/C][C]26451.4889[/C][C]18169.0787[/C][C]34733.8991[/C][C]0.1225[/C][C]0[/C][C]0.9718[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]33625[/C][C]33245.7405[/C][C]24363.7911[/C][C]42127.6899[/C][C]0.4667[/C][C]0.9951[/C][C]0.8962[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]42625[/C][C]44672.0891[/C][C]35228.587[/C][C]54115.5913[/C][C]0.3355[/C][C]0.9891[/C][C]0.916[/C][C]0.0074[/C][/ROW]
[ROW][C]52[/C][C]31295[/C][C]37645.7811[/C][C]27672.2942[/C][C]47619.2679[/C][C]0.106[/C][C]0.1639[/C][C]0.8699[/C][C]1e-04[/C][/ROW]
[ROW][C]53[/C][C]33795[/C][C]32125.7005[/C][C]21649.0051[/C][C]42602.3959[/C][C]0.3774[/C][C]0.5618[/C][C]0.8574[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]41227[/C][C]40110.5713[/C][C]29153.7536[/C][C]51067.389[/C][C]0.4209[/C][C]0.8707[/C][C]0.805[/C][C]0.0018[/C][/ROW]
[ROW][C]55[/C][C]45382[/C][C]43694.5915[/C][C]32277.8248[/C][C]55111.3581[/C][C]0.386[/C][C]0.6641[/C][C]0.8241[/C][C]0.0145[/C][/ROW]
[ROW][C]56[/C][C]47206[/C][C]44369.4112[/C][C]32510.5214[/C][C]56228.301[/C][C]0.3196[/C][C]0.4335[/C][C]0.685[/C][C]0.0232[/C][/ROW]
[ROW][C]57[/C][C]46235[/C][C]53167.1948[/C][C]40882.0829[/C][C]65452.3068[/C][C]0.1344[/C][C]0.8292[/C][C]0.5482[/C][C]0.3018[/C][/ROW]
[ROW][C]58[/C][C]51378[/C][C]55711.2856[/C][C]43014.2512[/C][C]68408.32[/C][C]0.2518[/C][C]0.9282[/C][C]0.6315[/C][C]0.4564[/C][/ROW]
[ROW][C]59[/C][C]46865[/C][C]53691.131[/C][C]40595.1244[/C][C]66787.1377[/C][C]0.1535[/C][C]0.6354[/C][C]0.5322[/C][C]0.3414[/C][/ROW]
[ROW][C]60[/C][C]58608[/C][C]58645.9535[/C][C]45162.7752[/C][C]72129.1317[/C][C]0.4978[/C][C]0.9566[/C][C]0.6268[/C][C]0.6268[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4786&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4786&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])
3650556-------
3718387-------
3827534-------
3938030-------
4031917-------
4126414-------
4235306-------
4338271-------
4441454-------
4552408-------
4653536-------
4753152-------
4856421-------
492153826451.488918169.078734733.89910.122500.97180
503362533245.740524363.791142127.68990.46670.99510.89620
514262544672.089135228.58754115.59130.33550.98910.9160.0074
523129537645.781127672.294247619.26790.1060.16390.86991e-04
533379532125.700521649.005142602.39590.37740.56180.85740
544122740110.571329153.753651067.3890.42090.87070.8050.0018
554538243694.591532277.824855111.35810.3860.66410.82410.0145
564720644369.411232510.521456228.3010.31960.43350.6850.0232
574623553167.194840882.082965452.30680.13440.82920.54820.3018
585137855711.285643014.251268408.320.25180.92820.63150.4564
594686553691.13140595.124466787.13770.15350.63540.53220.3414
605860858645.953545162.775272129.13170.49780.95660.62680.6268







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1598-0.18580.015524142373.04192011864.42021418.4021
500.13630.01140.001143837.77211986.481109.4828
510.1079-0.04580.00384190573.8582349214.4882590.9437
520.1352-0.16870.014140332420.2653361035.02211833.3126
530.16640.0520.00432786560.8058232213.4005481.8853
540.13940.02780.00231246413.0826103867.7569322.2852
550.13330.03860.00322847347.5547237278.9629487.1129
560.13640.06390.00538046236.0077670519.6673818.8527
570.1179-0.13040.010948055325.32614004610.44382001.1523
580.1163-0.07780.006518777364.03731564780.33641250.9118
590.1244-0.12710.010646596065.00443883005.4171970.5343
600.1173-6e-041e-041440.4647120.038710.9562

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1598 & -0.1858 & 0.0155 & 24142373.0419 & 2011864.4202 & 1418.4021 \tabularnewline
50 & 0.1363 & 0.0114 & 0.001 & 143837.772 & 11986.481 & 109.4828 \tabularnewline
51 & 0.1079 & -0.0458 & 0.0038 & 4190573.8582 & 349214.4882 & 590.9437 \tabularnewline
52 & 0.1352 & -0.1687 & 0.0141 & 40332420.265 & 3361035.0221 & 1833.3126 \tabularnewline
53 & 0.1664 & 0.052 & 0.0043 & 2786560.8058 & 232213.4005 & 481.8853 \tabularnewline
54 & 0.1394 & 0.0278 & 0.0023 & 1246413.0826 & 103867.7569 & 322.2852 \tabularnewline
55 & 0.1333 & 0.0386 & 0.0032 & 2847347.5547 & 237278.9629 & 487.1129 \tabularnewline
56 & 0.1364 & 0.0639 & 0.0053 & 8046236.0077 & 670519.6673 & 818.8527 \tabularnewline
57 & 0.1179 & -0.1304 & 0.0109 & 48055325.3261 & 4004610.4438 & 2001.1523 \tabularnewline
58 & 0.1163 & -0.0778 & 0.0065 & 18777364.0373 & 1564780.3364 & 1250.9118 \tabularnewline
59 & 0.1244 & -0.1271 & 0.0106 & 46596065.0044 & 3883005.417 & 1970.5343 \tabularnewline
60 & 0.1173 & -6e-04 & 1e-04 & 1440.4647 & 120.0387 & 10.9562 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4786&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.1598[/C][C]-0.1858[/C][C]0.0155[/C][C]24142373.0419[/C][C]2011864.4202[/C][C]1418.4021[/C][/ROW]
[ROW][C]50[/C][C]0.1363[/C][C]0.0114[/C][C]0.001[/C][C]143837.772[/C][C]11986.481[/C][C]109.4828[/C][/ROW]
[ROW][C]51[/C][C]0.1079[/C][C]-0.0458[/C][C]0.0038[/C][C]4190573.8582[/C][C]349214.4882[/C][C]590.9437[/C][/ROW]
[ROW][C]52[/C][C]0.1352[/C][C]-0.1687[/C][C]0.0141[/C][C]40332420.265[/C][C]3361035.0221[/C][C]1833.3126[/C][/ROW]
[ROW][C]53[/C][C]0.1664[/C][C]0.052[/C][C]0.0043[/C][C]2786560.8058[/C][C]232213.4005[/C][C]481.8853[/C][/ROW]
[ROW][C]54[/C][C]0.1394[/C][C]0.0278[/C][C]0.0023[/C][C]1246413.0826[/C][C]103867.7569[/C][C]322.2852[/C][/ROW]
[ROW][C]55[/C][C]0.1333[/C][C]0.0386[/C][C]0.0032[/C][C]2847347.5547[/C][C]237278.9629[/C][C]487.1129[/C][/ROW]
[ROW][C]56[/C][C]0.1364[/C][C]0.0639[/C][C]0.0053[/C][C]8046236.0077[/C][C]670519.6673[/C][C]818.8527[/C][/ROW]
[ROW][C]57[/C][C]0.1179[/C][C]-0.1304[/C][C]0.0109[/C][C]48055325.3261[/C][C]4004610.4438[/C][C]2001.1523[/C][/ROW]
[ROW][C]58[/C][C]0.1163[/C][C]-0.0778[/C][C]0.0065[/C][C]18777364.0373[/C][C]1564780.3364[/C][C]1250.9118[/C][/ROW]
[ROW][C]59[/C][C]0.1244[/C][C]-0.1271[/C][C]0.0106[/C][C]46596065.0044[/C][C]3883005.417[/C][C]1970.5343[/C][/ROW]
[ROW][C]60[/C][C]0.1173[/C][C]-6e-04[/C][C]1e-04[/C][C]1440.4647[/C][C]120.0387[/C][C]10.9562[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4786&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4786&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.1598-0.18580.015524142373.04192011864.42021418.4021
500.13630.01140.001143837.77211986.481109.4828
510.1079-0.04580.00384190573.8582349214.4882590.9437
520.1352-0.16870.014140332420.2653361035.02211833.3126
530.16640.0520.00432786560.8058232213.4005481.8853
540.13940.02780.00231246413.0826103867.7569322.2852
550.13330.03860.00322847347.5547237278.9629487.1129
560.13640.06390.00538046236.0077670519.6673818.8527
570.1179-0.13040.010948055325.32614004610.44382001.1523
580.1163-0.07780.006518777364.03731564780.33641250.9118
590.1244-0.12710.010646596065.00443883005.4171970.5343
600.1173-6e-041e-041440.4647120.038710.9562



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