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, 02 Dec 2014 17:41:35 +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/2014/Dec/02/t1417542125oaa7l8zgzykffwv.htm/, Retrieved Thu, 16 May 2024 11:37:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=262799, Retrieved Thu, 16 May 2024 11:37:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact81
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-14 11:54:22] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP     [ARIMA Forecasting] [] [2014-12-02 17:41:35] [d3a85ea23f6d8881e8b5a834ebd3a404] [Current]
Feedback Forum

Post a new message
Dataseries X:
46
62
66
59
58
61
41
27
58
70
49
59
44
36
72
45
56
54
53
35
61
52
47
51
52
63
74
45
51
64
36
30
55
64
39
40
63
45
59
55
40
64
27
28
45
57
45
69
60
56
58
50
51
53
37
22
55
70
62
58
39
49
58
47
42
62
39
40
72
70
54
65




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Maurice George Kendall' @ kendall.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 & 2 seconds \tabularnewline
R Server & 'Sir Maurice George Kendall' @ kendall.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=262799&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 Maurice George Kendall' @ kendall.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=262799&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=262799&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 Maurice George Kendall' @ kendall.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])
4869-------
4960-------
5056-------
5158-------
5250-------
5351-------
5453-------
5537-------
5622-------
5755-------
5870-------
5962-------
6058-------
613953.810730.601973.46240.06980.3380.26850.338
624955.418832.516974.94730.25970.95030.47670.3978
635854.424731.278174.06960.36070.70580.36070.3607
644751.127127.097171.16810.34320.25070.54390.2507
654253.377629.963273.14680.12970.73640.59320.3234
666251.729627.869171.69780.15670.83020.45040.2691
673949.430724.885169.68780.15640.1120.88550.2035
684044.908718.722365.7760.32240.71050.98430.1094
697254.311531.130873.97380.03890.92320.47260.3566
707059.008536.891978.14940.13020.09170.13020.5411
715456.355733.661475.78650.40610.08440.28460.4341
726551.823927.983771.78490.09790.41540.27210.2721

