Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 16:10: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/2009/Dec/31/t1262214989upltihlbrer7byb.htm/, Retrieved Thu, 02 May 2024 04:33:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71397, Retrieved Thu, 02 May 2024 04:33:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Central Tendency] [Central tendency:...] [2008-12-12 12:54:43] [73d6180dc45497329efd1b6934a84aba]
- RMP   [ARIMA Backward Selection] [ARIMA goudprijs] [2008-12-14 20:12:57] [73d6180dc45497329efd1b6934a84aba]
- RMPD    [ARIMA Forecasting] [ARIMA forecast: O...] [2008-12-14 22:42:36] [73d6180dc45497329efd1b6934a84aba]
-   PD      [ARIMA Forecasting] [arima forecast ol...] [2008-12-16 16:27:50] [73d6180dc45497329efd1b6934a84aba]
-   P         [ARIMA Forecasting] [Lambda -0,2 ARIMA...] [2008-12-19 21:26:09] [73d6180dc45497329efd1b6934a84aba]
- R PD          [ARIMA Forecasting] [Forecast BEL20] [2008-12-22 14:06:40] [7458e879e85b911182071700fff19fbd]
- RMPD              [ARIMA Forecasting] [] [2009-12-30 23:10:28] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2921.44
2981.85
3080.58
3106.22
3119.31
3061.26
3097.31
3161.69
3257.16
3277.01
3295.32
3363.99
3494.17
3667.03
3813.06
3917.96
3895.51
3801.06
3570.12
3701.61
3862.27
3970.1
4138.52
4199.75
4290.89
4443.91
4502.64
4356.98
4591.27
4696.96
4621.4
4562.84
4202.52
4296.49
4435.23
4105.18
4116.68
3844.49
3720.98
3674.4
3857.62
3801.06
3504.37
3032.6
3047.03
2962.34
2197.82
2014.45
1862.83
1905.41
1810.99
1670.07
1864.44
2052.02
2029.6
2070.83
2293.41
2443.27
2513.17
2466.92




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71397&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 time1 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])
364105.18-------
374116.68-------
383844.49-------
393720.98-------
403674.4-------
413857.62-------
423801.06-------
433504.37-------
443032.6-------
453047.03-------
462962.34-------
472197.82-------
482014.45-------
491862.832014.451638.49072390.40930.21460.500.5
501905.412014.451482.76332546.13670.34390.711900.5
511810.992014.451363.26942665.63060.27010.628600.5
521670.072014.451262.53142766.36860.18470.702100.5
531864.442014.451173.77952855.12050.36330.78900.5
542052.022014.451093.54162935.35840.46810.62521e-040.5
552029.62014.451019.75523009.14480.48810.47050.00170.5
562070.832014.45951.07653077.82350.45860.48890.03030.5
572293.412014.45886.57213142.32790.31390.4610.03640.5
582443.272014.45825.56233203.33770.23980.32280.05910.5
592513.172014.45767.53413261.36590.21650.25010.38660.5
602466.922014.45712.08883316.81120.2480.22650.50.5

