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 09:56:40 -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/t1260550669sgdsn2x7k26yfu4.htm/, Retrieved Sun, 28 Apr 2024 20:57:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66551, Retrieved Sun, 28 Apr 2024 20:57:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact128
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [forecasting] [2009-12-11 16:56:40] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2360
2214
2825
2355
2333
3016
2155
2172
2150
2533
2058
2160
2260
2498
2695
2799
2947
2930
2318
2540
2570
2669
2450
2842
3440
2678
2981
2260
2844
2546
2456
2295
2379
2479
2057
2280
2351
2276
2548
2311
2201
2725
2408
2139
1898
2537
2069
2063
2524
2437
2189
2793
2074
2622
2278
2144
2427
2139
1828
2072
1800
1758
2246
1987
1868
2514
2121




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66551&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 time1 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[55])
432408-------
442139-------
451898-------
462537-------
472069-------
482063-------
492524-------
502437-------
512189-------
522793-------
532074-------
542622-------
552278-------
5621442229.42661753.16712762.84480.37680.42920.63020.4292
5724272204.40951716.64272753.08960.21330.58540.86310.3963
5821392386.81981863.54512974.76230.20440.44670.30830.6416
5918282153.38881644.75562730.44440.13450.51950.61280.3361
6020722254.43541720.05342860.99430.27780.91590.73190.4697
6118002413.75511847.63613055.41690.03040.85170.36820.6608
6217582317.45161751.0562963.08360.04470.94190.35830.5477
6322462455.60191858.87773135.2560.27280.97790.7790.6957
6419872368.42931771.17663052.30530.13720.63720.11180.6022
6518682347.11241741.14273043.3990.08870.84460.7790.5771
6625142533.76251890.55033270.98520.4790.96160.40730.7517
6721212256.54591641.35962969.43620.35470.23950.47650.4765

