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 computationMon, 15 Dec 2008 10:00:29 -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/2008/Dec/15/t1229360533b0awy29lu1xg9s7.htm/, Retrieved Wed, 15 May 2024 09:14:50 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33741, Retrieved Wed, 15 May 2024 09:14:50 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact206
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]
- RMPD  [Standard Deviation-Mean Plot] [Identification an...] [2008-12-07 14:45:52] [b943bd7078334192ff8343563ee31113]
- RM      [Variance Reduction Matrix] [Identification an...] [2008-12-07 14:47:22] [b943bd7078334192ff8343563ee31113]
- RMP       [(Partial) Autocorrelation Function] [Identification an...] [2008-12-07 14:51:36] [b943bd7078334192ff8343563ee31113]
F   P         [(Partial) Autocorrelation Function] [Identification an...] [2008-12-07 14:54:30] [b943bd7078334192ff8343563ee31113]
-   P           [(Partial) Autocorrelation Function] [Identification an...] [2008-12-07 14:58:01] [b943bd7078334192ff8343563ee31113]
F RMP             [Spectral Analysis] [Identification an...] [2008-12-07 15:02:51] [b943bd7078334192ff8343563ee31113]
F RMP               [(Partial) Autocorrelation Function] [Identification an...] [2008-12-07 15:05:29] [b943bd7078334192ff8343563ee31113]
F RMP                 [ARIMA Backward Selection] [Identification an...] [2008-12-07 15:45:38] [b943bd7078334192ff8343563ee31113]
-   P                   [ARIMA Backward Selection] [ARIMA Backward Mo...] [2008-12-12 14:40:13] [b943bd7078334192ff8343563ee31113]
- RMP                       [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-15 17:00:29] [620b6ad5c4696049e39cb73ce029682c] [Current]
F   P                         [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-15 18:00:13] [b943bd7078334192ff8343563ee31113]
Feedback Forum

Post a new message
Dataseries X:
1593
1477.9
1733.7
1569.7
1843.7
1950.3
1657.5
1772.1
1568.3
1809.8
1646.7
1808.5
1763.9
1625.5
1538.8
1342.4
1645.1
1619.9
1338.1
1505.5
1529.1
1511.9
1656.7
1694.4
1662.3
1588.7
1483.3
1585.6
1658.9
1584.4
1470.6
1618.7
1407.6
1473.9
1515.3
1485.4
1496.1
1493.5
1298.4
1375.3
1507.9
1455.3
1363.3
1392.8
1348.8
1880.3
1669.2
1543.6
1701.2
1516.5
1466.8
1484.1
1577.2
1684.5
1414.7
1674.5
1598.7
1739.1
1674.6
1671.8
1802
1526.8
1580.9
1634.8
1610.3
1712
1678.8
1708.1
1680.6
2056
1624
2021.4
1861.1
1750.8
1767.5
1710.3
2151.5
2047.9
1915.4
1984.7
1896.5
2170.8
2139.9
2330.5
2121.8
2226.8
1857.9
2155.9
2341.7
2290.2
2006.5
2111.9
1731.3
1762.2
1863.2
1943.5
1975.2




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33741&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33741&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33741&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'George Udny Yule' @ 72.249.76.132







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[85])
731861.1-------
741750.8-------
751767.5-------
761710.3-------
772151.5-------
782047.9-------
791915.4-------
801984.7-------
811896.5-------
822170.8-------
832139.9-------
842330.5-------
852121.8-------
862226.82023.94511744.41142402.90450.1470.30640.92110.3064
871857.91991.29491710.93912374.00660.24730.11390.87410.252
882155.91911.30641640.26752282.27770.09810.61110.85590.133
892341.72226.73721825.30922837.18240.3560.590.59540.6319
902290.22244.81331822.21262902.60250.44620.38640.72130.643
912006.51938.55151597.92482449.8030.39720.08880.53540.2412
922111.92144.00841716.24492832.73180.46360.65220.67490.5252
931731.32006.73191612.42692635.77450.19540.37160.63440.36
941762.22349.79281815.39983290.32690.11040.90130.64540.6826
951863.22203.78051709.10053065.92720.21940.84230.55770.5739
961943.52349.48511783.12253393.78540.2230.81930.51420.6654
971975.22307.82821743.45123361.31360.2680.75110.63540.6354