\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 & 4105.18 & - & - & - & - & - & - & - \tabularnewline
37 & 4116.68 & - & - & - & - & - & - & - \tabularnewline
38 & 3844.49 & - & - & - & - & - & - & - \tabularnewline
39 & 3720.98 & - & - & - & - & - & - & - \tabularnewline
40 & 3674.4 & - & - & - & - & - & - & - \tabularnewline
41 & 3857.62 & - & - & - & - & - & - & - \tabularnewline
42 & 3801.06 & - & - & - & - & - & - & - \tabularnewline
43 & 3504.37 & - & - & - & - & - & - & - \tabularnewline
44 & 3032.6 & - & - & - & - & - & - & - \tabularnewline
45 & 3047.03 & - & - & - & - & - & - & - \tabularnewline
46 & 2962.34 & - & - & - & - & - & - & - \tabularnewline
47 & 2197.82 & - & - & - & - & - & - & - \tabularnewline
48 & 2014.45 & - & - & - & - & - & - & - \tabularnewline
49 & 1862.83 & 2014.45 & 1638.4907 & 2390.4093 & 0.2146 & 0.5 & 0 & 0.5 \tabularnewline
50 & 1905.41 & 2014.45 & 1482.7633 & 2546.1367 & 0.3439 & 0.7119 & 0 & 0.5 \tabularnewline
51 & 1810.99 & 2014.45 & 1363.2694 & 2665.6306 & 0.2701 & 0.6286 & 0 & 0.5 \tabularnewline
52 & 1670.07 & 2014.45 & 1262.5314 & 2766.3686 & 0.1847 & 0.7021 & 0 & 0.5 \tabularnewline
53 & 1864.44 & 2014.45 & 1173.7795 & 2855.1205 & 0.3633 & 0.789 & 0 & 0.5 \tabularnewline
54 & 2052.02 & 2014.45 & 1093.5416 & 2935.3584 & 0.4681 & 0.6252 & 1e-04 & 0.5 \tabularnewline
55 & 2029.6 & 2014.45 & 1019.7552 & 3009.1448 & 0.4881 & 0.4705 & 0.0017 & 0.5 \tabularnewline
56 & 2070.83 & 2014.45 & 951.0765 & 3077.8235 & 0.4586 & 0.4889 & 0.0303 & 0.5 \tabularnewline
57 & 2293.41 & 2014.45 & 886.5721 & 3142.3279 & 0.3139 & 0.461 & 0.0364 & 0.5 \tabularnewline
58 & 2443.27 & 2014.45 & 825.5623 & 3203.3377 & 0.2398 & 0.3228 & 0.0591 & 0.5 \tabularnewline
59 & 2513.17 & 2014.45 & 767.5341 & 3261.3659 & 0.2165 & 0.2501 & 0.3866 & 0.5 \tabularnewline
60 & 2466.92 & 2014.45 & 712.0888 & 3316.8112 & 0.248 & 0.2265 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71397&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]4105.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4116.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3844.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3720.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3674.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3857.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3801.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3504.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3032.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]3047.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2962.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2197.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2014.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1862.83[/C][C]2014.45[/C][C]1638.4907[/C][C]2390.4093[/C][C]0.2146[/C][C]0.5[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]1905.41[/C][C]2014.45[/C][C]1482.7633[/C][C]2546.1367[/C][C]0.3439[/C][C]0.7119[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]51[/C][C]1810.99[/C][C]2014.45[/C][C]1363.2694[/C][C]2665.6306[/C][C]0.2701[/C][C]0.6286[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]52[/C][C]1670.07[/C][C]2014.45[/C][C]1262.5314[/C][C]2766.3686[/C][C]0.1847[/C][C]0.7021[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]53[/C][C]1864.44[/C][C]2014.45[/C][C]1173.7795[/C][C]2855.1205[/C][C]0.3633[/C][C]0.789[/C][C]0[/C][C]0.5[/C][/ROW]
[ROW][C]54[/C][C]2052.02[/C][C]2014.45[/C][C]1093.5416[/C][C]2935.3584[/C][C]0.4681[/C][C]0.6252[/C][C]1e-04[/C][C]0.5[/C][/ROW]
[ROW][C]55[/C][C]2029.6[/C][C]2014.45[/C][C]1019.7552[/C][C]3009.1448[/C][C]0.4881[/C][C]0.4705[/C][C]0.0017[/C][C]0.5[/C][/ROW]
[ROW][C]56[/C][C]2070.83[/C][C]2014.45[/C][C]951.0765[/C][C]3077.8235[/C][C]0.4586[/C][C]0.4889[/C][C]0.0303[/C][C]0.5[/C][/ROW]
[ROW][C]57[/C][C]2293.41[/C][C]2014.45[/C][C]886.5721[/C][C]3142.3279[/C][C]0.3139[/C][C]0.461[/C][C]0.0364[/C][C]0.5[/C][/ROW]
[ROW][C]58[/C][C]2443.27[/C][C]2014.45[/C][C]825.5623[/C][C]3203.3377[/C][C]0.2398[/C][C]0.3228[/C][C]0.0591[/C][C]0.5[/C][/ROW]
[ROW][C]59[/C][C]2513.17[/C][C]2014.45[/C][C]767.5341[/C][C]3261.3659[/C][C]0.2165[/C][C]0.2501[/C][C]0.3866[/C][C]0.5[/C][/ROW]
[ROW][C]60[/C][C]2466.92[/C][C]2014.45[/C][C]712.0888[/C][C]3316.8112[/C][C]0.248[/C][C]0.2265[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71397&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71397&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])
364105.18-------
374116.68-------
383844.49-------
393720.98-------
403674.4-------
413857.62-------
423801.06-------
433504.37-------
443032.6-------
453047.03-------
462962.34-------
472197.82-------
482014.45-------
491862.832014.451638.49072390.40930.21460.500.5
501905.412014.451482.76332546.13670.34390.711900.5
511810.992014.451363.26942665.63060.27010.628600.5
521670.072014.451262.53142766.36860.18470.702100.5
531864.442014.451173.77952855.12050.36330.78900.5
542052.022014.451093.54162935.35840.46810.62521e-040.5
552029.62014.451019.75523009.14480.48810.47050.00170.5
562070.832014.45951.07653077.82350.45860.48890.03030.5
572293.412014.45886.57213142.32790.31390.4610.03640.5
582443.272014.45825.56233203.33770.23980.32280.05910.5
592513.172014.45767.53413261.36590.21650.25010.38660.5
602466.922014.45712.08883316.81120.2480.22650.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0952-0.0753022988.624400
500.1347-0.05410.064711889.721617439.173132.0575
510.1649-0.1010.076841395.971625424.7725159.4515
520.1904-0.1710.1003118597.584448717.9755220.7215
530.2129-0.07450.095222503.000143474.9804208.5065
540.23320.01870.08241411.504936464.4012190.9565
550.25190.00750.0717229.522531287.9899176.8841
560.26930.0280.06623178.704427774.3292166.6563
570.28570.13850.074377818.681633334.8128182.5782
580.30110.21290.0881183886.592448389.9908219.9773
590.31580.24760.1026248721.638466601.9588258.0736
600.32990.22460.1128204729.100978112.5539279.4862

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0952 & -0.0753 & 0 & 22988.6244 & 0 & 0 \tabularnewline
50 & 0.1347 & -0.0541 & 0.0647 & 11889.7216 & 17439.173 & 132.0575 \tabularnewline
51 & 0.1649 & -0.101 & 0.0768 & 41395.9716 & 25424.7725 & 159.4515 \tabularnewline
52 & 0.1904 & -0.171 & 0.1003 & 118597.5844 & 48717.9755 & 220.7215 \tabularnewline
53 & 0.2129 & -0.0745 & 0.0952 & 22503.0001 & 43474.9804 & 208.5065 \tabularnewline
54 & 0.2332 & 0.0187 & 0.0824 & 1411.5049 & 36464.4012 & 190.9565 \tabularnewline
55 & 0.2519 & 0.0075 & 0.0717 & 229.5225 & 31287.9899 & 176.8841 \tabularnewline
56 & 0.2693 & 0.028 & 0.0662 & 3178.7044 & 27774.3292 & 166.6563 \tabularnewline
57 & 0.2857 & 0.1385 & 0.0743 & 77818.6816 & 33334.8128 & 182.5782 \tabularnewline
58 & 0.3011 & 0.2129 & 0.0881 & 183886.5924 & 48389.9908 & 219.9773 \tabularnewline
59 & 0.3158 & 0.2476 & 0.1026 & 248721.6384 & 66601.9588 & 258.0736 \tabularnewline
60 & 0.3299 & 0.2246 & 0.1128 & 204729.1009 & 78112.5539 & 279.4862 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71397&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.0952[/C][C]-0.0753[/C][C]0[/C][C]22988.6244[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1347[/C][C]-0.0541[/C][C]0.0647[/C][C]11889.7216[/C][C]17439.173[/C][C]132.0575[/C][/ROW]
[ROW][C]51[/C][C]0.1649[/C][C]-0.101[/C][C]0.0768[/C][C]41395.9716[/C][C]25424.7725[/C][C]159.4515[/C][/ROW]
[ROW][C]52[/C][C]0.1904[/C][C]-0.171[/C][C]0.1003[/C][C]118597.5844[/C][C]48717.9755[/C][C]220.7215[/C][/ROW]
[ROW][C]53[/C][C]0.2129[/C][C]-0.0745[/C][C]0.0952[/C][C]22503.0001[/C][C]43474.9804[/C][C]208.5065[/C][/ROW]
[ROW][C]54[/C][C]0.2332[/C][C]0.0187[/C][C]0.0824[/C][C]1411.5049[/C][C]36464.4012[/C][C]190.9565[/C][/ROW]
[ROW][C]55[/C][C]0.2519[/C][C]0.0075[/C][C]0.0717[/C][C]229.5225[/C][C]31287.9899[/C][C]176.8841[/C][/ROW]
[ROW][C]56[/C][C]0.2693[/C][C]0.028[/C][C]0.0662[/C][C]3178.7044[/C][C]27774.3292[/C][C]166.6563[/C][/ROW]
[ROW][C]57[/C][C]0.2857[/C][C]0.1385[/C][C]0.0743[/C][C]77818.6816[/C][C]33334.8128[/C][C]182.5782[/C][/ROW]
[ROW][C]58[/C][C]0.3011[/C][C]0.2129[/C][C]0.0881[/C][C]183886.5924[/C][C]48389.9908[/C][C]219.9773[/C][/ROW]
[ROW][C]59[/C][C]0.3158[/C][C]0.2476[/C][C]0.1026[/C][C]248721.6384[/C][C]66601.9588[/C][C]258.0736[/C][/ROW]
[ROW][C]60[/C][C]0.3299[/C][C]0.2246[/C][C]0.1128[/C][C]204729.1009[/C][C]78112.5539[/C][C]279.4862[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71397&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71397&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.0952-0.0753022988.624400
500.1347-0.05410.064711889.721617439.173132.0575
510.1649-0.1010.076841395.971625424.7725159.4515
520.1904-0.1710.1003118597.584448717.9755220.7215
530.2129-0.07450.095222503.000143474.9804208.5065
540.23320.01870.08241411.504936464.4012190.9565
550.25190.00750.0717229.522531287.9899176.8841
560.26930.0280.06623178.704427774.3292166.6563
570.28570.13850.074377818.681633334.8128182.5782
580.30110.21290.0881183886.592448389.9908219.9773
590.31580.24760.1026248721.638466601.9588258.0736
600.32990.22460.1128204729.100978112.5539279.4862



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