\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[55]) \tabularnewline
43 & 2408 & - & - & - & - & - & - & - \tabularnewline
44 & 2139 & - & - & - & - & - & - & - \tabularnewline
45 & 1898 & - & - & - & - & - & - & - \tabularnewline
46 & 2537 & - & - & - & - & - & - & - \tabularnewline
47 & 2069 & - & - & - & - & - & - & - \tabularnewline
48 & 2063 & - & - & - & - & - & - & - \tabularnewline
49 & 2524 & - & - & - & - & - & - & - \tabularnewline
50 & 2437 & - & - & - & - & - & - & - \tabularnewline
51 & 2189 & - & - & - & - & - & - & - \tabularnewline
52 & 2793 & - & - & - & - & - & - & - \tabularnewline
53 & 2074 & - & - & - & - & - & - & - \tabularnewline
54 & 2622 & - & - & - & - & - & - & - \tabularnewline
55 & 2278 & - & - & - & - & - & - & - \tabularnewline
56 & 2144 & 2229.4266 & 1753.1671 & 2762.8448 & 0.3768 & 0.4292 & 0.6302 & 0.4292 \tabularnewline
57 & 2427 & 2204.4095 & 1716.6427 & 2753.0896 & 0.2133 & 0.5854 & 0.8631 & 0.3963 \tabularnewline
58 & 2139 & 2386.8198 & 1863.5451 & 2974.7623 & 0.2044 & 0.4467 & 0.3083 & 0.6416 \tabularnewline
59 & 1828 & 2153.3888 & 1644.7556 & 2730.4444 & 0.1345 & 0.5195 & 0.6128 & 0.3361 \tabularnewline
60 & 2072 & 2254.4354 & 1720.0534 & 2860.9943 & 0.2778 & 0.9159 & 0.7319 & 0.4697 \tabularnewline
61 & 1800 & 2413.7551 & 1847.6361 & 3055.4169 & 0.0304 & 0.8517 & 0.3682 & 0.6608 \tabularnewline
62 & 1758 & 2317.4516 & 1751.056 & 2963.0836 & 0.0447 & 0.9419 & 0.3583 & 0.5477 \tabularnewline
63 & 2246 & 2455.6019 & 1858.8777 & 3135.256 & 0.2728 & 0.9779 & 0.779 & 0.6957 \tabularnewline
64 & 1987 & 2368.4293 & 1771.1766 & 3052.3053 & 0.1372 & 0.6372 & 0.1118 & 0.6022 \tabularnewline
65 & 1868 & 2347.1124 & 1741.1427 & 3043.399 & 0.0887 & 0.8446 & 0.779 & 0.5771 \tabularnewline
66 & 2514 & 2533.7625 & 1890.5503 & 3270.9852 & 0.479 & 0.9616 & 0.4073 & 0.7517 \tabularnewline
67 & 2121 & 2256.5459 & 1641.3596 & 2969.4362 & 0.3547 & 0.2395 & 0.4765 & 0.4765 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66551&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[55])[/C][/ROW]
[ROW][C]43[/C][C]2408[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1898[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2537[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2069[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2063[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2524[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]2437[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]2189[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]2793[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]2074[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]2622[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]2278[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]2144[/C][C]2229.4266[/C][C]1753.1671[/C][C]2762.8448[/C][C]0.3768[/C][C]0.4292[/C][C]0.6302[/C][C]0.4292[/C][/ROW]
[ROW][C]57[/C][C]2427[/C][C]2204.4095[/C][C]1716.6427[/C][C]2753.0896[/C][C]0.2133[/C][C]0.5854[/C][C]0.8631[/C][C]0.3963[/C][/ROW]
[ROW][C]58[/C][C]2139[/C][C]2386.8198[/C][C]1863.5451[/C][C]2974.7623[/C][C]0.2044[/C][C]0.4467[/C][C]0.3083[/C][C]0.6416[/C][/ROW]
[ROW][C]59[/C][C]1828[/C][C]2153.3888[/C][C]1644.7556[/C][C]2730.4444[/C][C]0.1345[/C][C]0.5195[/C][C]0.6128[/C][C]0.3361[/C][/ROW]
[ROW][C]60[/C][C]2072[/C][C]2254.4354[/C][C]1720.0534[/C][C]2860.9943[/C][C]0.2778[/C][C]0.9159[/C][C]0.7319[/C][C]0.4697[/C][/ROW]
[ROW][C]61[/C][C]1800[/C][C]2413.7551[/C][C]1847.6361[/C][C]3055.4169[/C][C]0.0304[/C][C]0.8517[/C][C]0.3682[/C][C]0.6608[/C][/ROW]
[ROW][C]62[/C][C]1758[/C][C]2317.4516[/C][C]1751.056[/C][C]2963.0836[/C][C]0.0447[/C][C]0.9419[/C][C]0.3583[/C][C]0.5477[/C][/ROW]
[ROW][C]63[/C][C]2246[/C][C]2455.6019[/C][C]1858.8777[/C][C]3135.256[/C][C]0.2728[/C][C]0.9779[/C][C]0.779[/C][C]0.6957[/C][/ROW]
[ROW][C]64[/C][C]1987[/C][C]2368.4293[/C][C]1771.1766[/C][C]3052.3053[/C][C]0.1372[/C][C]0.6372[/C][C]0.1118[/C][C]0.6022[/C][/ROW]
[ROW][C]65[/C][C]1868[/C][C]2347.1124[/C][C]1741.1427[/C][C]3043.399[/C][C]0.0887[/C][C]0.8446[/C][C]0.779[/C][C]0.5771[/C][/ROW]
[ROW][C]66[/C][C]2514[/C][C]2533.7625[/C][C]1890.5503[/C][C]3270.9852[/C][C]0.479[/C][C]0.9616[/C][C]0.4073[/C][C]0.7517[/C][/ROW]
[ROW][C]67[/C][C]2121[/C][C]2256.5459[/C][C]1641.3596[/C][C]2969.4362[/C][C]0.3547[/C][C]0.2395[/C][C]0.4765[/C][C]0.4765[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66551&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66551&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[55])
432408-------
442139-------
451898-------
462537-------
472069-------
482063-------
492524-------
502437-------
512189-------
522793-------
532074-------
542622-------
552278-------
5621442229.42661753.16712762.84480.37680.42920.63020.4292
5724272204.40951716.64272753.08960.21330.58540.86310.3963
5821392386.81981863.54512974.76230.20440.44670.30830.6416
5918282153.38881644.75562730.44440.13450.51950.61280.3361
6020722254.43541720.05342860.99430.27780.91590.73190.4697
6118002413.75511847.63613055.41690.03040.85170.36820.6608
6217582317.45161751.0562963.08360.04470.94190.35830.5477
6322462455.60191858.87773135.2560.27280.97790.7790.6957
6419872368.42931771.17663052.30530.13720.63720.11180.6022
6518682347.11241741.14273043.3990.08870.84460.7790.5771
6625142533.76251890.55033270.98520.4790.96160.40730.7517
6721212256.54591641.35962969.43620.35470.23950.47650.4765







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.1221-0.038307297.708700
570.1270.1010.069649546.526228422.1174168.5886
580.1257-0.10380.08161414.667139419.634198.5438
590.1367-0.15110.0986105877.886656034.1971236.7154
600.1373-0.08090.09533282.657851483.8893226.9006
610.1356-0.25430.1216376695.2822105685.7881325.0935
620.1421-0.24140.1387312986.1462135300.125367.8317
630.1412-0.08540.13243932.9748123879.2312351.9648
640.1473-0.1610.1352145488.2984126280.2387355.3593
650.1514-0.20410.1421229548.6939136607.0842369.604
660.1484-0.00780.1299390.5572124223.7635352.4539
670.1612-0.06010.124118372.7024115402.8418339.7099

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.1221 & -0.0383 & 0 & 7297.7087 & 0 & 0 \tabularnewline
57 & 0.127 & 0.101 & 0.0696 & 49546.5262 & 28422.1174 & 168.5886 \tabularnewline
58 & 0.1257 & -0.1038 & 0.081 & 61414.6671 & 39419.634 & 198.5438 \tabularnewline
59 & 0.1367 & -0.1511 & 0.0986 & 105877.8866 & 56034.1971 & 236.7154 \tabularnewline
60 & 0.1373 & -0.0809 & 0.095 & 33282.6578 & 51483.8893 & 226.9006 \tabularnewline
61 & 0.1356 & -0.2543 & 0.1216 & 376695.2822 & 105685.7881 & 325.0935 \tabularnewline
62 & 0.1421 & -0.2414 & 0.1387 & 312986.1462 & 135300.125 & 367.8317 \tabularnewline
63 & 0.1412 & -0.0854 & 0.132 & 43932.9748 & 123879.2312 & 351.9648 \tabularnewline
64 & 0.1473 & -0.161 & 0.1352 & 145488.2984 & 126280.2387 & 355.3593 \tabularnewline
65 & 0.1514 & -0.2041 & 0.1421 & 229548.6939 & 136607.0842 & 369.604 \tabularnewline
66 & 0.1484 & -0.0078 & 0.1299 & 390.5572 & 124223.7635 & 352.4539 \tabularnewline
67 & 0.1612 & -0.0601 & 0.1241 & 18372.7024 & 115402.8418 & 339.7099 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66551&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]56[/C][C]0.1221[/C][C]-0.0383[/C][C]0[/C][C]7297.7087[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.127[/C][C]0.101[/C][C]0.0696[/C][C]49546.5262[/C][C]28422.1174[/C][C]168.5886[/C][/ROW]
[ROW][C]58[/C][C]0.1257[/C][C]-0.1038[/C][C]0.081[/C][C]61414.6671[/C][C]39419.634[/C][C]198.5438[/C][/ROW]
[ROW][C]59[/C][C]0.1367[/C][C]-0.1511[/C][C]0.0986[/C][C]105877.8866[/C][C]56034.1971[/C][C]236.7154[/C][/ROW]
[ROW][C]60[/C][C]0.1373[/C][C]-0.0809[/C][C]0.095[/C][C]33282.6578[/C][C]51483.8893[/C][C]226.9006[/C][/ROW]
[ROW][C]61[/C][C]0.1356[/C][C]-0.2543[/C][C]0.1216[/C][C]376695.2822[/C][C]105685.7881[/C][C]325.0935[/C][/ROW]
[ROW][C]62[/C][C]0.1421[/C][C]-0.2414[/C][C]0.1387[/C][C]312986.1462[/C][C]135300.125[/C][C]367.8317[/C][/ROW]
[ROW][C]63[/C][C]0.1412[/C][C]-0.0854[/C][C]0.132[/C][C]43932.9748[/C][C]123879.2312[/C][C]351.9648[/C][/ROW]
[ROW][C]64[/C][C]0.1473[/C][C]-0.161[/C][C]0.1352[/C][C]145488.2984[/C][C]126280.2387[/C][C]355.3593[/C][/ROW]
[ROW][C]65[/C][C]0.1514[/C][C]-0.2041[/C][C]0.1421[/C][C]229548.6939[/C][C]136607.0842[/C][C]369.604[/C][/ROW]
[ROW][C]66[/C][C]0.1484[/C][C]-0.0078[/C][C]0.1299[/C][C]390.5572[/C][C]124223.7635[/C][C]352.4539[/C][/ROW]
[ROW][C]67[/C][C]0.1612[/C][C]-0.0601[/C][C]0.1241[/C][C]18372.7024[/C][C]115402.8418[/C][C]339.7099[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66551&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66551&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
560.1221-0.038307297.708700
570.1270.1010.069649546.526228422.1174168.5886
580.1257-0.10380.08161414.667139419.634198.5438
590.1367-0.15110.0986105877.886656034.1971236.7154
600.1373-0.08090.09533282.657851483.8893226.9006
610.1356-0.25430.1216376695.2822105685.7881325.0935
620.1421-0.24140.1387312986.1462135300.125367.8317
630.1412-0.08540.13243932.9748123879.2312351.9648
640.1473-0.1610.1352145488.2984126280.2387355.3593
650.1514-0.20410.1421229548.6939136607.0842369.604
660.1484-0.00780.1299390.5572124223.7635352.4539
670.1612-0.06010.124118372.7024115402.8418339.7099



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