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, 11 Dec 2009 04:45:13 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/11/t1260533505qrp9vocgkwvyf2b.htm/, Retrieved Sat, 27 Apr 2024 21:55:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66059, Retrieved Sat, 27 Apr 2024 21:55:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact123
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   [ARIMA Backward Selection] [] [2009-11-27 14:53:14] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Backward Selection] [Bouwvergunningen] [2009-12-03 16:44:54] [11ac052cc87d77b9933b02bea117068e]
- R PD      [ARIMA Backward Selection] [] [2009-12-04 15:30:07] [639dd97b6eeebe46a3c92d62cb04fb95]
- RMPD          [ARIMA Forecasting] [] [2009-12-11 11:45:13] [2795ec65528c1a16d9df20713e7edc71] [Current]
-    D            [ARIMA Forecasting] [] [2009-12-11 13:25:34] [639dd97b6eeebe46a3c92d62cb04fb95]
Feedback Forum

Post a new message
Dataseries X:
2259703
2444005
2576401
2309146
2493971
2188754
2128515
2248771
2125552
2204434
1765972
1835861
2087121
2170744
2577245
2500625
2370817
2033775
2162554
1943964
1917423
2260681
1828487
1673658
1746814
2197119
2050797
2272390
2079219
2242532
2392286
2056150
2108444
2060266
1747495
2059217
1921030
1895979
2369584
2506099
2156596
2522368
2460648
2173272
2304310
2239807
1961006
2675929
2683265
2407253
3045566
2365409
2379364
3150342
2341189
2254773
2337912
2712988
2185444
2420840
2380842
2523958
2983983
2865389
3490844
3198770
2484559
2890255
3007413
2713443
2656410
3232194
3615139
2905958
3383619
2865686
3185367
3110915
2665099
2763832
2887458
3076986
2626692
2782998
2628939
2454307
2844926
2548952
2429593
3052758
2610175
2618184
2363387
3699616
2563593
2215478
2639036
2859271
2554225
2809697
2481829
2812053
2519658
2305688
2640975
2535552
2285721
2811647




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 9 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66059&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]9 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66059&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66059&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 time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[96])
842782998-------
852628939-------
862454307-------
872844926-------
882548952-------
892429593-------
903052758-------
912610175-------
922618184-------
932363387-------
943699616-------
952563593-------
962215478-------
9726390362425756.5541741569.78863109943.31940.27060.72650.28030.7265
9828592712251124.5541536026.77782966222.33020.04780.14380.28880.5389
9925542252641743.5541897016.67183386470.43620.40890.28350.29640.869
10028096972345769.5541572548.09253118991.01550.11980.29860.30330.6294
10124818292226410.5541425707.90753027113.20050.26590.07670.30950.5107
10228120532849575.5542022304.11873676846.98930.46460.80820.31510.9335
10325196582406992.5541553979.46673260005.64130.39790.1760.32030.67
10423056882415001.5541537001.19713293001.91090.40360.40760.32510.672
10526409752160204.5541257908.63463062500.47340.14820.3760.32950.4522
10625355523496433.5542570479.32964422387.77840.0210.96490.33360.9967
10722857212360410.5541411387.62213309433.48590.43870.35880.33740.6177
10828116472012295.5541040751.51242983839.59560.05340.29060.34090.3409