\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[85]) \tabularnewline
73 & 1861.1 & - & - & - & - & - & - & - \tabularnewline
74 & 1750.8 & - & - & - & - & - & - & - \tabularnewline
75 & 1767.5 & - & - & - & - & - & - & - \tabularnewline
76 & 1710.3 & - & - & - & - & - & - & - \tabularnewline
77 & 2151.5 & - & - & - & - & - & - & - \tabularnewline
78 & 2047.9 & - & - & - & - & - & - & - \tabularnewline
79 & 1915.4 & - & - & - & - & - & - & - \tabularnewline
80 & 1984.7 & - & - & - & - & - & - & - \tabularnewline
81 & 1896.5 & - & - & - & - & - & - & - \tabularnewline
82 & 2170.8 & - & - & - & - & - & - & - \tabularnewline
83 & 2139.9 & - & - & - & - & - & - & - \tabularnewline
84 & 2330.5 & - & - & - & - & - & - & - \tabularnewline
85 & 2121.8 & - & - & - & - & - & - & - \tabularnewline
86 & 2226.8 & 2023.9451 & 1744.4114 & 2402.9045 & 0.147 & 0.3064 & 0.9211 & 0.3064 \tabularnewline
87 & 1857.9 & 1991.2949 & 1710.9391 & 2374.0066 & 0.2473 & 0.1139 & 0.8741 & 0.252 \tabularnewline
88 & 2155.9 & 1911.3064 & 1640.2675 & 2282.2777 & 0.0981 & 0.6111 & 0.8559 & 0.133 \tabularnewline
89 & 2341.7 & 2226.7372 & 1825.3092 & 2837.1824 & 0.356 & 0.59 & 0.5954 & 0.6319 \tabularnewline
90 & 2290.2 & 2244.8133 & 1822.2126 & 2902.6025 & 0.4462 & 0.3864 & 0.7213 & 0.643 \tabularnewline
91 & 2006.5 & 1938.5515 & 1597.9248 & 2449.803 & 0.3972 & 0.0888 & 0.5354 & 0.2412 \tabularnewline
92 & 2111.9 & 2144.0084 & 1716.2449 & 2832.7318 & 0.4636 & 0.6522 & 0.6749 & 0.5252 \tabularnewline
93 & 1731.3 & 2006.7319 & 1612.4269 & 2635.7745 & 0.1954 & 0.3716 & 0.6344 & 0.36 \tabularnewline
94 & 1762.2 & 2349.7928 & 1815.3998 & 3290.3269 & 0.1104 & 0.9013 & 0.6454 & 0.6826 \tabularnewline
95 & 1863.2 & 2203.7805 & 1709.1005 & 3065.9272 & 0.2194 & 0.8423 & 0.5577 & 0.5739 \tabularnewline
96 & 1943.5 & 2349.4851 & 1783.1225 & 3393.7854 & 0.223 & 0.8193 & 0.5142 & 0.6654 \tabularnewline
97 & 1975.2 & 2307.8282 & 1743.4512 & 3361.3136 & 0.268 & 0.7511 & 0.6354 & 0.6354 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33741&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[85])[/C][/ROW]
[ROW][C]73[/C][C]1861.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]1750.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]1767.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]1710.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]2151.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]2047.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]1915.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]1984.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]1896.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]2170.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]2139.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]2330.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2121.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]2226.8[/C][C]2023.9451[/C][C]1744.4114[/C][C]2402.9045[/C][C]0.147[/C][C]0.3064[/C][C]0.9211[/C][C]0.3064[/C][/ROW]
[ROW][C]87[/C][C]1857.9[/C][C]1991.2949[/C][C]1710.9391[/C][C]2374.0066[/C][C]0.2473[/C][C]0.1139[/C][C]0.8741[/C][C]0.252[/C][/ROW]
[ROW][C]88[/C][C]2155.9[/C][C]1911.3064[/C][C]1640.2675[/C][C]2282.2777[/C][C]0.0981[/C][C]0.6111[/C][C]0.8559[/C][C]0.133[/C][/ROW]
[ROW][C]89[/C][C]2341.7[/C][C]2226.7372[/C][C]1825.3092[/C][C]2837.1824[/C][C]0.356[/C][C]0.59[/C][C]0.5954[/C][C]0.6319[/C][/ROW]
[ROW][C]90[/C][C]2290.2[/C][C]2244.8133[/C][C]1822.2126[/C][C]2902.6025[/C][C]0.4462[/C][C]0.3864[/C][C]0.7213[/C][C]0.643[/C][/ROW]
[ROW][C]91[/C][C]2006.5[/C][C]1938.5515[/C][C]1597.9248[/C][C]2449.803[/C][C]0.3972[/C][C]0.0888[/C][C]0.5354[/C][C]0.2412[/C][/ROW]
[ROW][C]92[/C][C]2111.9[/C][C]2144.0084[/C][C]1716.2449[/C][C]2832.7318[/C][C]0.4636[/C][C]0.6522[/C][C]0.6749[/C][C]0.5252[/C][/ROW]
[ROW][C]93[/C][C]1731.3[/C][C]2006.7319[/C][C]1612.4269[/C][C]2635.7745[/C][C]0.1954[/C][C]0.3716[/C][C]0.6344[/C][C]0.36[/C][/ROW]
[ROW][C]94[/C][C]1762.2[/C][C]2349.7928[/C][C]1815.3998[/C][C]3290.3269[/C][C]0.1104[/C][C]0.9013[/C][C]0.6454[/C][C]0.6826[/C][/ROW]
[ROW][C]95[/C][C]1863.2[/C][C]2203.7805[/C][C]1709.1005[/C][C]3065.9272[/C][C]0.2194[/C][C]0.8423[/C][C]0.5577[/C][C]0.5739[/C][/ROW]
[ROW][C]96[/C][C]1943.5[/C][C]2349.4851[/C][C]1783.1225[/C][C]3393.7854[/C][C]0.223[/C][C]0.8193[/C][C]0.5142[/C][C]0.6654[/C][/ROW]
[ROW][C]97[/C][C]1975.2[/C][C]2307.8282[/C][C]1743.4512[/C][C]3361.3136[/C][C]0.268[/C][C]0.7511[/C][C]0.6354[/C][C]0.6354[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33741&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33741&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[85])
731861.1-------
741750.8-------
751767.5-------
761710.3-------
772151.5-------
782047.9-------
791915.4-------
801984.7-------
811896.5-------
822170.8-------
832139.9-------
842330.5-------
852121.8-------
862226.82023.94511744.41142402.90450.1470.30640.92110.3064
871857.91991.29491710.93912374.00660.24730.11390.87410.252
882155.91911.30641640.26752282.27770.09810.61110.85590.133
892341.72226.73721825.30922837.18240.3560.590.59540.6319
902290.22244.81331822.21262902.60250.44620.38640.72130.643
912006.51938.55151597.92482449.8030.39720.08880.53540.2412
922111.92144.00841716.24492832.73180.46360.65220.67490.5252
931731.32006.73191612.42692635.77450.19540.37160.63440.36
941762.22349.79281815.39983290.32690.11040.90130.64540.6826
951863.22203.78051709.10053065.92720.21940.84230.55770.5739
961943.52349.48511783.12253393.78540.2230.81930.51420.6654
971975.22307.82821743.45123361.31360.2680.75110.63540.6354







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
860.09550.10020.008441150.1143429.176258.5592
870.0981-0.0670.005617794.20831482.850738.5078
880.0990.1280.010759826.05194985.504370.6081
890.13990.05160.004313216.45671101.371433.1869
900.14950.02020.00172059.951171.662613.102
910.13460.03510.00294617.0033384.750319.6151
920.1639-0.0150.00121030.946685.91229.2689
930.1599-0.13730.011475862.73246321.894479.5103
940.2042-0.25010.0208345265.320528772.11169.6234
950.1996-0.15450.0129115995.09289666.257798.3171
960.2268-0.17280.0144164823.922213735.3268117.1978
970.2329-0.14410.012110641.49239220.124496.0215

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
86 & 0.0955 & 0.1002 & 0.0084 & 41150.114 & 3429.1762 & 58.5592 \tabularnewline
87 & 0.0981 & -0.067 & 0.0056 & 17794.2083 & 1482.8507 & 38.5078 \tabularnewline
88 & 0.099 & 0.128 & 0.0107 & 59826.0519 & 4985.5043 & 70.6081 \tabularnewline
89 & 0.1399 & 0.0516 & 0.0043 & 13216.4567 & 1101.3714 & 33.1869 \tabularnewline
90 & 0.1495 & 0.0202 & 0.0017 & 2059.951 & 171.6626 & 13.102 \tabularnewline
91 & 0.1346 & 0.0351 & 0.0029 & 4617.0033 & 384.7503 & 19.6151 \tabularnewline
92 & 0.1639 & -0.015 & 0.0012 & 1030.9466 & 85.9122 & 9.2689 \tabularnewline
93 & 0.1599 & -0.1373 & 0.0114 & 75862.7324 & 6321.8944 & 79.5103 \tabularnewline
94 & 0.2042 & -0.2501 & 0.0208 & 345265.3205 & 28772.11 & 169.6234 \tabularnewline
95 & 0.1996 & -0.1545 & 0.0129 & 115995.0928 & 9666.2577 & 98.3171 \tabularnewline
96 & 0.2268 & -0.1728 & 0.0144 & 164823.9222 & 13735.3268 & 117.1978 \tabularnewline
97 & 0.2329 & -0.1441 & 0.012 & 110641.4923 & 9220.1244 & 96.0215 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33741&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]86[/C][C]0.0955[/C][C]0.1002[/C][C]0.0084[/C][C]41150.114[/C][C]3429.1762[/C][C]58.5592[/C][/ROW]
[ROW][C]87[/C][C]0.0981[/C][C]-0.067[/C][C]0.0056[/C][C]17794.2083[/C][C]1482.8507[/C][C]38.5078[/C][/ROW]
[ROW][C]88[/C][C]0.099[/C][C]0.128[/C][C]0.0107[/C][C]59826.0519[/C][C]4985.5043[/C][C]70.6081[/C][/ROW]
[ROW][C]89[/C][C]0.1399[/C][C]0.0516[/C][C]0.0043[/C][C]13216.4567[/C][C]1101.3714[/C][C]33.1869[/C][/ROW]
[ROW][C]90[/C][C]0.1495[/C][C]0.0202[/C][C]0.0017[/C][C]2059.951[/C][C]171.6626[/C][C]13.102[/C][/ROW]
[ROW][C]91[/C][C]0.1346[/C][C]0.0351[/C][C]0.0029[/C][C]4617.0033[/C][C]384.7503[/C][C]19.6151[/C][/ROW]
[ROW][C]92[/C][C]0.1639[/C][C]-0.015[/C][C]0.0012[/C][C]1030.9466[/C][C]85.9122[/C][C]9.2689[/C][/ROW]
[ROW][C]93[/C][C]0.1599[/C][C]-0.1373[/C][C]0.0114[/C][C]75862.7324[/C][C]6321.8944[/C][C]79.5103[/C][/ROW]
[ROW][C]94[/C][C]0.2042[/C][C]-0.2501[/C][C]0.0208[/C][C]345265.3205[/C][C]28772.11[/C][C]169.6234[/C][/ROW]
[ROW][C]95[/C][C]0.1996[/C][C]-0.1545[/C][C]0.0129[/C][C]115995.0928[/C][C]9666.2577[/C][C]98.3171[/C][/ROW]
[ROW][C]96[/C][C]0.2268[/C][C]-0.1728[/C][C]0.0144[/C][C]164823.9222[/C][C]13735.3268[/C][C]117.1978[/C][/ROW]
[ROW][C]97[/C][C]0.2329[/C][C]-0.1441[/C][C]0.012[/C][C]110641.4923[/C][C]9220.1244[/C][C]96.0215[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33741&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33741&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
860.09550.10020.008441150.1143429.176258.5592
870.0981-0.0670.005617794.20831482.850738.5078
880.0990.1280.010759826.05194985.504370.6081
890.13990.05160.004313216.45671101.371433.1869
900.14950.02020.00172059.951171.662613.102
910.13460.03510.00294617.0033384.750319.6151
920.1639-0.0150.00121030.946685.91229.2689
930.1599-0.13730.011475862.73246321.894479.5103
940.2042-0.25010.0208345265.320528772.11169.6234
950.1996-0.15450.0129115995.09289666.257798.3171
960.2268-0.17280.0144164823.922213735.3268117.1978
970.2329-0.14410.012110641.49239220.124496.0215



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