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 computationMon, 06 Dec 2010 21:55:40 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/06/t1291672419wrbjvwnd0yp1m15.htm/, Retrieved Sun, 28 Apr 2024 22:23:39 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=105937, Retrieved Sun, 28 Apr 2024 22:23:39 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact159
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   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:25:58] [8ef49741e164ec6343c90c7935194465]
-   P         [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:58:46] [8ef49741e164ec6343c90c7935194465]
- R  D            [ARIMA Forecasting] [WS 9 - Forecasting] [2010-12-06 21:55:40] [89d441ae0711e9b79b5d358f420c1317] [Current]
-   PD              [ARIMA Forecasting] [Paper - C&S ARIMA ] [2010-12-21 16:44:16] [18fa53e8b37a5effc0c5f8a5122cdd2d]
Feedback Forum

Post a new message
Dataseries X:
1576.23
1546.37
1545.05
1552.34
1594.3
1605.78
1673.21
1612.94
1566.34
1530.17
1582.54
1702.16
1701.93
1811.15
1924.2
2034.25
2011.13
2013.04
2151.67
1902.09
1944.01
1916.67
1967.31
2119.88
2216.38
2522.83
2647.64
2631.23
2693.41
3021.76
2953.67
2796.8
2672.05
2251.23
2046.08
2420.04
2608.89
2660.47
2493.98
2541.7
2554.6
2699.61
2805.48
2956.66
3149.51
3372.5
3379.33
3517.54
3527.34
3281.06
3089.65
3222.76
3165.76
3232.43
3229.54
3071.74
2850.17




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=105937&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=105937&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=105937&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[45])
332672.05-------
342251.23-------
352046.08-------
362420.04-------
372608.89-------
382660.47-------
392493.98-------
402541.7-------
412554.6-------
422699.61-------
432805.48-------
442956.66-------
453149.51-------
463372.53199.48422923.18863475.77970.10980.638510.6385
473379.333199.48422738.02313660.94520.22250.231210.584
483517.543199.48422608.25373790.71460.14590.27550.99510.5658
493527.343199.48422502.2323896.73630.17840.18560.95160.5559
503281.063199.48422410.32793988.64040.41970.20770.90970.5494
513089.653199.48422328.0634070.90530.40240.42720.94370.5447
523222.763199.48422252.9214146.04730.48080.590.91340.5412
533165.763199.48422183.32034215.6480.47410.48210.89320.5384
543232.433199.48422118.19044280.77790.47620.52440.81760.5361
553229.543199.48422056.76674342.20160.47940.47750.75040.5342
563071.743199.48421998.48034400.4880.41740.48040.65410.5325
572850.173199.48421942.89464456.07380.29290.5790.53110.5311