\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[96]) \tabularnewline
84 & 2782998 & - & - & - & - & - & - & - \tabularnewline
85 & 2628939 & - & - & - & - & - & - & - \tabularnewline
86 & 2454307 & - & - & - & - & - & - & - \tabularnewline
87 & 2844926 & - & - & - & - & - & - & - \tabularnewline
88 & 2548952 & - & - & - & - & - & - & - \tabularnewline
89 & 2429593 & - & - & - & - & - & - & - \tabularnewline
90 & 3052758 & - & - & - & - & - & - & - \tabularnewline
91 & 2610175 & - & - & - & - & - & - & - \tabularnewline
92 & 2618184 & - & - & - & - & - & - & - \tabularnewline
93 & 2363387 & - & - & - & - & - & - & - \tabularnewline
94 & 3699616 & - & - & - & - & - & - & - \tabularnewline
95 & 2563593 & - & - & - & - & - & - & - \tabularnewline
96 & 2215478 & - & - & - & - & - & - & - \tabularnewline
97 & 2639036 & 2425756.554 & 1741569.7886 & 3109943.3194 & 0.2706 & 0.7265 & 0.2803 & 0.7265 \tabularnewline
98 & 2859271 & 2251124.554 & 1536026.7778 & 2966222.3302 & 0.0478 & 0.1438 & 0.2888 & 0.5389 \tabularnewline
99 & 2554225 & 2641743.554 & 1897016.6718 & 3386470.4362 & 0.4089 & 0.2835 & 0.2964 & 0.869 \tabularnewline
100 & 2809697 & 2345769.554 & 1572548.0925 & 3118991.0155 & 0.1198 & 0.2986 & 0.3033 & 0.6294 \tabularnewline
101 & 2481829 & 2226410.554 & 1425707.9075 & 3027113.2005 & 0.2659 & 0.0767 & 0.3095 & 0.5107 \tabularnewline
102 & 2812053 & 2849575.554 & 2022304.1187 & 3676846.9893 & 0.4646 & 0.8082 & 0.3151 & 0.9335 \tabularnewline
103 & 2519658 & 2406992.554 & 1553979.4667 & 3260005.6413 & 0.3979 & 0.176 & 0.3203 & 0.67 \tabularnewline
104 & 2305688 & 2415001.554 & 1537001.1971 & 3293001.9109 & 0.4036 & 0.4076 & 0.3251 & 0.672 \tabularnewline
105 & 2640975 & 2160204.554 & 1257908.6346 & 3062500.4734 & 0.1482 & 0.376 & 0.3295 & 0.4522 \tabularnewline
106 & 2535552 & 3496433.554 & 2570479.3296 & 4422387.7784 & 0.021 & 0.9649 & 0.3336 & 0.9967 \tabularnewline
107 & 2285721 & 2360410.554 & 1411387.6221 & 3309433.4859 & 0.4387 & 0.3588 & 0.3374 & 0.6177 \tabularnewline
108 & 2811647 & 2012295.554 & 1040751.5124 & 2983839.5956 & 0.0534 & 0.2906 & 0.3409 & 0.3409 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66059&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[96])[/C][/ROW]
[ROW][C]84[/C][C]2782998[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2628939[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]2454307[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]2844926[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]2548952[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]2429593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]3052758[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]2610175[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]2618184[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2363387[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3699616[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2563593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2215478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2639036[/C][C]2425756.554[/C][C]1741569.7886[/C][C]3109943.3194[/C][C]0.2706[/C][C]0.7265[/C][C]0.2803[/C][C]0.7265[/C][/ROW]
[ROW][C]98[/C][C]2859271[/C][C]2251124.554[/C][C]1536026.7778[/C][C]2966222.3302[/C][C]0.0478[/C][C]0.1438[/C][C]0.2888[/C][C]0.5389[/C][/ROW]
[ROW][C]99[/C][C]2554225[/C][C]2641743.554[/C][C]1897016.6718[/C][C]3386470.4362[/C][C]0.4089[/C][C]0.2835[/C][C]0.2964[/C][C]0.869[/C][/ROW]
[ROW][C]100[/C][C]2809697[/C][C]2345769.554[/C][C]1572548.0925[/C][C]3118991.0155[/C][C]0.1198[/C][C]0.2986[/C][C]0.3033[/C][C]0.6294[/C][/ROW]
[ROW][C]101[/C][C]2481829[/C][C]2226410.554[/C][C]1425707.9075[/C][C]3027113.2005[/C][C]0.2659[/C][C]0.0767[/C][C]0.3095[/C][C]0.5107[/C][/ROW]
[ROW][C]102[/C][C]2812053[/C][C]2849575.554[/C][C]2022304.1187[/C][C]3676846.9893[/C][C]0.4646[/C][C]0.8082[/C][C]0.3151[/C][C]0.9335[/C][/ROW]
[ROW][C]103[/C][C]2519658[/C][C]2406992.554[/C][C]1553979.4667[/C][C]3260005.6413[/C][C]0.3979[/C][C]0.176[/C][C]0.3203[/C][C]0.67[/C][/ROW]
[ROW][C]104[/C][C]2305688[/C][C]2415001.554[/C][C]1537001.1971[/C][C]3293001.9109[/C][C]0.4036[/C][C]0.4076[/C][C]0.3251[/C][C]0.672[/C][/ROW]
[ROW][C]105[/C][C]2640975[/C][C]2160204.554[/C][C]1257908.6346[/C][C]3062500.4734[/C][C]0.1482[/C][C]0.376[/C][C]0.3295[/C][C]0.4522[/C][/ROW]
[ROW][C]106[/C][C]2535552[/C][C]3496433.554[/C][C]2570479.3296[/C][C]4422387.7784[/C][C]0.021[/C][C]0.9649[/C][C]0.3336[/C][C]0.9967[/C][/ROW]
[ROW][C]107[/C][C]2285721[/C][C]2360410.554[/C][C]1411387.6221[/C][C]3309433.4859[/C][C]0.4387[/C][C]0.3588[/C][C]0.3374[/C][C]0.6177[/C][/ROW]
[ROW][C]108[/C][C]2811647[/C][C]2012295.554[/C][C]1040751.5124[/C][C]2983839.5956[/C][C]0.0534[/C][C]0.2906[/C][C]0.3409[/C][C]0.3409[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66059&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66059&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[96])
842782998-------
852628939-------
862454307-------
872844926-------
882548952-------
892429593-------
903052758-------
912610175-------
922618184-------
932363387-------
943699616-------
952563593-------
962215478-------
9726390362425756.5541741569.78863109943.31940.27060.72650.28030.7265
9828592712251124.5541536026.77782966222.33020.04780.14380.28880.5389
9925542252641743.5541897016.67183386470.43620.40890.28350.29640.869
10028096972345769.5541572548.09253118991.01550.11980.29860.30330.6294
10124818292226410.5541425707.90753027113.20050.26590.07670.30950.5107
10228120532849575.5542022304.11873676846.98930.46460.80820.31510.9335
10325196582406992.5541553979.46673260005.64130.39790.1760.32030.67
10423056882415001.5541537001.19713293001.91090.40360.40760.32510.672
10526409752160204.5541257908.63463062500.47340.14820.3760.32950.4522
10625355523496433.5542570479.32964422387.77840.0210.96490.33360.9967
10722857212360410.5541411387.62213309433.48590.43870.35880.33740.6177
10828116472012295.5541040751.51242983839.59560.05340.29060.34090.3409







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.14390.0879045488122084.748800
980.16210.27020.179369842099778.673207665110931.711455702.8757
990.1438-0.03310.13047659497294.7917140996573052.738375495.1039
1000.16820.19780.1472215228675149.216159554598576.857399442.8602
1010.18350.11470.140765238582555.4768140691395372.581375088.5167
1020.1481-0.01320.11951407942058.9148117477486486.970342749.8891
1030.18080.04680.109112693502721.6827102508345949.072320169.2458
1040.1855-0.04530.101111949453088.786491188484341.5363301974.3107
1050.21310.22260.1146231140221744.068106738677386.262326708.8572
1060.1351-0.27480.1306923293360823.393188394145729.975434043.9445
1070.2051-0.03160.12165578529477.1805171774544252.448414456.9269
1080.24630.39720.1446638962734217.351210706893416.19459028.2055

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.1439 & 0.0879 & 0 & 45488122084.7488 & 0 & 0 \tabularnewline
98 & 0.1621 & 0.2702 & 0.179 & 369842099778.673 & 207665110931.711 & 455702.8757 \tabularnewline
99 & 0.1438 & -0.0331 & 0.1304 & 7659497294.7917 & 140996573052.738 & 375495.1039 \tabularnewline
100 & 0.1682 & 0.1978 & 0.1472 & 215228675149.216 & 159554598576.857 & 399442.8602 \tabularnewline
101 & 0.1835 & 0.1147 & 0.1407 & 65238582555.4768 & 140691395372.581 & 375088.5167 \tabularnewline
102 & 0.1481 & -0.0132 & 0.1195 & 1407942058.9148 & 117477486486.970 & 342749.8891 \tabularnewline
103 & 0.1808 & 0.0468 & 0.1091 & 12693502721.6827 & 102508345949.072 & 320169.2458 \tabularnewline
104 & 0.1855 & -0.0453 & 0.1011 & 11949453088.7864 & 91188484341.5363 & 301974.3107 \tabularnewline
105 & 0.2131 & 0.2226 & 0.1146 & 231140221744.068 & 106738677386.262 & 326708.8572 \tabularnewline
106 & 0.1351 & -0.2748 & 0.1306 & 923293360823.393 & 188394145729.975 & 434043.9445 \tabularnewline
107 & 0.2051 & -0.0316 & 0.1216 & 5578529477.1805 & 171774544252.448 & 414456.9269 \tabularnewline
108 & 0.2463 & 0.3972 & 0.1446 & 638962734217.351 & 210706893416.19 & 459028.2055 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66059&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]97[/C][C]0.1439[/C][C]0.0879[/C][C]0[/C][C]45488122084.7488[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.1621[/C][C]0.2702[/C][C]0.179[/C][C]369842099778.673[/C][C]207665110931.711[/C][C]455702.8757[/C][/ROW]
[ROW][C]99[/C][C]0.1438[/C][C]-0.0331[/C][C]0.1304[/C][C]7659497294.7917[/C][C]140996573052.738[/C][C]375495.1039[/C][/ROW]
[ROW][C]100[/C][C]0.1682[/C][C]0.1978[/C][C]0.1472[/C][C]215228675149.216[/C][C]159554598576.857[/C][C]399442.8602[/C][/ROW]
[ROW][C]101[/C][C]0.1835[/C][C]0.1147[/C][C]0.1407[/C][C]65238582555.4768[/C][C]140691395372.581[/C][C]375088.5167[/C][/ROW]
[ROW][C]102[/C][C]0.1481[/C][C]-0.0132[/C][C]0.1195[/C][C]1407942058.9148[/C][C]117477486486.970[/C][C]342749.8891[/C][/ROW]
[ROW][C]103[/C][C]0.1808[/C][C]0.0468[/C][C]0.1091[/C][C]12693502721.6827[/C][C]102508345949.072[/C][C]320169.2458[/C][/ROW]
[ROW][C]104[/C][C]0.1855[/C][C]-0.0453[/C][C]0.1011[/C][C]11949453088.7864[/C][C]91188484341.5363[/C][C]301974.3107[/C][/ROW]
[ROW][C]105[/C][C]0.2131[/C][C]0.2226[/C][C]0.1146[/C][C]231140221744.068[/C][C]106738677386.262[/C][C]326708.8572[/C][/ROW]
[ROW][C]106[/C][C]0.1351[/C][C]-0.2748[/C][C]0.1306[/C][C]923293360823.393[/C][C]188394145729.975[/C][C]434043.9445[/C][/ROW]
[ROW][C]107[/C][C]0.2051[/C][C]-0.0316[/C][C]0.1216[/C][C]5578529477.1805[/C][C]171774544252.448[/C][C]414456.9269[/C][/ROW]
[ROW][C]108[/C][C]0.2463[/C][C]0.3972[/C][C]0.1446[/C][C]638962734217.351[/C][C]210706893416.19[/C][C]459028.2055[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66059&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66059&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
970.14390.0879045488122084.748800
980.16210.27020.179369842099778.673207665110931.711455702.8757
990.1438-0.03310.13047659497294.7917140996573052.738375495.1039
1000.16820.19780.1472215228675149.216159554598576.857399442.8602
1010.18350.11470.140765238582555.4768140691395372.581375088.5167
1020.1481-0.01320.11951407942058.9148117477486486.970342749.8891
1030.18080.04680.109112693502721.6827102508345949.072320169.2458
1040.1855-0.04530.101111949453088.786491188484341.5363301974.3107
1050.21310.22260.1146231140221744.068106738677386.262326708.8572
1060.1351-0.27480.1306923293360823.393188394145729.975434043.9445
1070.2051-0.03160.12165578529477.1805171774544252.448414456.9269
1080.24630.39720.1446638962734217.351210706893416.19459028.2055



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