\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 & 69 & - & - & - & - & - & - & - \tabularnewline
49 & 60 & - & - & - & - & - & - & - \tabularnewline
50 & 56 & - & - & - & - & - & - & - \tabularnewline
51 & 58 & - & - & - & - & - & - & - \tabularnewline
52 & 50 & - & - & - & - & - & - & - \tabularnewline
53 & 51 & - & - & - & - & - & - & - \tabularnewline
54 & 53 & - & - & - & - & - & - & - \tabularnewline
55 & 37 & - & - & - & - & - & - & - \tabularnewline
56 & 22 & - & - & - & - & - & - & - \tabularnewline
57 & 55 & - & - & - & - & - & - & - \tabularnewline
58 & 70 & - & - & - & - & - & - & - \tabularnewline
59 & 62 & - & - & - & - & - & - & - \tabularnewline
60 & 58 & - & - & - & - & - & - & - \tabularnewline
61 & 39 & 53.8107 & 30.6019 & 73.4624 & 0.0698 & 0.338 & 0.2685 & 0.338 \tabularnewline
62 & 49 & 55.4188 & 32.5169 & 74.9473 & 0.2597 & 0.9503 & 0.4767 & 0.3978 \tabularnewline
63 & 58 & 54.4247 & 31.2781 & 74.0696 & 0.3607 & 0.7058 & 0.3607 & 0.3607 \tabularnewline
64 & 47 & 51.1271 & 27.0971 & 71.1681 & 0.3432 & 0.2507 & 0.5439 & 0.2507 \tabularnewline
65 & 42 & 53.3776 & 29.9632 & 73.1468 & 0.1297 & 0.7364 & 0.5932 & 0.3234 \tabularnewline
66 & 62 & 51.7296 & 27.8691 & 71.6978 & 0.1567 & 0.8302 & 0.4504 & 0.2691 \tabularnewline
67 & 39 & 49.4307 & 24.8851 & 69.6878 & 0.1564 & 0.112 & 0.8855 & 0.2035 \tabularnewline
68 & 40 & 44.9087 & 18.7223 & 65.776 & 0.3224 & 0.7105 & 0.9843 & 0.1094 \tabularnewline
69 & 72 & 54.3115 & 31.1308 & 73.9738 & 0.0389 & 0.9232 & 0.4726 & 0.3566 \tabularnewline
70 & 70 & 59.0085 & 36.8919 & 78.1494 & 0.1302 & 0.0917 & 0.1302 & 0.5411 \tabularnewline
71 & 54 & 56.3557 & 33.6614 & 75.7865 & 0.4061 & 0.0844 & 0.2846 & 0.4341 \tabularnewline
72 & 65 & 51.8239 & 27.9837 & 71.7849 & 0.0979 & 0.4154 & 0.2721 & 0.2721 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=262799&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]69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]60[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]50[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]70[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]39[/C][C]53.8107[/C][C]30.6019[/C][C]73.4624[/C][C]0.0698[/C][C]0.338[/C][C]0.2685[/C][C]0.338[/C][/ROW]
[ROW][C]62[/C][C]49[/C][C]55.4188[/C][C]32.5169[/C][C]74.9473[/C][C]0.2597[/C][C]0.9503[/C][C]0.4767[/C][C]0.3978[/C][/ROW]
[ROW][C]63[/C][C]58[/C][C]54.4247[/C][C]31.2781[/C][C]74.0696[/C][C]0.3607[/C][C]0.7058[/C][C]0.3607[/C][C]0.3607[/C][/ROW]
[ROW][C]64[/C][C]47[/C][C]51.1271[/C][C]27.0971[/C][C]71.1681[/C][C]0.3432[/C][C]0.2507[/C][C]0.5439[/C][C]0.2507[/C][/ROW]
[ROW][C]65[/C][C]42[/C][C]53.3776[/C][C]29.9632[/C][C]73.1468[/C][C]0.1297[/C][C]0.7364[/C][C]0.5932[/C][C]0.3234[/C][/ROW]
[ROW][C]66[/C][C]62[/C][C]51.7296[/C][C]27.8691[/C][C]71.6978[/C][C]0.1567[/C][C]0.8302[/C][C]0.4504[/C][C]0.2691[/C][/ROW]
[ROW][C]67[/C][C]39[/C][C]49.4307[/C][C]24.8851[/C][C]69.6878[/C][C]0.1564[/C][C]0.112[/C][C]0.8855[/C][C]0.2035[/C][/ROW]
[ROW][C]68[/C][C]40[/C][C]44.9087[/C][C]18.7223[/C][C]65.776[/C][C]0.3224[/C][C]0.7105[/C][C]0.9843[/C][C]0.1094[/C][/ROW]
[ROW][C]69[/C][C]72[/C][C]54.3115[/C][C]31.1308[/C][C]73.9738[/C][C]0.0389[/C][C]0.9232[/C][C]0.4726[/C][C]0.3566[/C][/ROW]
[ROW][C]70[/C][C]70[/C][C]59.0085[/C][C]36.8919[/C][C]78.1494[/C][C]0.1302[/C][C]0.0917[/C][C]0.1302[/C][C]0.5411[/C][/ROW]
[ROW][C]71[/C][C]54[/C][C]56.3557[/C][C]33.6614[/C][C]75.7865[/C][C]0.4061[/C][C]0.0844[/C][C]0.2846[/C][C]0.4341[/C][/ROW]
[ROW][C]72[/C][C]65[/C][C]51.8239[/C][C]27.9837[/C][C]71.7849[/C][C]0.0979[/C][C]0.4154[/C][C]0.2721[/C][C]0.2721[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=262799&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=262799&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])
4869-------
4960-------
5056-------
5158-------
5250-------
5351-------
5453-------
5537-------
5622-------
5755-------
5870-------
5962-------
6058-------
613953.810730.601973.46240.06980.3380.26850.338
624955.418832.516974.94730.25970.95030.47670.3978
635854.424731.278174.06960.36070.70580.36070.3607
644751.127127.097171.16810.34320.25070.54390.2507
654253.377629.963273.14680.12970.73640.59320.3234
666251.729627.869171.69780.15670.83020.45040.2691
673949.430724.885169.68780.15640.1120.88550.2035
684044.908718.722365.7760.32240.71050.98430.1094
697254.311531.130873.97380.03890.92320.47260.3566
707059.008536.891978.14940.13020.09170.13020.5411
715456.355733.661475.78650.40610.08440.28460.4341
726551.823927.983771.78490.09790.41540.27210.2721







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.1863-0.37980.37980.3192219.356600-1.16371.1637
620.1798-0.1310.25540.221141.2014130.27911.414-0.50430.834
630.18420.06160.19080.168612.783191.11379.54530.28090.6497
640.2-0.08780.16510.147517.03372.59358.5202-0.32430.5683
650.189-0.27090.18620.1657129.450883.9659.1632-0.8940.6334
660.19690.16570.18280.1682105.48287.55119.35690.8070.6624
670.2091-0.26750.19490.1778108.800190.58679.5177-0.81960.6848
680.2371-0.12270.18590.170124.095182.27529.0706-0.38570.6474
690.18470.24570.19250.1823312.8834107.898410.38741.38980.7299
700.16550.1570.1890.1811120.8127109.189810.44940.86360.7433
710.1759-0.04360.17580.16855.549599.7689.9884-0.18510.6925
720.19650.20270.1780.1733173.6092105.921410.29181.03530.7211

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
61 & 0.1863 & -0.3798 & 0.3798 & 0.3192 & 219.3566 & 0 & 0 & -1.1637 & 1.1637 \tabularnewline
62 & 0.1798 & -0.131 & 0.2554 & 0.2211 & 41.2014 & 130.279 & 11.414 & -0.5043 & 0.834 \tabularnewline
63 & 0.1842 & 0.0616 & 0.1908 & 0.1686 & 12.7831 & 91.1137 & 9.5453 & 0.2809 & 0.6497 \tabularnewline
64 & 0.2 & -0.0878 & 0.1651 & 0.1475 & 17.033 & 72.5935 & 8.5202 & -0.3243 & 0.5683 \tabularnewline
65 & 0.189 & -0.2709 & 0.1862 & 0.1657 & 129.4508 & 83.965 & 9.1632 & -0.894 & 0.6334 \tabularnewline
66 & 0.1969 & 0.1657 & 0.1828 & 0.1682 & 105.482 & 87.5511 & 9.3569 & 0.807 & 0.6624 \tabularnewline
67 & 0.2091 & -0.2675 & 0.1949 & 0.1778 & 108.8001 & 90.5867 & 9.5177 & -0.8196 & 0.6848 \tabularnewline
68 & 0.2371 & -0.1227 & 0.1859 & 0.1701 & 24.0951 & 82.2752 & 9.0706 & -0.3857 & 0.6474 \tabularnewline
69 & 0.1847 & 0.2457 & 0.1925 & 0.1823 & 312.8834 & 107.8984 & 10.3874 & 1.3898 & 0.7299 \tabularnewline
70 & 0.1655 & 0.157 & 0.189 & 0.1811 & 120.8127 & 109.1898 & 10.4494 & 0.8636 & 0.7433 \tabularnewline
71 & 0.1759 & -0.0436 & 0.1758 & 0.1685 & 5.5495 & 99.768 & 9.9884 & -0.1851 & 0.6925 \tabularnewline
72 & 0.1965 & 0.2027 & 0.178 & 0.1733 & 173.6092 & 105.9214 & 10.2918 & 1.0353 & 0.7211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=262799&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]61[/C][C]0.1863[/C][C]-0.3798[/C][C]0.3798[/C][C]0.3192[/C][C]219.3566[/C][C]0[/C][C]0[/C][C]-1.1637[/C][C]1.1637[/C][/ROW]
[ROW][C]62[/C][C]0.1798[/C][C]-0.131[/C][C]0.2554[/C][C]0.2211[/C][C]41.2014[/C][C]130.279[/C][C]11.414[/C][C]-0.5043[/C][C]0.834[/C][/ROW]
[ROW][C]63[/C][C]0.1842[/C][C]0.0616[/C][C]0.1908[/C][C]0.1686[/C][C]12.7831[/C][C]91.1137[/C][C]9.5453[/C][C]0.2809[/C][C]0.6497[/C][/ROW]
[ROW][C]64[/C][C]0.2[/C][C]-0.0878[/C][C]0.1651[/C][C]0.1475[/C][C]17.033[/C][C]72.5935[/C][C]8.5202[/C][C]-0.3243[/C][C]0.5683[/C][/ROW]
[ROW][C]65[/C][C]0.189[/C][C]-0.2709[/C][C]0.1862[/C][C]0.1657[/C][C]129.4508[/C][C]83.965[/C][C]9.1632[/C][C]-0.894[/C][C]0.6334[/C][/ROW]
[ROW][C]66[/C][C]0.1969[/C][C]0.1657[/C][C]0.1828[/C][C]0.1682[/C][C]105.482[/C][C]87.5511[/C][C]9.3569[/C][C]0.807[/C][C]0.6624[/C][/ROW]
[ROW][C]67[/C][C]0.2091[/C][C]-0.2675[/C][C]0.1949[/C][C]0.1778[/C][C]108.8001[/C][C]90.5867[/C][C]9.5177[/C][C]-0.8196[/C][C]0.6848[/C][/ROW]
[ROW][C]68[/C][C]0.2371[/C][C]-0.1227[/C][C]0.1859[/C][C]0.1701[/C][C]24.0951[/C][C]82.2752[/C][C]9.0706[/C][C]-0.3857[/C][C]0.6474[/C][/ROW]
[ROW][C]69[/C][C]0.1847[/C][C]0.2457[/C][C]0.1925[/C][C]0.1823[/C][C]312.8834[/C][C]107.8984[/C][C]10.3874[/C][C]1.3898[/C][C]0.7299[/C][/ROW]
[ROW][C]70[/C][C]0.1655[/C][C]0.157[/C][C]0.189[/C][C]0.1811[/C][C]120.8127[/C][C]109.1898[/C][C]10.4494[/C][C]0.8636[/C][C]0.7433[/C][/ROW]
[ROW][C]71[/C][C]0.1759[/C][C]-0.0436[/C][C]0.1758[/C][C]0.1685[/C][C]5.5495[/C][C]99.768[/C][C]9.9884[/C][C]-0.1851[/C][C]0.6925[/C][/ROW]
[ROW][C]72[/C][C]0.1965[/C][C]0.2027[/C][C]0.178[/C][C]0.1733[/C][C]173.6092[/C][C]105.9214[/C][C]10.2918[/C][C]1.0353[/C][C]0.7211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=262799&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=262799&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.1863-0.37980.37980.3192219.356600-1.16371.1637
620.1798-0.1310.25540.221141.2014130.27911.414-0.50430.834
630.18420.06160.19080.168612.783191.11379.54530.28090.6497
640.2-0.08780.16510.147517.03372.59358.5202-0.32430.5683
650.189-0.27090.18620.1657129.450883.9659.1632-0.8940.6334
660.19690.16570.18280.1682105.48287.55119.35690.8070.6624
670.2091-0.26750.19490.1778108.800190.58679.5177-0.81960.6848
680.2371-0.12270.18590.170124.095182.27529.0706-0.38570.6474
690.18470.24570.19250.1823312.8834107.898410.38741.38980.7299
700.16550.1570.1890.1811120.8127109.189810.44940.86360.7433
710.1759-0.04360.17580.16855.549599.7689.9884-0.18510.6925
720.19650.20270.1780.1733173.6092105.921410.29181.03530.7211



Parameters (Session):
par1 = 12 ; par2 = 1.4 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1.4 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '0'
par6 <- '3'
par5 <- '12'
par4 <- '0'
par3 <- '0'
par2 <- '1.4'
par1 <- '12'
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')