\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[45]) \tabularnewline
33 & 2672.05 & - & - & - & - & - & - & - \tabularnewline
34 & 2251.23 & - & - & - & - & - & - & - \tabularnewline
35 & 2046.08 & - & - & - & - & - & - & - \tabularnewline
36 & 2420.04 & - & - & - & - & - & - & - \tabularnewline
37 & 2608.89 & - & - & - & - & - & - & - \tabularnewline
38 & 2660.47 & - & - & - & - & - & - & - \tabularnewline
39 & 2493.98 & - & - & - & - & - & - & - \tabularnewline
40 & 2541.7 & - & - & - & - & - & - & - \tabularnewline
41 & 2554.6 & - & - & - & - & - & - & - \tabularnewline
42 & 2699.61 & - & - & - & - & - & - & - \tabularnewline
43 & 2805.48 & - & - & - & - & - & - & - \tabularnewline
44 & 2956.66 & - & - & - & - & - & - & - \tabularnewline
45 & 3149.51 & - & - & - & - & - & - & - \tabularnewline
46 & 3372.5 & 3199.4842 & 2923.1886 & 3475.7797 & 0.1098 & 0.6385 & 1 & 0.6385 \tabularnewline
47 & 3379.33 & 3199.4842 & 2738.0231 & 3660.9452 & 0.2225 & 0.2312 & 1 & 0.584 \tabularnewline
48 & 3517.54 & 3199.4842 & 2608.2537 & 3790.7146 & 0.1459 & 0.2755 & 0.9951 & 0.5658 \tabularnewline
49 & 3527.34 & 3199.4842 & 2502.232 & 3896.7363 & 0.1784 & 0.1856 & 0.9516 & 0.5559 \tabularnewline
50 & 3281.06 & 3199.4842 & 2410.3279 & 3988.6404 & 0.4197 & 0.2077 & 0.9097 & 0.5494 \tabularnewline
51 & 3089.65 & 3199.4842 & 2328.063 & 4070.9053 & 0.4024 & 0.4272 & 0.9437 & 0.5447 \tabularnewline
52 & 3222.76 & 3199.4842 & 2252.921 & 4146.0473 & 0.4808 & 0.59 & 0.9134 & 0.5412 \tabularnewline
53 & 3165.76 & 3199.4842 & 2183.3203 & 4215.648 & 0.4741 & 0.4821 & 0.8932 & 0.5384 \tabularnewline
54 & 3232.43 & 3199.4842 & 2118.1904 & 4280.7779 & 0.4762 & 0.5244 & 0.8176 & 0.5361 \tabularnewline
55 & 3229.54 & 3199.4842 & 2056.7667 & 4342.2016 & 0.4794 & 0.4775 & 0.7504 & 0.5342 \tabularnewline
56 & 3071.74 & 3199.4842 & 1998.4803 & 4400.488 & 0.4174 & 0.4804 & 0.6541 & 0.5325 \tabularnewline
57 & 2850.17 & 3199.4842 & 1942.8946 & 4456.0738 & 0.2929 & 0.579 & 0.5311 & 0.5311 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=105937&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[45])[/C][/ROW]
[ROW][C]33[/C][C]2672.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]2251.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]2046.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]2420.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2608.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2660.47[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]2493.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2541.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2554.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2699.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2805.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2956.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]3149.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3372.5[/C][C]3199.4842[/C][C]2923.1886[/C][C]3475.7797[/C][C]0.1098[/C][C]0.6385[/C][C]1[/C][C]0.6385[/C][/ROW]
[ROW][C]47[/C][C]3379.33[/C][C]3199.4842[/C][C]2738.0231[/C][C]3660.9452[/C][C]0.2225[/C][C]0.2312[/C][C]1[/C][C]0.584[/C][/ROW]
[ROW][C]48[/C][C]3517.54[/C][C]3199.4842[/C][C]2608.2537[/C][C]3790.7146[/C][C]0.1459[/C][C]0.2755[/C][C]0.9951[/C][C]0.5658[/C][/ROW]
[ROW][C]49[/C][C]3527.34[/C][C]3199.4842[/C][C]2502.232[/C][C]3896.7363[/C][C]0.1784[/C][C]0.1856[/C][C]0.9516[/C][C]0.5559[/C][/ROW]
[ROW][C]50[/C][C]3281.06[/C][C]3199.4842[/C][C]2410.3279[/C][C]3988.6404[/C][C]0.4197[/C][C]0.2077[/C][C]0.9097[/C][C]0.5494[/C][/ROW]
[ROW][C]51[/C][C]3089.65[/C][C]3199.4842[/C][C]2328.063[/C][C]4070.9053[/C][C]0.4024[/C][C]0.4272[/C][C]0.9437[/C][C]0.5447[/C][/ROW]
[ROW][C]52[/C][C]3222.76[/C][C]3199.4842[/C][C]2252.921[/C][C]4146.0473[/C][C]0.4808[/C][C]0.59[/C][C]0.9134[/C][C]0.5412[/C][/ROW]
[ROW][C]53[/C][C]3165.76[/C][C]3199.4842[/C][C]2183.3203[/C][C]4215.648[/C][C]0.4741[/C][C]0.4821[/C][C]0.8932[/C][C]0.5384[/C][/ROW]
[ROW][C]54[/C][C]3232.43[/C][C]3199.4842[/C][C]2118.1904[/C][C]4280.7779[/C][C]0.4762[/C][C]0.5244[/C][C]0.8176[/C][C]0.5361[/C][/ROW]
[ROW][C]55[/C][C]3229.54[/C][C]3199.4842[/C][C]2056.7667[/C][C]4342.2016[/C][C]0.4794[/C][C]0.4775[/C][C]0.7504[/C][C]0.5342[/C][/ROW]
[ROW][C]56[/C][C]3071.74[/C][C]3199.4842[/C][C]1998.4803[/C][C]4400.488[/C][C]0.4174[/C][C]0.4804[/C][C]0.6541[/C][C]0.5325[/C][/ROW]
[ROW][C]57[/C][C]2850.17[/C][C]3199.4842[/C][C]1942.8946[/C][C]4456.0738[/C][C]0.2929[/C][C]0.579[/C][C]0.5311[/C][C]0.5311[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=105937&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=105937&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[45])
332672.05-------
342251.23-------
352046.08-------
362420.04-------
372608.89-------
382660.47-------
392493.98-------
402541.7-------
412554.6-------
422699.61-------
432805.48-------
442956.66-------
453149.51-------
463372.53199.48422923.18863475.77970.10980.638510.6385
473379.333199.48422738.02313660.94520.22250.231210.584
483517.543199.48422608.25373790.71460.14590.27550.99510.5658
493527.343199.48422502.2323896.73630.17840.18560.95160.5559
503281.063199.48422410.32793988.64040.41970.20770.90970.5494
513089.653199.48422328.0634070.90530.40240.42720.94370.5447
523222.763199.48422252.9214146.04730.48080.590.91340.5412
533165.763199.48422183.32034215.6480.47410.48210.89320.5384
543232.433199.48422118.19044280.77790.47620.52440.81760.5361
553229.543199.48422056.76674342.20160.47940.47750.75040.5342
563071.743199.48421998.48034400.4880.41740.48040.65410.5325
572850.173199.48421942.89464456.07380.29290.5790.53110.5311







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
460.04410.0541029934.481800
470.07360.05620.055132344.527131139.5045176.4639
480.09430.09940.0699101159.51954479.5093233.4085
490.11120.10250.078107489.453667731.9954260.2537
500.12580.02550.06756654.618155516.5199235.6194
510.139-0.03430.06212063.542148274.357219.7143
520.15090.00730.0542541.764941455.4152203.606
530.162-0.01050.04871137.318836415.6532190.8289
540.17240.01030.04451085.428532490.0727180.25
550.18220.00940.0409903.353729331.4008171.2641
560.1915-0.03990.040916318.569728148.4161167.7749
570.2004-0.10920.0466122020.380535971.0798189.6604

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
46 & 0.0441 & 0.0541 & 0 & 29934.4818 & 0 & 0 \tabularnewline
47 & 0.0736 & 0.0562 & 0.0551 & 32344.5271 & 31139.5045 & 176.4639 \tabularnewline
48 & 0.0943 & 0.0994 & 0.0699 & 101159.519 & 54479.5093 & 233.4085 \tabularnewline
49 & 0.1112 & 0.1025 & 0.078 & 107489.4536 & 67731.9954 & 260.2537 \tabularnewline
50 & 0.1258 & 0.0255 & 0.0675 & 6654.6181 & 55516.5199 & 235.6194 \tabularnewline
51 & 0.139 & -0.0343 & 0.062 & 12063.5421 & 48274.357 & 219.7143 \tabularnewline
52 & 0.1509 & 0.0073 & 0.0542 & 541.7649 & 41455.4152 & 203.606 \tabularnewline
53 & 0.162 & -0.0105 & 0.0487 & 1137.3188 & 36415.6532 & 190.8289 \tabularnewline
54 & 0.1724 & 0.0103 & 0.0445 & 1085.4285 & 32490.0727 & 180.25 \tabularnewline
55 & 0.1822 & 0.0094 & 0.0409 & 903.3537 & 29331.4008 & 171.2641 \tabularnewline
56 & 0.1915 & -0.0399 & 0.0409 & 16318.5697 & 28148.4161 & 167.7749 \tabularnewline
57 & 0.2004 & -0.1092 & 0.0466 & 122020.3805 & 35971.0798 & 189.6604 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=105937&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]46[/C][C]0.0441[/C][C]0.0541[/C][C]0[/C][C]29934.4818[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]47[/C][C]0.0736[/C][C]0.0562[/C][C]0.0551[/C][C]32344.5271[/C][C]31139.5045[/C][C]176.4639[/C][/ROW]
[ROW][C]48[/C][C]0.0943[/C][C]0.0994[/C][C]0.0699[/C][C]101159.519[/C][C]54479.5093[/C][C]233.4085[/C][/ROW]
[ROW][C]49[/C][C]0.1112[/C][C]0.1025[/C][C]0.078[/C][C]107489.4536[/C][C]67731.9954[/C][C]260.2537[/C][/ROW]
[ROW][C]50[/C][C]0.1258[/C][C]0.0255[/C][C]0.0675[/C][C]6654.6181[/C][C]55516.5199[/C][C]235.6194[/C][/ROW]
[ROW][C]51[/C][C]0.139[/C][C]-0.0343[/C][C]0.062[/C][C]12063.5421[/C][C]48274.357[/C][C]219.7143[/C][/ROW]
[ROW][C]52[/C][C]0.1509[/C][C]0.0073[/C][C]0.0542[/C][C]541.7649[/C][C]41455.4152[/C][C]203.606[/C][/ROW]
[ROW][C]53[/C][C]0.162[/C][C]-0.0105[/C][C]0.0487[/C][C]1137.3188[/C][C]36415.6532[/C][C]190.8289[/C][/ROW]
[ROW][C]54[/C][C]0.1724[/C][C]0.0103[/C][C]0.0445[/C][C]1085.4285[/C][C]32490.0727[/C][C]180.25[/C][/ROW]
[ROW][C]55[/C][C]0.1822[/C][C]0.0094[/C][C]0.0409[/C][C]903.3537[/C][C]29331.4008[/C][C]171.2641[/C][/ROW]
[ROW][C]56[/C][C]0.1915[/C][C]-0.0399[/C][C]0.0409[/C][C]16318.5697[/C][C]28148.4161[/C][C]167.7749[/C][/ROW]
[ROW][C]57[/C][C]0.2004[/C][C]-0.1092[/C][C]0.0466[/C][C]122020.3805[/C][C]35971.0798[/C][C]189.6604[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=105937&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=105937&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
460.04410.0541029934.481800
470.07360.05620.055132344.527131139.5045176.4639
480.09430.09940.0699101159.51954479.5093233.4085
490.11120.10250.078107489.453667731.9954260.2537
500.12580.02550.06756654.618155516.5199235.6194
510.139-0.03430.06212063.542148274.357219.7143
520.15090.00730.0542541.764941455.4152203.606
530.162-0.01050.04871137.318836415.6532190.8289
540.17240.01030.04451085.428532490.0727180.25
550.18220.00940.0409903.353729331.4008171.2641
560.1915-0.03990.040916318.569728148.4161167.7749
570.2004-0.10920.0466122020.380535971.0798189.6604



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