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 computationTue, 06 Dec 2011 09:13:35 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/06/t13231808269f377s9bslxw35r.htm/, Retrieved Mon, 29 Apr 2024 03:52:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151600, Retrieved Mon, 29 Apr 2024 03:52:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact76
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]
- R PD        [ARIMA Forecasting] [] [2011-12-06 14:13:35] [fdaf10f0fcbe7b8f79ecbd42ec74e6ad] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
2502,66
2539,91
2482,6
2626,15
2656,32
2446,66
2467,38
2462,32
2504,58
2579,39
2649,24
2636,87
2613,94
2634,01
2711,94
2646,43
2717,79
2701,54
2572,98
2488,92
2204,91
2123,99
2149,1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\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 & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151600&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]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151600&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151600&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'Herman Ole Andreas Wold' @ wold.wessa.net







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[60])
482513.17-------
492466.92-------
502502.66-------
512539.91-------
522482.6-------
532626.15-------
542656.32-------
552446.66-------
562467.38-------
572462.32-------
582504.58-------
592579.39-------
602649.24-------
612636.872667.62962321.22063014.03860.43090.54140.87190.5414
622613.942672.47112114.34853230.59360.41860.54970.72450.5325
632634.012673.74571949.45763398.03390.45720.56430.64140.5264
642711.942674.08131811.78093536.38160.46570.53630.66830.5225
652646.432674.16961692.28843656.05090.47790.46990.53820.5198
662717.792674.19291585.60153762.78430.46870.51990.51280.5179
672701.542674.1991488.41643859.98160.4820.47130.64660.5165
682572.982674.20061398.59963949.80160.43820.48320.62470.5153
692488.922674.20111314.74033.70210.39470.5580.620.5144
702204.912674.20121235.68454112.71780.26130.59970.59140.5136
712123.992674.20121160.78864187.61380.23810.72830.54890.5129
722149.12674.20121089.42824258.97420.2580.75190.51230.5123

