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 computationFri, 23 Dec 2011 16:28:16 -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/23/t1324675718emia839v35hpwvw.htm/, Retrieved Mon, 29 Apr 2024 23:41:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160720, Retrieved Mon, 29 Apr 2024 23:41:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact71
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] [Ws9 - Forecasting...] [2011-12-06 20:13:55] [7156a20ff7d97880b6dc50f7239ba03b]
-   P           [ARIMA Forecasting] [Forecasting arma ...] [2011-12-23 21:28:16] [8aedcf735e397266388b06f47fe45218] [Current]
Feedback Forum

Post a new message
Dataseries X:
1657
1418
1501
1315
1621
2308
3554
3318
3252
2921
2133
2040
1858
1833
2094
2173
2366
2074
2522
1822
1952
2232
1755
1791
2075
1850
2137
2467
2154
2289
2628
2074
2798
2194
2442
2565
2063
2070
2539
1898
2139
2408
2725
2201
2311
2548
2276
2351
2280
2057
2479
2379
2295
2456
2546
2844
2260
2981
2678
3440
2842
2450
2669
2570
2540
2318
2930
2947
2799
2695
2498
2260
2160
2058
2533
2150
2172
2155
3016
2333
2355
2825
2214
2360
2299
1746
2069
2267
1878
2266
2282
2085
2277
2251
1828
1954
1851
1570
1852
2187
1855
2218
2253
2028
2169
1997
2034
1791
1627
1631
2319
1707
1747
2397
2059
2251
2558
2406
2049
2074
1734
1983
2121
1905
2126
2363
2173
2710
2137
2742
2419
2194
2660
2189
2310
2349
2540
2434
2916
2446
2375
3032
2218
1920
2039
1889
2014
2105
2153
2309
2955
2225
2160
2386
1653
1099
5010
2672
2729
2955
2409
3086
3384
2458
2913
2448
2215
2179
2461
2098
2621
2703
2388
3880
3310
3093
3237
3002
2670
2311
2062
2059
2465
2213
2028
2322
2825
2687
2373
2889
2708
2542
2477
2419
2977
3001
3075
2870
3756
3443
2948
3560
3257
2600
2741
2349
2783
2845
2987
2696
3874
2912
2743
3857
2660
2226
2942
2420
2516
2421
2631
2887
3328
2587
2695
3669
2773
2527
2750
2014
2763
2726
1826
2713
3040
2405
2526
2526
2529
2474
2576
2219
2900
2274
2184
2629
2739
2933
3144
3354
3357
3329




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160720&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'Gwilym Jenkins' @ jenkins.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[240])
2282527-------
2292750-------
2302014-------
2312763-------
2322726-------
2331826-------
2342713-------
2353040-------
2362405-------
2372526-------
2382526-------
2392529-------
2402474-------
24125762469.3291852.50623291.5330.39960.49560.25170.4956
24222192207.70231628.24852993.36960.48880.17910.68550.2532
24329002566.92221871.85643520.08280.24670.76280.34340.5758
24422742444.25131738.42413436.65540.36830.1840.2890.4766
24521842351.95141664.18863323.94760.36740.56250.85560.4028
24626292654.4071866.45263775.00970.48230.79470.45920.6238
24727393034.41862122.31864338.5080.32850.72880.49670.8002
24829332614.55971824.61143746.50850.29070.41470.64160.5961
24931442589.02021802.64463718.440.16770.27530.54350.5791
25033542861.81281989.63774116.31350.2210.32960.70010.7277
25133572428.42551686.81463496.08670.04410.04460.42680.4667
25233292224.45311543.9653204.86010.01360.01180.30890.3089

