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 computationSun, 18 Dec 2016 18:27:11 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/18/t1482082303ne80ro0zy3go4iq.htm/, Retrieved Fri, 01 Nov 2024 03:36:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301199, Retrieved Fri, 01 Nov 2024 03:36:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact82
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecast n2383] [2016-12-18 17:27:11] [afe7f6443461a2cd6ee0b843643e84a9] [Current]
Feedback Forum

Post a new message
Dataseries X:
2119.9
2108.7
2092
2104.2
2110.1
2114
2138.8
2165.5
2155.1
2135.2
2163.1
2175.2
2183.3
2201.5
2212.3
2223.8
2241.9
2269.2
2261.4
2273.4
2299.3
2315.5
2338.7
2333
2311
2303.6
2310.5
2295.8
2265.5
2271.1
2231.9
2245
2249.7
2300.5
2280.4
2290.7
2261.5
2259.1
2249.8
2271.2
2259
2259.4
2250.2
2243.3
2234.3
2216.5
2197.6
2211.7
2206.7
2214.6
2229.8
2219.5
2213.8
2214.1
2224.1
2229.6
2251.7
2262.9
2268.9
2293.7
2312.4
2342
2327.4
2366.2
2371.8
2364.4
2370.5
2412.8
2447.3
2443.5
2459.3
2480.7
2504.4
2505.5
2534
2538.7
2538.1
2522
2566.4
2572.8
2557.3
2541
2540.7
2508.5
2567.1
2553.6
2522.4
2520.6
2499.4
2470.8
2479.3
2481.8
2470.3
2491
2479.1
2456.6
2456.1
2482.2
2444.7
2425.3
2389.3
2367.7
2339.3
2342.4
2343.6
2346.3
2363.5
2338.7
2369.4
2356
2348.6
2349.7
2371.9
2364.9
2394.1
2399.2




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301199&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301199&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301199&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[104])
922481.8-------
932470.3-------
942491-------
952479.1-------
962456.6-------
972456.1-------
982482.2-------
992444.7-------
1002425.3-------
1012389.3-------
1022367.7-------
1032339.3-------
1042342.4-------
1052343.62334.63662296.79192372.85290.32290.345300.3453
1062346.32327.51372271.36512384.4870.2590.2900.3043
1072363.52320.97762249.13982394.17480.12740.248900.2831
1082338.72314.97912228.66572403.26770.29920.14078e-040.2713
1092369.42309.47322209.41652412.20050.12640.28850.00260.2649
11023562304.41882191.13482421.14620.19320.13760.00140.2618
1112348.62299.77862173.67152430.17640.23150.1990.01470.2609
1122349.72295.5182156.9292439.31680.23010.23470.03850.2614
1132371.92291.60562140.83772448.5710.1580.23410.11130.263
1142364.92288.01272125.34392457.93170.18760.16660.1790.2652
1152394.12284.7132110.40462467.38590.12030.19480.2790.268
1162399.22281.68232095.9832476.91840.1190.12950.27110.2711