\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[60]) \tabularnewline
48 & 2513.17 & - & - & - & - & - & - & - \tabularnewline
49 & 2466.92 & - & - & - & - & - & - & - \tabularnewline
50 & 2502.66 & - & - & - & - & - & - & - \tabularnewline
51 & 2539.91 & - & - & - & - & - & - & - \tabularnewline
52 & 2482.6 & - & - & - & - & - & - & - \tabularnewline
53 & 2626.15 & - & - & - & - & - & - & - \tabularnewline
54 & 2656.32 & - & - & - & - & - & - & - \tabularnewline
55 & 2446.66 & - & - & - & - & - & - & - \tabularnewline
56 & 2467.38 & - & - & - & - & - & - & - \tabularnewline
57 & 2462.32 & - & - & - & - & - & - & - \tabularnewline
58 & 2504.58 & - & - & - & - & - & - & - \tabularnewline
59 & 2579.39 & - & - & - & - & - & - & - \tabularnewline
60 & 2649.24 & - & - & - & - & - & - & - \tabularnewline
61 & 2636.87 & 2667.6296 & 2321.2206 & 3014.0386 & 0.4309 & 0.5414 & 0.8719 & 0.5414 \tabularnewline
62 & 2613.94 & 2672.4711 & 2114.3485 & 3230.5936 & 0.4186 & 0.5497 & 0.7245 & 0.5325 \tabularnewline
63 & 2634.01 & 2673.7457 & 1949.4576 & 3398.0339 & 0.4572 & 0.5643 & 0.6414 & 0.5264 \tabularnewline
64 & 2711.94 & 2674.0813 & 1811.7809 & 3536.3816 & 0.4657 & 0.5363 & 0.6683 & 0.5225 \tabularnewline
65 & 2646.43 & 2674.1696 & 1692.2884 & 3656.0509 & 0.4779 & 0.4699 & 0.5382 & 0.5198 \tabularnewline
66 & 2717.79 & 2674.1929 & 1585.6015 & 3762.7843 & 0.4687 & 0.5199 & 0.5128 & 0.5179 \tabularnewline
67 & 2701.54 & 2674.199 & 1488.4164 & 3859.9816 & 0.482 & 0.4713 & 0.6466 & 0.5165 \tabularnewline
68 & 2572.98 & 2674.2006 & 1398.5996 & 3949.8016 & 0.4382 & 0.4832 & 0.6247 & 0.5153 \tabularnewline
69 & 2488.92 & 2674.2011 & 1314.7 & 4033.7021 & 0.3947 & 0.558 & 0.62 & 0.5144 \tabularnewline
70 & 2204.91 & 2674.2012 & 1235.6845 & 4112.7178 & 0.2613 & 0.5997 & 0.5914 & 0.5136 \tabularnewline
71 & 2123.99 & 2674.2012 & 1160.7886 & 4187.6138 & 0.2381 & 0.7283 & 0.5489 & 0.5129 \tabularnewline
72 & 2149.1 & 2674.2012 & 1089.4282 & 4258.9742 & 0.258 & 0.7519 & 0.5123 & 0.5123 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151600&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[60])[/C][/ROW]
[ROW][C]48[/C][C]2513.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2466.92[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]2502.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]2539.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]2482.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]2626.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]2656.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]2446.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]2467.38[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]2462.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]2504.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]2579.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]2649.24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]2636.87[/C][C]2667.6296[/C][C]2321.2206[/C][C]3014.0386[/C][C]0.4309[/C][C]0.5414[/C][C]0.8719[/C][C]0.5414[/C][/ROW]
[ROW][C]62[/C][C]2613.94[/C][C]2672.4711[/C][C]2114.3485[/C][C]3230.5936[/C][C]0.4186[/C][C]0.5497[/C][C]0.7245[/C][C]0.5325[/C][/ROW]
[ROW][C]63[/C][C]2634.01[/C][C]2673.7457[/C][C]1949.4576[/C][C]3398.0339[/C][C]0.4572[/C][C]0.5643[/C][C]0.6414[/C][C]0.5264[/C][/ROW]
[ROW][C]64[/C][C]2711.94[/C][C]2674.0813[/C][C]1811.7809[/C][C]3536.3816[/C][C]0.4657[/C][C]0.5363[/C][C]0.6683[/C][C]0.5225[/C][/ROW]
[ROW][C]65[/C][C]2646.43[/C][C]2674.1696[/C][C]1692.2884[/C][C]3656.0509[/C][C]0.4779[/C][C]0.4699[/C][C]0.5382[/C][C]0.5198[/C][/ROW]
[ROW][C]66[/C][C]2717.79[/C][C]2674.1929[/C][C]1585.6015[/C][C]3762.7843[/C][C]0.4687[/C][C]0.5199[/C][C]0.5128[/C][C]0.5179[/C][/ROW]
[ROW][C]67[/C][C]2701.54[/C][C]2674.199[/C][C]1488.4164[/C][C]3859.9816[/C][C]0.482[/C][C]0.4713[/C][C]0.6466[/C][C]0.5165[/C][/ROW]
[ROW][C]68[/C][C]2572.98[/C][C]2674.2006[/C][C]1398.5996[/C][C]3949.8016[/C][C]0.4382[/C][C]0.4832[/C][C]0.6247[/C][C]0.5153[/C][/ROW]
[ROW][C]69[/C][C]2488.92[/C][C]2674.2011[/C][C]1314.7[/C][C]4033.7021[/C][C]0.3947[/C][C]0.558[/C][C]0.62[/C][C]0.5144[/C][/ROW]
[ROW][C]70[/C][C]2204.91[/C][C]2674.2012[/C][C]1235.6845[/C][C]4112.7178[/C][C]0.2613[/C][C]0.5997[/C][C]0.5914[/C][C]0.5136[/C][/ROW]
[ROW][C]71[/C][C]2123.99[/C][C]2674.2012[/C][C]1160.7886[/C][C]4187.6138[/C][C]0.2381[/C][C]0.7283[/C][C]0.5489[/C][C]0.5129[/C][/ROW]
[ROW][C]72[/C][C]2149.1[/C][C]2674.2012[/C][C]1089.4282[/C][C]4258.9742[/C][C]0.258[/C][C]0.7519[/C][C]0.5123[/C][C]0.5123[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151600&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151600&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[60])
482513.17-------
492466.92-------
502502.66-------
512539.91-------
522482.6-------
532626.15-------
542656.32-------
552446.66-------
562467.38-------
572462.32-------
582504.58-------
592579.39-------
602649.24-------
612636.872667.62962321.22063014.03860.43090.54140.87190.5414
622613.942672.47112114.34853230.59360.41860.54970.72450.5325
632634.012673.74571949.45763398.03390.45720.56430.64140.5264
642711.942674.08131811.78093536.38160.46570.53630.66830.5225
652646.432674.16961692.28843656.05090.47790.46990.53820.5198
662717.792674.19291585.60153762.78430.46870.51990.51280.5179
672701.542674.1991488.41643859.98160.4820.47130.64660.5165
682572.982674.20061398.59963949.80160.43820.48320.62470.5153
692488.922674.20111314.74033.70210.39470.5580.620.5144
702204.912674.20121235.68454112.71780.26130.59970.59140.5136
712123.992674.20121160.78864187.61380.23810.72830.54890.5129
722149.12674.20121089.42824258.97420.2580.75190.51230.5123







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0663-0.01150946.152900
620.1066-0.02190.01673425.88722186.020146.7549
630.1382-0.01490.01611578.92651983.655644.5382
640.16450.01420.01561433.28241846.062342.9658
650.1873-0.01040.0146769.48721630.747240.3825
660.20770.01630.01491900.70791675.740740.9358
670.22620.01020.0142747.52951543.139139.2828
680.2434-0.03790.017210245.61532630.948651.2928
690.2594-0.06930.022934329.06796152.961978.4408
700.2745-0.17550.0382220234.195627561.0852166.0153
710.2887-0.20570.0534302732.356252576.6553229.296
720.3024-0.19640.0653275731.270471172.8733266.7824

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0663 & -0.0115 & 0 & 946.1529 & 0 & 0 \tabularnewline
62 & 0.1066 & -0.0219 & 0.0167 & 3425.8872 & 2186.0201 & 46.7549 \tabularnewline
63 & 0.1382 & -0.0149 & 0.0161 & 1578.9265 & 1983.6556 & 44.5382 \tabularnewline
64 & 0.1645 & 0.0142 & 0.0156 & 1433.2824 & 1846.0623 & 42.9658 \tabularnewline
65 & 0.1873 & -0.0104 & 0.0146 & 769.4872 & 1630.7472 & 40.3825 \tabularnewline
66 & 0.2077 & 0.0163 & 0.0149 & 1900.7079 & 1675.7407 & 40.9358 \tabularnewline
67 & 0.2262 & 0.0102 & 0.0142 & 747.5295 & 1543.1391 & 39.2828 \tabularnewline
68 & 0.2434 & -0.0379 & 0.0172 & 10245.6153 & 2630.9486 & 51.2928 \tabularnewline
69 & 0.2594 & -0.0693 & 0.0229 & 34329.0679 & 6152.9619 & 78.4408 \tabularnewline
70 & 0.2745 & -0.1755 & 0.0382 & 220234.1956 & 27561.0852 & 166.0153 \tabularnewline
71 & 0.2887 & -0.2057 & 0.0534 & 302732.3562 & 52576.6553 & 229.296 \tabularnewline
72 & 0.3024 & -0.1964 & 0.0653 & 275731.2704 & 71172.8733 & 266.7824 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151600&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]61[/C][C]0.0663[/C][C]-0.0115[/C][C]0[/C][C]946.1529[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.1066[/C][C]-0.0219[/C][C]0.0167[/C][C]3425.8872[/C][C]2186.0201[/C][C]46.7549[/C][/ROW]
[ROW][C]63[/C][C]0.1382[/C][C]-0.0149[/C][C]0.0161[/C][C]1578.9265[/C][C]1983.6556[/C][C]44.5382[/C][/ROW]
[ROW][C]64[/C][C]0.1645[/C][C]0.0142[/C][C]0.0156[/C][C]1433.2824[/C][C]1846.0623[/C][C]42.9658[/C][/ROW]
[ROW][C]65[/C][C]0.1873[/C][C]-0.0104[/C][C]0.0146[/C][C]769.4872[/C][C]1630.7472[/C][C]40.3825[/C][/ROW]
[ROW][C]66[/C][C]0.2077[/C][C]0.0163[/C][C]0.0149[/C][C]1900.7079[/C][C]1675.7407[/C][C]40.9358[/C][/ROW]
[ROW][C]67[/C][C]0.2262[/C][C]0.0102[/C][C]0.0142[/C][C]747.5295[/C][C]1543.1391[/C][C]39.2828[/C][/ROW]
[ROW][C]68[/C][C]0.2434[/C][C]-0.0379[/C][C]0.0172[/C][C]10245.6153[/C][C]2630.9486[/C][C]51.2928[/C][/ROW]
[ROW][C]69[/C][C]0.2594[/C][C]-0.0693[/C][C]0.0229[/C][C]34329.0679[/C][C]6152.9619[/C][C]78.4408[/C][/ROW]
[ROW][C]70[/C][C]0.2745[/C][C]-0.1755[/C][C]0.0382[/C][C]220234.1956[/C][C]27561.0852[/C][C]166.0153[/C][/ROW]
[ROW][C]71[/C][C]0.2887[/C][C]-0.2057[/C][C]0.0534[/C][C]302732.3562[/C][C]52576.6553[/C][C]229.296[/C][/ROW]
[ROW][C]72[/C][C]0.3024[/C][C]-0.1964[/C][C]0.0653[/C][C]275731.2704[/C][C]71172.8733[/C][C]266.7824[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151600&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151600&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
610.0663-0.01150946.152900
620.1066-0.02190.01673425.88722186.020146.7549
630.1382-0.01490.01611578.92651983.655644.5382
640.16450.01420.01561433.28241846.062342.9658
650.1873-0.01040.0146769.48721630.747240.3825
660.20770.01630.01491900.70791675.740740.9358
670.22620.01020.0142747.52951543.139139.2828
680.2434-0.03790.017210245.61532630.948651.2928
690.2594-0.06930.022934329.06796152.961978.4408
700.2745-0.17550.0382220234.195627561.0852166.0153
710.2887-0.20570.0534302732.356252576.6553229.296
720.3024-0.19640.0653275731.270471172.8733266.7824



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