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 computationSat, 19 Dec 2009 07:44:18 -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/19/t1261233927udimgh86hi1a9ug.htm/, Retrieved Sun, 05 May 2024 11:11:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69611, Retrieved Sun, 05 May 2024 11:11:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [ARIMA Back] [2008-12-21 18:18:03] [74be16979710d4c4e7c6647856088456]
- RMP   [ARIMA Forecasting] [ARIMA Fore] [2008-12-22 21:40:41] [74be16979710d4c4e7c6647856088456]
-  M        [ARIMA Forecasting] [ARIMA Forecast - ...] [2009-12-19 14:44:18] [f066b5fba39549422fd1c7a1f2ce0075] [Current]
Feedback Forum

Post a new message
Dataseries X:
897262
1133132
1384548
2324057
2502808
2516762
5579822
4945991
2019915
1830905
1251016
949902
923000
1215747
1479112
2371781
2521576
2350559
5673323
4414295
2016902
1958302
1284086
1186305
957833
1255719
1482709
2361136
2508100
2254488
5669953
4227480
2067790
1958419
1318158
1287921
1076982
1293669
1582053
2393005
2310531
2597899
5507587
4194133
2185092
2122018
1413348
1338342
1052655
1370046
1887027
2448017
2550796
2655837
5269499
4247405
2109722
2143145
1582013
1413221
1118520
1478655
2000108
2085234
2651805
2522176
5170142
4150129
2104254
2211398
1505900
1524305
1093144
1449647
1771197
2445932
2678945
2400737
4796880
4118001
2125714
2125515
1508760
1508765
1091075
1514814
1748997
2424406
2747942
2377332
5210706
3882821
2197469
2271155
1618917
1391579
1143249
1445785
1870242
2597788
2436231
2684184
4705109
4331347
2369192
2283947
1749607
1598601
1221234
1497778
1823567
2489908
2532837
2456065
4627018
4276894
2314950
2238987
1652753
1561968
1115878
1596714
1910242
2286450
2772441
2394538
4715128
4402420
2325392
2306683
1725282
1541370
1168142
1457835
1816380
2446552
2575774
2537852
4728097
4372685
2302672
2346402
1689915
1576183




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69611&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 time5 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[132])
1201561968-------
1211115878-------
1221596714-------
1231910242-------
1242286450-------
1252772441-------
1262394538-------
1274715128-------
1284402420-------
1292325392-------
1302306683-------
1311725282-------
1321541370-------
13311681421155189.3735875905.73181434473.01520.46380.00340.60870.0034
13414578351596926.00171313249.37361880602.62970.16830.99850.50060.6495
13518163801898359.8021612355.01272184364.59130.28710.99870.46760.9928
13624465522334315.46582047902.64182620728.28980.22120.99980.62841
13725757742723739.80092435792.89633011686.70540.15690.97040.37011
13825378522410807.67922120118.92372701496.43480.19580.1330.54371
13947280974632234.75014338735.60664925733.89350.26110.28991
14043726854399550.13084103625.61064695474.6510.42940.01480.49241
14123026722330966.07932033238.3732628693.78560.426100.51461
14223464022316220.17872017274.84922615165.50820.42160.53540.52491
14316899151724642.11981424943.23572024341.00380.410200.49830.8847
14415761831566609.25151266478.61671866739.88630.47510.21030.56550.5655