\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[104]) \tabularnewline
92 & 2481.8 & - & - & - & - & - & - & - \tabularnewline
93 & 2470.3 & - & - & - & - & - & - & - \tabularnewline
94 & 2491 & - & - & - & - & - & - & - \tabularnewline
95 & 2479.1 & - & - & - & - & - & - & - \tabularnewline
96 & 2456.6 & - & - & - & - & - & - & - \tabularnewline
97 & 2456.1 & - & - & - & - & - & - & - \tabularnewline
98 & 2482.2 & - & - & - & - & - & - & - \tabularnewline
99 & 2444.7 & - & - & - & - & - & - & - \tabularnewline
100 & 2425.3 & - & - & - & - & - & - & - \tabularnewline
101 & 2389.3 & - & - & - & - & - & - & - \tabularnewline
102 & 2367.7 & - & - & - & - & - & - & - \tabularnewline
103 & 2339.3 & - & - & - & - & - & - & - \tabularnewline
104 & 2342.4 & - & - & - & - & - & - & - \tabularnewline
105 & 2343.6 & 2334.6366 & 2296.7919 & 2372.8529 & 0.3229 & 0.3453 & 0 & 0.3453 \tabularnewline
106 & 2346.3 & 2327.5137 & 2271.3651 & 2384.487 & 0.259 & 0.29 & 0 & 0.3043 \tabularnewline
107 & 2363.5 & 2320.9776 & 2249.1398 & 2394.1748 & 0.1274 & 0.2489 & 0 & 0.2831 \tabularnewline
108 & 2338.7 & 2314.9791 & 2228.6657 & 2403.2677 & 0.2992 & 0.1407 & 8e-04 & 0.2713 \tabularnewline
109 & 2369.4 & 2309.4732 & 2209.4165 & 2412.2005 & 0.1264 & 0.2885 & 0.0026 & 0.2649 \tabularnewline
110 & 2356 & 2304.4188 & 2191.1348 & 2421.1462 & 0.1932 & 0.1376 & 0.0014 & 0.2618 \tabularnewline
111 & 2348.6 & 2299.7786 & 2173.6715 & 2430.1764 & 0.2315 & 0.199 & 0.0147 & 0.2609 \tabularnewline
112 & 2349.7 & 2295.518 & 2156.929 & 2439.3168 & 0.2301 & 0.2347 & 0.0385 & 0.2614 \tabularnewline
113 & 2371.9 & 2291.6056 & 2140.8377 & 2448.571 & 0.158 & 0.2341 & 0.1113 & 0.263 \tabularnewline
114 & 2364.9 & 2288.0127 & 2125.3439 & 2457.9317 & 0.1876 & 0.1666 & 0.179 & 0.2652 \tabularnewline
115 & 2394.1 & 2284.713 & 2110.4046 & 2467.3859 & 0.1203 & 0.1948 & 0.279 & 0.268 \tabularnewline
116 & 2399.2 & 2281.6823 & 2095.983 & 2476.9184 & 0.119 & 0.1295 & 0.2711 & 0.2711 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301199&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[104])[/C][/ROW]
[ROW][C]92[/C][C]2481.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2470.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]2491[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2479.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2456.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2456.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2482.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]2444.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]2425.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]2389.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]2367.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]2339.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]2342.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]2343.6[/C][C]2334.6366[/C][C]2296.7919[/C][C]2372.8529[/C][C]0.3229[/C][C]0.3453[/C][C]0[/C][C]0.3453[/C][/ROW]
[ROW][C]106[/C][C]2346.3[/C][C]2327.5137[/C][C]2271.3651[/C][C]2384.487[/C][C]0.259[/C][C]0.29[/C][C]0[/C][C]0.3043[/C][/ROW]
[ROW][C]107[/C][C]2363.5[/C][C]2320.9776[/C][C]2249.1398[/C][C]2394.1748[/C][C]0.1274[/C][C]0.2489[/C][C]0[/C][C]0.2831[/C][/ROW]
[ROW][C]108[/C][C]2338.7[/C][C]2314.9791[/C][C]2228.6657[/C][C]2403.2677[/C][C]0.2992[/C][C]0.1407[/C][C]8e-04[/C][C]0.2713[/C][/ROW]
[ROW][C]109[/C][C]2369.4[/C][C]2309.4732[/C][C]2209.4165[/C][C]2412.2005[/C][C]0.1264[/C][C]0.2885[/C][C]0.0026[/C][C]0.2649[/C][/ROW]
[ROW][C]110[/C][C]2356[/C][C]2304.4188[/C][C]2191.1348[/C][C]2421.1462[/C][C]0.1932[/C][C]0.1376[/C][C]0.0014[/C][C]0.2618[/C][/ROW]
[ROW][C]111[/C][C]2348.6[/C][C]2299.7786[/C][C]2173.6715[/C][C]2430.1764[/C][C]0.2315[/C][C]0.199[/C][C]0.0147[/C][C]0.2609[/C][/ROW]
[ROW][C]112[/C][C]2349.7[/C][C]2295.518[/C][C]2156.929[/C][C]2439.3168[/C][C]0.2301[/C][C]0.2347[/C][C]0.0385[/C][C]0.2614[/C][/ROW]
[ROW][C]113[/C][C]2371.9[/C][C]2291.6056[/C][C]2140.8377[/C][C]2448.571[/C][C]0.158[/C][C]0.2341[/C][C]0.1113[/C][C]0.263[/C][/ROW]
[ROW][C]114[/C][C]2364.9[/C][C]2288.0127[/C][C]2125.3439[/C][C]2457.9317[/C][C]0.1876[/C][C]0.1666[/C][C]0.179[/C][C]0.2652[/C][/ROW]
[ROW][C]115[/C][C]2394.1[/C][C]2284.713[/C][C]2110.4046[/C][C]2467.3859[/C][C]0.1203[/C][C]0.1948[/C][C]0.279[/C][C]0.268[/C][/ROW]
[ROW][C]116[/C][C]2399.2[/C][C]2281.6823[/C][C]2095.983[/C][C]2476.9184[/C][C]0.119[/C][C]0.1295[/C][C]0.2711[/C][C]0.2711[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301199&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301199&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[104])
922481.8-------
932470.3-------
942491-------
952479.1-------
962456.6-------
972456.1-------
982482.2-------
992444.7-------
1002425.3-------
1012389.3-------
1022367.7-------
1032339.3-------
1042342.4-------
1052343.62334.63662296.79192372.85290.32290.345300.3453
1062346.32327.51372271.36512384.4870.2590.2900.3043
1072363.52320.97762249.13982394.17480.12740.248900.2831
1082338.72314.97912228.66572403.26770.29920.14078e-040.2713
1092369.42309.47322209.41652412.20050.12640.28850.00260.2649
11023562304.41882191.13482421.14620.19320.13760.00140.2618
1112348.62299.77862173.67152430.17640.23150.1990.01470.2609
1122349.72295.5182156.9292439.31680.23010.23470.03850.2614
1132371.92291.60562140.83772448.5710.1580.23410.11130.263
1142364.92288.01272125.34392457.93170.18760.16660.1790.2652
1152394.12284.7132110.40462467.38590.12030.19480.2790.268
1162399.22281.68232095.9832476.91840.1190.12950.27110.2711







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.00840.00380.00380.003880.3431000.61320.6132
1060.01250.0080.00590.0059352.9242216.633614.71851.28510.9492
1070.01610.0180.00990.011808.1529747.140127.33392.90891.6024
1080.01950.01010.010.0101562.6822701.025626.47691.62271.6075
1090.02270.02530.01310.01323591.22461279.065435.7644.09952.1059
1100.02580.02190.01450.01472660.61511509.323738.853.52862.343
1110.02890.02080.01540.01562383.53321634.210840.42543.33982.4854
1120.0320.02310.01640.01652935.69411796.896242.38983.70652.638
1130.03490.03390.01830.01856447.18992313.595548.09985.49282.9552
1140.03790.03250.01970.025911.65112673.40151.70495.25973.1857
1150.04080.04570.02210.022411965.51493518.138759.31397.48293.5763
1160.04370.0490.02430.024713810.41754375.828666.158.03913.9482

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.0084 & 0.0038 & 0.0038 & 0.0038 & 80.3431 & 0 & 0 & 0.6132 & 0.6132 \tabularnewline
106 & 0.0125 & 0.008 & 0.0059 & 0.0059 & 352.9242 & 216.6336 & 14.7185 & 1.2851 & 0.9492 \tabularnewline
107 & 0.0161 & 0.018 & 0.0099 & 0.01 & 1808.1529 & 747.1401 & 27.3339 & 2.9089 & 1.6024 \tabularnewline
108 & 0.0195 & 0.0101 & 0.01 & 0.0101 & 562.6822 & 701.0256 & 26.4769 & 1.6227 & 1.6075 \tabularnewline
109 & 0.0227 & 0.0253 & 0.0131 & 0.0132 & 3591.2246 & 1279.0654 & 35.764 & 4.0995 & 2.1059 \tabularnewline
110 & 0.0258 & 0.0219 & 0.0145 & 0.0147 & 2660.6151 & 1509.3237 & 38.85 & 3.5286 & 2.343 \tabularnewline
111 & 0.0289 & 0.0208 & 0.0154 & 0.0156 & 2383.5332 & 1634.2108 & 40.4254 & 3.3398 & 2.4854 \tabularnewline
112 & 0.032 & 0.0231 & 0.0164 & 0.0165 & 2935.6941 & 1796.8962 & 42.3898 & 3.7065 & 2.638 \tabularnewline
113 & 0.0349 & 0.0339 & 0.0183 & 0.0185 & 6447.1899 & 2313.5955 & 48.0998 & 5.4928 & 2.9552 \tabularnewline
114 & 0.0379 & 0.0325 & 0.0197 & 0.02 & 5911.6511 & 2673.401 & 51.7049 & 5.2597 & 3.1857 \tabularnewline
115 & 0.0408 & 0.0457 & 0.0221 & 0.0224 & 11965.5149 & 3518.1387 & 59.3139 & 7.4829 & 3.5763 \tabularnewline
116 & 0.0437 & 0.049 & 0.0243 & 0.0247 & 13810.4175 & 4375.8286 & 66.15 & 8.0391 & 3.9482 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301199&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]105[/C][C]0.0084[/C][C]0.0038[/C][C]0.0038[/C][C]0.0038[/C][C]80.3431[/C][C]0[/C][C]0[/C][C]0.6132[/C][C]0.6132[/C][/ROW]
[ROW][C]106[/C][C]0.0125[/C][C]0.008[/C][C]0.0059[/C][C]0.0059[/C][C]352.9242[/C][C]216.6336[/C][C]14.7185[/C][C]1.2851[/C][C]0.9492[/C][/ROW]
[ROW][C]107[/C][C]0.0161[/C][C]0.018[/C][C]0.0099[/C][C]0.01[/C][C]1808.1529[/C][C]747.1401[/C][C]27.3339[/C][C]2.9089[/C][C]1.6024[/C][/ROW]
[ROW][C]108[/C][C]0.0195[/C][C]0.0101[/C][C]0.01[/C][C]0.0101[/C][C]562.6822[/C][C]701.0256[/C][C]26.4769[/C][C]1.6227[/C][C]1.6075[/C][/ROW]
[ROW][C]109[/C][C]0.0227[/C][C]0.0253[/C][C]0.0131[/C][C]0.0132[/C][C]3591.2246[/C][C]1279.0654[/C][C]35.764[/C][C]4.0995[/C][C]2.1059[/C][/ROW]
[ROW][C]110[/C][C]0.0258[/C][C]0.0219[/C][C]0.0145[/C][C]0.0147[/C][C]2660.6151[/C][C]1509.3237[/C][C]38.85[/C][C]3.5286[/C][C]2.343[/C][/ROW]
[ROW][C]111[/C][C]0.0289[/C][C]0.0208[/C][C]0.0154[/C][C]0.0156[/C][C]2383.5332[/C][C]1634.2108[/C][C]40.4254[/C][C]3.3398[/C][C]2.4854[/C][/ROW]
[ROW][C]112[/C][C]0.032[/C][C]0.0231[/C][C]0.0164[/C][C]0.0165[/C][C]2935.6941[/C][C]1796.8962[/C][C]42.3898[/C][C]3.7065[/C][C]2.638[/C][/ROW]
[ROW][C]113[/C][C]0.0349[/C][C]0.0339[/C][C]0.0183[/C][C]0.0185[/C][C]6447.1899[/C][C]2313.5955[/C][C]48.0998[/C][C]5.4928[/C][C]2.9552[/C][/ROW]
[ROW][C]114[/C][C]0.0379[/C][C]0.0325[/C][C]0.0197[/C][C]0.02[/C][C]5911.6511[/C][C]2673.401[/C][C]51.7049[/C][C]5.2597[/C][C]3.1857[/C][/ROW]
[ROW][C]115[/C][C]0.0408[/C][C]0.0457[/C][C]0.0221[/C][C]0.0224[/C][C]11965.5149[/C][C]3518.1387[/C][C]59.3139[/C][C]7.4829[/C][C]3.5763[/C][/ROW]
[ROW][C]116[/C][C]0.0437[/C][C]0.049[/C][C]0.0243[/C][C]0.0247[/C][C]13810.4175[/C][C]4375.8286[/C][C]66.15[/C][C]8.0391[/C][C]3.9482[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301199&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301199&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
1050.00840.00380.00380.003880.3431000.61320.6132
1060.01250.0080.00590.0059352.9242216.633614.71851.28510.9492
1070.01610.0180.00990.011808.1529747.140127.33392.90891.6024
1080.01950.01010.010.0101562.6822701.025626.47691.62271.6075
1090.02270.02530.01310.01323591.22461279.065435.7644.09952.1059
1100.02580.02190.01450.01472660.61511509.323738.853.52862.343
1110.02890.02080.01540.01562383.53321634.210840.42543.33982.4854
1120.0320.02310.01640.01652935.69411796.896242.38983.70652.638
1130.03490.03390.01830.01856447.18992313.595548.09985.49282.9552
1140.03790.03250.01970.025911.65112673.40151.70495.25973.1857
1150.04080.04570.02210.022411965.51493518.138759.31397.48293.5763
1160.04370.0490.02430.024713810.41754375.828666.158.03913.9482



Parameters (Session):
par1 = n1862 ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 0.4 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; 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*2
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.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')