\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[240]) \tabularnewline
228 & 2527 & - & - & - & - & - & - & - \tabularnewline
229 & 2750 & - & - & - & - & - & - & - \tabularnewline
230 & 2014 & - & - & - & - & - & - & - \tabularnewline
231 & 2763 & - & - & - & - & - & - & - \tabularnewline
232 & 2726 & - & - & - & - & - & - & - \tabularnewline
233 & 1826 & - & - & - & - & - & - & - \tabularnewline
234 & 2713 & - & - & - & - & - & - & - \tabularnewline
235 & 3040 & - & - & - & - & - & - & - \tabularnewline
236 & 2405 & - & - & - & - & - & - & - \tabularnewline
237 & 2526 & - & - & - & - & - & - & - \tabularnewline
238 & 2526 & - & - & - & - & - & - & - \tabularnewline
239 & 2529 & - & - & - & - & - & - & - \tabularnewline
240 & 2474 & - & - & - & - & - & - & - \tabularnewline
241 & 2576 & 2469.329 & 1852.5062 & 3291.533 & 0.3996 & 0.4956 & 0.2517 & 0.4956 \tabularnewline
242 & 2219 & 2207.7023 & 1628.2485 & 2993.3696 & 0.4888 & 0.1791 & 0.6855 & 0.2532 \tabularnewline
243 & 2900 & 2566.9222 & 1871.8564 & 3520.0828 & 0.2467 & 0.7628 & 0.3434 & 0.5758 \tabularnewline
244 & 2274 & 2444.2513 & 1738.4241 & 3436.6554 & 0.3683 & 0.184 & 0.289 & 0.4766 \tabularnewline
245 & 2184 & 2351.9514 & 1664.1886 & 3323.9476 & 0.3674 & 0.5625 & 0.8556 & 0.4028 \tabularnewline
246 & 2629 & 2654.407 & 1866.4526 & 3775.0097 & 0.4823 & 0.7947 & 0.4592 & 0.6238 \tabularnewline
247 & 2739 & 3034.4186 & 2122.3186 & 4338.508 & 0.3285 & 0.7288 & 0.4967 & 0.8002 \tabularnewline
248 & 2933 & 2614.5597 & 1824.6114 & 3746.5085 & 0.2907 & 0.4147 & 0.6416 & 0.5961 \tabularnewline
249 & 3144 & 2589.0202 & 1802.6446 & 3718.44 & 0.1677 & 0.2753 & 0.5435 & 0.5791 \tabularnewline
250 & 3354 & 2861.8128 & 1989.6377 & 4116.3135 & 0.221 & 0.3296 & 0.7001 & 0.7277 \tabularnewline
251 & 3357 & 2428.4255 & 1686.8146 & 3496.0867 & 0.0441 & 0.0446 & 0.4268 & 0.4667 \tabularnewline
252 & 3329 & 2224.4531 & 1543.965 & 3204.8601 & 0.0136 & 0.0118 & 0.3089 & 0.3089 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160720&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[240])[/C][/ROW]
[ROW][C]228[/C][C]2527[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]229[/C][C]2750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]230[/C][C]2014[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]231[/C][C]2763[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]232[/C][C]2726[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]233[/C][C]1826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]234[/C][C]2713[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]235[/C][C]3040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]236[/C][C]2405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]237[/C][C]2526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]238[/C][C]2526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]239[/C][C]2529[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]240[/C][C]2474[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]241[/C][C]2576[/C][C]2469.329[/C][C]1852.5062[/C][C]3291.533[/C][C]0.3996[/C][C]0.4956[/C][C]0.2517[/C][C]0.4956[/C][/ROW]
[ROW][C]242[/C][C]2219[/C][C]2207.7023[/C][C]1628.2485[/C][C]2993.3696[/C][C]0.4888[/C][C]0.1791[/C][C]0.6855[/C][C]0.2532[/C][/ROW]
[ROW][C]243[/C][C]2900[/C][C]2566.9222[/C][C]1871.8564[/C][C]3520.0828[/C][C]0.2467[/C][C]0.7628[/C][C]0.3434[/C][C]0.5758[/C][/ROW]
[ROW][C]244[/C][C]2274[/C][C]2444.2513[/C][C]1738.4241[/C][C]3436.6554[/C][C]0.3683[/C][C]0.184[/C][C]0.289[/C][C]0.4766[/C][/ROW]
[ROW][C]245[/C][C]2184[/C][C]2351.9514[/C][C]1664.1886[/C][C]3323.9476[/C][C]0.3674[/C][C]0.5625[/C][C]0.8556[/C][C]0.4028[/C][/ROW]
[ROW][C]246[/C][C]2629[/C][C]2654.407[/C][C]1866.4526[/C][C]3775.0097[/C][C]0.4823[/C][C]0.7947[/C][C]0.4592[/C][C]0.6238[/C][/ROW]
[ROW][C]247[/C][C]2739[/C][C]3034.4186[/C][C]2122.3186[/C][C]4338.508[/C][C]0.3285[/C][C]0.7288[/C][C]0.4967[/C][C]0.8002[/C][/ROW]
[ROW][C]248[/C][C]2933[/C][C]2614.5597[/C][C]1824.6114[/C][C]3746.5085[/C][C]0.2907[/C][C]0.4147[/C][C]0.6416[/C][C]0.5961[/C][/ROW]
[ROW][C]249[/C][C]3144[/C][C]2589.0202[/C][C]1802.6446[/C][C]3718.44[/C][C]0.1677[/C][C]0.2753[/C][C]0.5435[/C][C]0.5791[/C][/ROW]
[ROW][C]250[/C][C]3354[/C][C]2861.8128[/C][C]1989.6377[/C][C]4116.3135[/C][C]0.221[/C][C]0.3296[/C][C]0.7001[/C][C]0.7277[/C][/ROW]
[ROW][C]251[/C][C]3357[/C][C]2428.4255[/C][C]1686.8146[/C][C]3496.0867[/C][C]0.0441[/C][C]0.0446[/C][C]0.4268[/C][C]0.4667[/C][/ROW]
[ROW][C]252[/C][C]3329[/C][C]2224.4531[/C][C]1543.965[/C][C]3204.8601[/C][C]0.0136[/C][C]0.0118[/C][C]0.3089[/C][C]0.3089[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160720&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160720&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[240])
2282527-------
2292750-------
2302014-------
2312763-------
2322726-------
2331826-------
2342713-------
2353040-------
2362405-------
2372526-------
2382526-------
2392529-------
2402474-------
24125762469.3291852.50623291.5330.39960.49560.25170.4956
24222192207.70231628.24852993.36960.48880.17910.68550.2532
24329002566.92221871.85643520.08280.24670.76280.34340.5758
24422742444.25131738.42413436.65540.36830.1840.2890.4766
24521842351.95141664.18863323.94760.36740.56250.85560.4028
24626292654.4071866.45263775.00970.48230.79470.45920.6238
24727393034.41862122.31864338.5080.32850.72880.49670.8002
24829332614.55971824.61143746.50850.29070.41470.64160.5961
24931442589.02021802.64463718.440.16770.27530.54350.5791
25033542861.81281989.63774116.31350.2210.32960.70010.7277
25133572428.42551686.81463496.08670.04410.04460.42680.4667
25233292224.45311543.9653204.86010.01360.01180.30890.3089







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2410.16990.0432011378.710700
2420.18160.00510.0242127.63745753.174175.8497
2430.18950.12980.0594110940.797540815.7152202.029
2440.2072-0.06970.061928985.507737858.1633194.5717
2450.2109-0.07140.063828207.681735928.067189.547
2460.2154-0.00960.0548645.515830047.6418173.3426
2470.2193-0.09740.060987272.131738222.5689195.5059
2480.22090.12180.0685101404.238646120.2776214.7563
2490.22260.21440.0847308002.532775218.306274.2596
2500.22370.1720.0934242248.20591921.2959303.1853
2510.22430.38240.1197862250.68161951.2399402.4317
2520.22490.49650.15111220023.781250123.9516500.1239

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
241 & 0.1699 & 0.0432 & 0 & 11378.7107 & 0 & 0 \tabularnewline
242 & 0.1816 & 0.0051 & 0.0242 & 127.6374 & 5753.1741 & 75.8497 \tabularnewline
243 & 0.1895 & 0.1298 & 0.0594 & 110940.7975 & 40815.7152 & 202.029 \tabularnewline
244 & 0.2072 & -0.0697 & 0.0619 & 28985.5077 & 37858.1633 & 194.5717 \tabularnewline
245 & 0.2109 & -0.0714 & 0.0638 & 28207.6817 & 35928.067 & 189.547 \tabularnewline
246 & 0.2154 & -0.0096 & 0.0548 & 645.5158 & 30047.6418 & 173.3426 \tabularnewline
247 & 0.2193 & -0.0974 & 0.0609 & 87272.1317 & 38222.5689 & 195.5059 \tabularnewline
248 & 0.2209 & 0.1218 & 0.0685 & 101404.2386 & 46120.2776 & 214.7563 \tabularnewline
249 & 0.2226 & 0.2144 & 0.0847 & 308002.5327 & 75218.306 & 274.2596 \tabularnewline
250 & 0.2237 & 0.172 & 0.0934 & 242248.205 & 91921.2959 & 303.1853 \tabularnewline
251 & 0.2243 & 0.3824 & 0.1197 & 862250.68 & 161951.2399 & 402.4317 \tabularnewline
252 & 0.2249 & 0.4965 & 0.1511 & 1220023.781 & 250123.9516 & 500.1239 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160720&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]241[/C][C]0.1699[/C][C]0.0432[/C][C]0[/C][C]11378.7107[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]242[/C][C]0.1816[/C][C]0.0051[/C][C]0.0242[/C][C]127.6374[/C][C]5753.1741[/C][C]75.8497[/C][/ROW]
[ROW][C]243[/C][C]0.1895[/C][C]0.1298[/C][C]0.0594[/C][C]110940.7975[/C][C]40815.7152[/C][C]202.029[/C][/ROW]
[ROW][C]244[/C][C]0.2072[/C][C]-0.0697[/C][C]0.0619[/C][C]28985.5077[/C][C]37858.1633[/C][C]194.5717[/C][/ROW]
[ROW][C]245[/C][C]0.2109[/C][C]-0.0714[/C][C]0.0638[/C][C]28207.6817[/C][C]35928.067[/C][C]189.547[/C][/ROW]
[ROW][C]246[/C][C]0.2154[/C][C]-0.0096[/C][C]0.0548[/C][C]645.5158[/C][C]30047.6418[/C][C]173.3426[/C][/ROW]
[ROW][C]247[/C][C]0.2193[/C][C]-0.0974[/C][C]0.0609[/C][C]87272.1317[/C][C]38222.5689[/C][C]195.5059[/C][/ROW]
[ROW][C]248[/C][C]0.2209[/C][C]0.1218[/C][C]0.0685[/C][C]101404.2386[/C][C]46120.2776[/C][C]214.7563[/C][/ROW]
[ROW][C]249[/C][C]0.2226[/C][C]0.2144[/C][C]0.0847[/C][C]308002.5327[/C][C]75218.306[/C][C]274.2596[/C][/ROW]
[ROW][C]250[/C][C]0.2237[/C][C]0.172[/C][C]0.0934[/C][C]242248.205[/C][C]91921.2959[/C][C]303.1853[/C][/ROW]
[ROW][C]251[/C][C]0.2243[/C][C]0.3824[/C][C]0.1197[/C][C]862250.68[/C][C]161951.2399[/C][C]402.4317[/C][/ROW]
[ROW][C]252[/C][C]0.2249[/C][C]0.4965[/C][C]0.1511[/C][C]1220023.781[/C][C]250123.9516[/C][C]500.1239[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160720&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160720&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
2410.16990.0432011378.710700
2420.18160.00510.0242127.63745753.174175.8497
2430.18950.12980.0594110940.797540815.7152202.029
2440.2072-0.06970.061928985.507737858.1633194.5717
2450.2109-0.07140.063828207.681735928.067189.547
2460.2154-0.00960.0548645.515830047.6418173.3426
2470.2193-0.09740.060987272.131738222.5689195.5059
2480.22090.12180.0685101404.238646120.2776214.7563
2490.22260.21440.0847308002.532775218.306274.2596
2500.22370.1720.0934242248.20591921.2959303.1853
2510.22430.38240.1197862250.68161951.2399402.4317
2520.22490.49650.15111220023.781250123.9516500.1239



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