\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[132]) \tabularnewline
120 & 1561968 & - & - & - & - & - & - & - \tabularnewline
121 & 1115878 & - & - & - & - & - & - & - \tabularnewline
122 & 1596714 & - & - & - & - & - & - & - \tabularnewline
123 & 1910242 & - & - & - & - & - & - & - \tabularnewline
124 & 2286450 & - & - & - & - & - & - & - \tabularnewline
125 & 2772441 & - & - & - & - & - & - & - \tabularnewline
126 & 2394538 & - & - & - & - & - & - & - \tabularnewline
127 & 4715128 & - & - & - & - & - & - & - \tabularnewline
128 & 4402420 & - & - & - & - & - & - & - \tabularnewline
129 & 2325392 & - & - & - & - & - & - & - \tabularnewline
130 & 2306683 & - & - & - & - & - & - & - \tabularnewline
131 & 1725282 & - & - & - & - & - & - & - \tabularnewline
132 & 1541370 & - & - & - & - & - & - & - \tabularnewline
133 & 1168142 & 1155189.3735 & 875905.7318 & 1434473.0152 & 0.4638 & 0.0034 & 0.6087 & 0.0034 \tabularnewline
134 & 1457835 & 1596926.0017 & 1313249.3736 & 1880602.6297 & 0.1683 & 0.9985 & 0.5006 & 0.6495 \tabularnewline
135 & 1816380 & 1898359.802 & 1612355.0127 & 2184364.5913 & 0.2871 & 0.9987 & 0.4676 & 0.9928 \tabularnewline
136 & 2446552 & 2334315.4658 & 2047902.6418 & 2620728.2898 & 0.2212 & 0.9998 & 0.6284 & 1 \tabularnewline
137 & 2575774 & 2723739.8009 & 2435792.8963 & 3011686.7054 & 0.1569 & 0.9704 & 0.3701 & 1 \tabularnewline
138 & 2537852 & 2410807.6792 & 2120118.9237 & 2701496.4348 & 0.1958 & 0.133 & 0.5437 & 1 \tabularnewline
139 & 4728097 & 4632234.7501 & 4338735.6066 & 4925733.8935 & 0.261 & 1 & 0.2899 & 1 \tabularnewline
140 & 4372685 & 4399550.1308 & 4103625.6106 & 4695474.651 & 0.4294 & 0.0148 & 0.4924 & 1 \tabularnewline
141 & 2302672 & 2330966.0793 & 2033238.373 & 2628693.7856 & 0.4261 & 0 & 0.5146 & 1 \tabularnewline
142 & 2346402 & 2316220.1787 & 2017274.8492 & 2615165.5082 & 0.4216 & 0.5354 & 0.5249 & 1 \tabularnewline
143 & 1689915 & 1724642.1198 & 1424943.2357 & 2024341.0038 & 0.4102 & 0 & 0.4983 & 0.8847 \tabularnewline
144 & 1576183 & 1566609.2515 & 1266478.6167 & 1866739.8863 & 0.4751 & 0.2103 & 0.5655 & 0.5655 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69611&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[132])[/C][/ROW]
[ROW][C]120[/C][C]1561968[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]1115878[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]1596714[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]1910242[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]2286450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]2772441[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]2394538[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]4715128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]4402420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]2325392[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]2306683[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]1725282[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]1541370[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]1168142[/C][C]1155189.3735[/C][C]875905.7318[/C][C]1434473.0152[/C][C]0.4638[/C][C]0.0034[/C][C]0.6087[/C][C]0.0034[/C][/ROW]
[ROW][C]134[/C][C]1457835[/C][C]1596926.0017[/C][C]1313249.3736[/C][C]1880602.6297[/C][C]0.1683[/C][C]0.9985[/C][C]0.5006[/C][C]0.6495[/C][/ROW]
[ROW][C]135[/C][C]1816380[/C][C]1898359.802[/C][C]1612355.0127[/C][C]2184364.5913[/C][C]0.2871[/C][C]0.9987[/C][C]0.4676[/C][C]0.9928[/C][/ROW]
[ROW][C]136[/C][C]2446552[/C][C]2334315.4658[/C][C]2047902.6418[/C][C]2620728.2898[/C][C]0.2212[/C][C]0.9998[/C][C]0.6284[/C][C]1[/C][/ROW]
[ROW][C]137[/C][C]2575774[/C][C]2723739.8009[/C][C]2435792.8963[/C][C]3011686.7054[/C][C]0.1569[/C][C]0.9704[/C][C]0.3701[/C][C]1[/C][/ROW]
[ROW][C]138[/C][C]2537852[/C][C]2410807.6792[/C][C]2120118.9237[/C][C]2701496.4348[/C][C]0.1958[/C][C]0.133[/C][C]0.5437[/C][C]1[/C][/ROW]
[ROW][C]139[/C][C]4728097[/C][C]4632234.7501[/C][C]4338735.6066[/C][C]4925733.8935[/C][C]0.261[/C][C]1[/C][C]0.2899[/C][C]1[/C][/ROW]
[ROW][C]140[/C][C]4372685[/C][C]4399550.1308[/C][C]4103625.6106[/C][C]4695474.651[/C][C]0.4294[/C][C]0.0148[/C][C]0.4924[/C][C]1[/C][/ROW]
[ROW][C]141[/C][C]2302672[/C][C]2330966.0793[/C][C]2033238.373[/C][C]2628693.7856[/C][C]0.4261[/C][C]0[/C][C]0.5146[/C][C]1[/C][/ROW]
[ROW][C]142[/C][C]2346402[/C][C]2316220.1787[/C][C]2017274.8492[/C][C]2615165.5082[/C][C]0.4216[/C][C]0.5354[/C][C]0.5249[/C][C]1[/C][/ROW]
[ROW][C]143[/C][C]1689915[/C][C]1724642.1198[/C][C]1424943.2357[/C][C]2024341.0038[/C][C]0.4102[/C][C]0[/C][C]0.4983[/C][C]0.8847[/C][/ROW]
[ROW][C]144[/C][C]1576183[/C][C]1566609.2515[/C][C]1266478.6167[/C][C]1866739.8863[/C][C]0.4751[/C][C]0.2103[/C][C]0.5655[/C][C]0.5655[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69611&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69611&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[132])
1201561968-------
1211115878-------
1221596714-------
1231910242-------
1242286450-------
1252772441-------
1262394538-------
1274715128-------
1284402420-------
1292325392-------
1302306683-------
1311725282-------
1321541370-------
13311681421155189.3735875905.73181434473.01520.46380.00340.60870.0034
13414578351596926.00171313249.37361880602.62970.16830.99850.50060.6495
13518163801898359.8021612355.01272184364.59130.28710.99870.46760.9928
13624465522334315.46582047902.64182620728.28980.22120.99980.62841
13725757742723739.80092435792.89633011686.70540.15690.97040.37011
13825378522410807.67922120118.92372701496.43480.19580.1330.54371
13947280974632234.75014338735.60664925733.89350.26110.28991
14043726854399550.13084103625.61064695474.6510.42940.01480.49241
14123026722330966.07932033238.3732628693.78560.426100.51461
14223464022316220.17872017274.84922615165.50820.42160.53540.52491
14316899151724642.11981424943.23572024341.00380.410200.49830.8847
14415761831566609.25151266478.61671866739.88630.47510.21030.56550.5655







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1330.12330.01129e-04167770532.810713980877.73423739.1012
1340.0906-0.08710.007319346306742.77461612192228.564540152.1136
1350.0769-0.04320.00366720687938.2657560057328.188823665.5304
1360.06260.04810.00412597039611.34221049753300.945232399.8966
1370.0539-0.05430.004521893878232.88921824489852.740842714.0475
1380.06150.05270.004416140259438.59081345021619.882636674.5364
1390.03230.02070.00179189570962.153765797580.179427673.0479
1400.0343-0.00615e-04721735254.688960144604.55747755.2953
1410.0652-0.01210.001800554923.848166712910.32078167.7972
1420.06590.0130.0011910942334.885275911861.24048712.7413
1430.0887-0.02010.00171205972847.4516100497737.287610024.856
1440.09770.00615e-0491656660.05657638055.00472763.7031

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
133 & 0.1233 & 0.0112 & 9e-04 & 167770532.8107 & 13980877.7342 & 3739.1012 \tabularnewline
134 & 0.0906 & -0.0871 & 0.0073 & 19346306742.7746 & 1612192228.5645 & 40152.1136 \tabularnewline
135 & 0.0769 & -0.0432 & 0.0036 & 6720687938.2657 & 560057328.1888 & 23665.5304 \tabularnewline
136 & 0.0626 & 0.0481 & 0.004 & 12597039611.3422 & 1049753300.9452 & 32399.8966 \tabularnewline
137 & 0.0539 & -0.0543 & 0.0045 & 21893878232.8892 & 1824489852.7408 & 42714.0475 \tabularnewline
138 & 0.0615 & 0.0527 & 0.0044 & 16140259438.5908 & 1345021619.8826 & 36674.5364 \tabularnewline
139 & 0.0323 & 0.0207 & 0.0017 & 9189570962.153 & 765797580.1794 & 27673.0479 \tabularnewline
140 & 0.0343 & -0.0061 & 5e-04 & 721735254.6889 & 60144604.5574 & 7755.2953 \tabularnewline
141 & 0.0652 & -0.0121 & 0.001 & 800554923.8481 & 66712910.3207 & 8167.7972 \tabularnewline
142 & 0.0659 & 0.013 & 0.0011 & 910942334.8852 & 75911861.2404 & 8712.7413 \tabularnewline
143 & 0.0887 & -0.0201 & 0.0017 & 1205972847.4516 & 100497737.2876 & 10024.856 \tabularnewline
144 & 0.0977 & 0.0061 & 5e-04 & 91656660.0565 & 7638055.0047 & 2763.7031 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69611&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]133[/C][C]0.1233[/C][C]0.0112[/C][C]9e-04[/C][C]167770532.8107[/C][C]13980877.7342[/C][C]3739.1012[/C][/ROW]
[ROW][C]134[/C][C]0.0906[/C][C]-0.0871[/C][C]0.0073[/C][C]19346306742.7746[/C][C]1612192228.5645[/C][C]40152.1136[/C][/ROW]
[ROW][C]135[/C][C]0.0769[/C][C]-0.0432[/C][C]0.0036[/C][C]6720687938.2657[/C][C]560057328.1888[/C][C]23665.5304[/C][/ROW]
[ROW][C]136[/C][C]0.0626[/C][C]0.0481[/C][C]0.004[/C][C]12597039611.3422[/C][C]1049753300.9452[/C][C]32399.8966[/C][/ROW]
[ROW][C]137[/C][C]0.0539[/C][C]-0.0543[/C][C]0.0045[/C][C]21893878232.8892[/C][C]1824489852.7408[/C][C]42714.0475[/C][/ROW]
[ROW][C]138[/C][C]0.0615[/C][C]0.0527[/C][C]0.0044[/C][C]16140259438.5908[/C][C]1345021619.8826[/C][C]36674.5364[/C][/ROW]
[ROW][C]139[/C][C]0.0323[/C][C]0.0207[/C][C]0.0017[/C][C]9189570962.153[/C][C]765797580.1794[/C][C]27673.0479[/C][/ROW]
[ROW][C]140[/C][C]0.0343[/C][C]-0.0061[/C][C]5e-04[/C][C]721735254.6889[/C][C]60144604.5574[/C][C]7755.2953[/C][/ROW]
[ROW][C]141[/C][C]0.0652[/C][C]-0.0121[/C][C]0.001[/C][C]800554923.8481[/C][C]66712910.3207[/C][C]8167.7972[/C][/ROW]
[ROW][C]142[/C][C]0.0659[/C][C]0.013[/C][C]0.0011[/C][C]910942334.8852[/C][C]75911861.2404[/C][C]8712.7413[/C][/ROW]
[ROW][C]143[/C][C]0.0887[/C][C]-0.0201[/C][C]0.0017[/C][C]1205972847.4516[/C][C]100497737.2876[/C][C]10024.856[/C][/ROW]
[ROW][C]144[/C][C]0.0977[/C][C]0.0061[/C][C]5e-04[/C][C]91656660.0565[/C][C]7638055.0047[/C][C]2763.7031[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69611&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69611&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
1330.12330.01129e-04167770532.810713980877.73423739.1012
1340.0906-0.08710.007319346306742.77461612192228.564540152.1136
1350.0769-0.04320.00366720687938.2657560057328.188823665.5304
1360.06260.04810.00412597039611.34221049753300.945232399.8966
1370.0539-0.05430.004521893878232.88921824489852.740842714.0475
1380.06150.05270.004416140259438.59081345021619.882636674.5364
1390.03230.02070.00179189570962.153765797580.179427673.0479
1400.0343-0.00615e-04721735254.688960144604.55747755.2953
1410.0652-0.01210.001800554923.848166712910.32078167.7972
1420.06590.0130.0011910942334.885275911861.24048712.7413
1430.0887-0.02010.00171205972847.4516100497737.287610024.856
1440.09770.00615e-0491656660.05657638055.00472763.7031



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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,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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')