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, 19 Dec 2016 20:52:13 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/19/t1482177145ndgq4f9mxiobmwe.htm/, Retrieved Sat, 18 May 2024 01:00:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301473, Retrieved Sat, 18 May 2024 01:00:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact69
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2016-12-16 13:36:55] [683f400e1b95307fc738e729f07c4fce]
- RM    [Exponential Smoothing] [] [2016-12-16 13:42:25] [683f400e1b95307fc738e729f07c4fce]
- RMP     [ARIMA Backward Selection] [] [2016-12-18 22:30:58] [683f400e1b95307fc738e729f07c4fce]
- RM        [ARIMA Forecasting] [] [2016-12-18 22:55:26] [683f400e1b95307fc738e729f07c4fce]
- R P           [ARIMA Forecasting] [] [2016-12-19 19:52:13] [404ac5ee4f7301873f6a96ef36861981] [Current]
Feedback Forum

Post a new message
Dataseries X:
6086
6090.5
6103.5
6144
6190.5
6225
6272
6294
6366
6426
6477
6500
6538
6581
6615.5
6639.5
6651
6665
6684
6684.5
6666.5
6666.5
6651
6652
6647
6618.5
6604.5
6572
6556
6535
6515.5
6515
6489
6491
6483.5
6486.5
6486.5
6478.5
6461
6458.5
6446
6420
6397.5
6408
6408.5
6401.5
6408.5
6417.5
6406.5
6426.5
6431.5
6441.5
6446
6450
6468
6488.5
6512
6525
6551
6567.5
6560.5
6572
6574.5
6583.5
6589.5
6600
6601
6586
6590
6616
6641.5
6647
6662
6663.5
6663
6653.5
6642.5
6624.5
6605.5
6604.5
6575
6566
6562.5
6560.5
6502
6552.5
6542.5
6536
6516.5
6506.5
6491.5
6469.5
6445
6426
6355.5
6340
6307.5
6254.5
6230.5
6213
6212.5
6203
6204
6220.5
6205
6199.5
6184.5
6169
6140.5
6144.5
6145.5
6148.5
6145
6133
6138
6104.5
6090.5




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301473&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301473&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301473&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[105])
1046220.5-------
1056205-------
1066199.56207.7796174.70416240.85390.31190.56540.56540.5654
1076184.56208.90836156.43066261.38610.1810.63740.63740.558
10861696210.45736134.7266286.18860.14160.74910.74910.5562
1096140.56208.27686104.98356311.57020.09920.77190.77190.5248
1106144.56208.76136072.44486345.07780.17780.83680.83680.5216
1116145.56209.35246037.85936380.84550.23280.77070.77070.5198
1126148.56209.42826000.14616418.71030.28410.72530.72530.5165
11361456209.20365959.22966459.17760.30730.6830.6830.5131
11461336209.40225916.06656502.73780.30490.66650.66650.5117
11561386209.60955870.69346548.52550.33940.67110.67110.5106
1166104.56209.6735822.97616596.36980.2970.64180.64180.5094
1176090.56209.73125773.07416646.38840.29630.68170.68170.5085

\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[105]) \tabularnewline
104 & 6220.5 & - & - & - & - & - & - & - \tabularnewline
105 & 6205 & - & - & - & - & - & - & - \tabularnewline
106 & 6199.5 & 6207.779 & 6174.7041 & 6240.8539 & 0.3119 & 0.5654 & 0.5654 & 0.5654 \tabularnewline
107 & 6184.5 & 6208.9083 & 6156.4306 & 6261.3861 & 0.181 & 0.6374 & 0.6374 & 0.558 \tabularnewline
108 & 6169 & 6210.4573 & 6134.726 & 6286.1886 & 0.1416 & 0.7491 & 0.7491 & 0.5562 \tabularnewline
109 & 6140.5 & 6208.2768 & 6104.9835 & 6311.5702 & 0.0992 & 0.7719 & 0.7719 & 0.5248 \tabularnewline
110 & 6144.5 & 6208.7613 & 6072.4448 & 6345.0778 & 0.1778 & 0.8368 & 0.8368 & 0.5216 \tabularnewline
111 & 6145.5 & 6209.3524 & 6037.8593 & 6380.8455 & 0.2328 & 0.7707 & 0.7707 & 0.5198 \tabularnewline
112 & 6148.5 & 6209.4282 & 6000.1461 & 6418.7103 & 0.2841 & 0.7253 & 0.7253 & 0.5165 \tabularnewline
113 & 6145 & 6209.2036 & 5959.2296 & 6459.1776 & 0.3073 & 0.683 & 0.683 & 0.5131 \tabularnewline
114 & 6133 & 6209.4022 & 5916.0665 & 6502.7378 & 0.3049 & 0.6665 & 0.6665 & 0.5117 \tabularnewline
115 & 6138 & 6209.6095 & 5870.6934 & 6548.5255 & 0.3394 & 0.6711 & 0.6711 & 0.5106 \tabularnewline
116 & 6104.5 & 6209.673 & 5822.9761 & 6596.3698 & 0.297 & 0.6418 & 0.6418 & 0.5094 \tabularnewline
117 & 6090.5 & 6209.7312 & 5773.0741 & 6646.3884 & 0.2963 & 0.6817 & 0.6817 & 0.5085 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301473&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[105])[/C][/ROW]
[ROW][C]104[/C][C]6220.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6199.5[/C][C]6207.779[/C][C]6174.7041[/C][C]6240.8539[/C][C]0.3119[/C][C]0.5654[/C][C]0.5654[/C][C]0.5654[/C][/ROW]
[ROW][C]107[/C][C]6184.5[/C][C]6208.9083[/C][C]6156.4306[/C][C]6261.3861[/C][C]0.181[/C][C]0.6374[/C][C]0.6374[/C][C]0.558[/C][/ROW]
[ROW][C]108[/C][C]6169[/C][C]6210.4573[/C][C]6134.726[/C][C]6286.1886[/C][C]0.1416[/C][C]0.7491[/C][C]0.7491[/C][C]0.5562[/C][/ROW]
[ROW][C]109[/C][C]6140.5[/C][C]6208.2768[/C][C]6104.9835[/C][C]6311.5702[/C][C]0.0992[/C][C]0.7719[/C][C]0.7719[/C][C]0.5248[/C][/ROW]
[ROW][C]110[/C][C]6144.5[/C][C]6208.7613[/C][C]6072.4448[/C][C]6345.0778[/C][C]0.1778[/C][C]0.8368[/C][C]0.8368[/C][C]0.5216[/C][/ROW]
[ROW][C]111[/C][C]6145.5[/C][C]6209.3524[/C][C]6037.8593[/C][C]6380.8455[/C][C]0.2328[/C][C]0.7707[/C][C]0.7707[/C][C]0.5198[/C][/ROW]
[ROW][C]112[/C][C]6148.5[/C][C]6209.4282[/C][C]6000.1461[/C][C]6418.7103[/C][C]0.2841[/C][C]0.7253[/C][C]0.7253[/C][C]0.5165[/C][/ROW]
[ROW][C]113[/C][C]6145[/C][C]6209.2036[/C][C]5959.2296[/C][C]6459.1776[/C][C]0.3073[/C][C]0.683[/C][C]0.683[/C][C]0.5131[/C][/ROW]
[ROW][C]114[/C][C]6133[/C][C]6209.4022[/C][C]5916.0665[/C][C]6502.7378[/C][C]0.3049[/C][C]0.6665[/C][C]0.6665[/C][C]0.5117[/C][/ROW]
[ROW][C]115[/C][C]6138[/C][C]6209.6095[/C][C]5870.6934[/C][C]6548.5255[/C][C]0.3394[/C][C]0.6711[/C][C]0.6711[/C][C]0.5106[/C][/ROW]
[ROW][C]116[/C][C]6104.5[/C][C]6209.673[/C][C]5822.9761[/C][C]6596.3698[/C][C]0.297[/C][C]0.6418[/C][C]0.6418[/C][C]0.5094[/C][/ROW]
[ROW][C]117[/C][C]6090.5[/C][C]6209.7312[/C][C]5773.0741[/C][C]6646.3884[/C][C]0.2963[/C][C]0.6817[/C][C]0.6817[/C][C]0.5085[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301473&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301473&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[105])
1046220.5-------
1056205-------
1066199.56207.7796174.70416240.85390.31190.56540.56540.5654
1076184.56208.90836156.43066261.38610.1810.63740.63740.558
10861696210.45736134.7266286.18860.14160.74910.74910.5562
1096140.56208.27686104.98356311.57020.09920.77190.77190.5248
1106144.56208.76136072.44486345.07780.17780.83680.83680.5216
1116145.56209.35246037.85936380.84550.23280.77070.77070.5198
1126148.56209.42826000.14616418.71030.28410.72530.72530.5165
11361456209.20365959.22966459.17760.30730.6830.6830.5131
11461336209.40225916.06656502.73780.30490.66650.66650.5117
11561386209.60955870.69346548.52550.33940.67110.67110.5106
1166104.56209.6735822.97616596.36980.2970.64180.64180.5094
1176090.56209.73125773.07416646.38840.29630.68170.68170.5085







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0027-0.00130.00130.001368.542500-0.67460.6746
1070.0043-0.00390.00260.0026595.7675332.15518.2251-1.98881.3317
1080.0062-0.00670.0040.0041718.7055794.338528.184-3.3782.0138
1090.0085-0.0110.00580.00574593.69721744.178241.7634-5.52262.891
1100.0112-0.01050.00670.00674129.51312221.245247.1301-5.23613.36
1110.0141-0.01040.00730.00734077.12632530.558750.3047-5.20283.6671
1120.0172-0.00990.00770.00763712.24332699.370851.9555-4.96453.8525
1130.0205-0.01040.0080.0084122.10272877.212353.6397-5.23144.0248
1140.0241-0.01250.00850.00855837.28953206.109756.6225-6.22544.2693
1150.0278-0.01170.00880.00885127.91493398.290358.2949-5.83484.4259
1160.0318-0.01720.00960.009511061.35624094.932663.9917-8.56974.8026
1170.0359-0.01960.01040.010414216.08694938.362170.2735-9.71515.212

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
106 & 0.0027 & -0.0013 & 0.0013 & 0.0013 & 68.5425 & 0 & 0 & -0.6746 & 0.6746 \tabularnewline
107 & 0.0043 & -0.0039 & 0.0026 & 0.0026 & 595.7675 & 332.155 & 18.2251 & -1.9888 & 1.3317 \tabularnewline
108 & 0.0062 & -0.0067 & 0.004 & 0.004 & 1718.7055 & 794.3385 & 28.184 & -3.378 & 2.0138 \tabularnewline
109 & 0.0085 & -0.011 & 0.0058 & 0.0057 & 4593.6972 & 1744.1782 & 41.7634 & -5.5226 & 2.891 \tabularnewline
110 & 0.0112 & -0.0105 & 0.0067 & 0.0067 & 4129.5131 & 2221.2452 & 47.1301 & -5.2361 & 3.36 \tabularnewline
111 & 0.0141 & -0.0104 & 0.0073 & 0.0073 & 4077.1263 & 2530.5587 & 50.3047 & -5.2028 & 3.6671 \tabularnewline
112 & 0.0172 & -0.0099 & 0.0077 & 0.0076 & 3712.2433 & 2699.3708 & 51.9555 & -4.9645 & 3.8525 \tabularnewline
113 & 0.0205 & -0.0104 & 0.008 & 0.008 & 4122.1027 & 2877.2123 & 53.6397 & -5.2314 & 4.0248 \tabularnewline
114 & 0.0241 & -0.0125 & 0.0085 & 0.0085 & 5837.2895 & 3206.1097 & 56.6225 & -6.2254 & 4.2693 \tabularnewline
115 & 0.0278 & -0.0117 & 0.0088 & 0.0088 & 5127.9149 & 3398.2903 & 58.2949 & -5.8348 & 4.4259 \tabularnewline
116 & 0.0318 & -0.0172 & 0.0096 & 0.0095 & 11061.3562 & 4094.9326 & 63.9917 & -8.5697 & 4.8026 \tabularnewline
117 & 0.0359 & -0.0196 & 0.0104 & 0.0104 & 14216.0869 & 4938.3621 & 70.2735 & -9.7151 & 5.212 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301473&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]106[/C][C]0.0027[/C][C]-0.0013[/C][C]0.0013[/C][C]0.0013[/C][C]68.5425[/C][C]0[/C][C]0[/C][C]-0.6746[/C][C]0.6746[/C][/ROW]
[ROW][C]107[/C][C]0.0043[/C][C]-0.0039[/C][C]0.0026[/C][C]0.0026[/C][C]595.7675[/C][C]332.155[/C][C]18.2251[/C][C]-1.9888[/C][C]1.3317[/C][/ROW]
[ROW][C]108[/C][C]0.0062[/C][C]-0.0067[/C][C]0.004[/C][C]0.004[/C][C]1718.7055[/C][C]794.3385[/C][C]28.184[/C][C]-3.378[/C][C]2.0138[/C][/ROW]
[ROW][C]109[/C][C]0.0085[/C][C]-0.011[/C][C]0.0058[/C][C]0.0057[/C][C]4593.6972[/C][C]1744.1782[/C][C]41.7634[/C][C]-5.5226[/C][C]2.891[/C][/ROW]
[ROW][C]110[/C][C]0.0112[/C][C]-0.0105[/C][C]0.0067[/C][C]0.0067[/C][C]4129.5131[/C][C]2221.2452[/C][C]47.1301[/C][C]-5.2361[/C][C]3.36[/C][/ROW]
[ROW][C]111[/C][C]0.0141[/C][C]-0.0104[/C][C]0.0073[/C][C]0.0073[/C][C]4077.1263[/C][C]2530.5587[/C][C]50.3047[/C][C]-5.2028[/C][C]3.6671[/C][/ROW]
[ROW][C]112[/C][C]0.0172[/C][C]-0.0099[/C][C]0.0077[/C][C]0.0076[/C][C]3712.2433[/C][C]2699.3708[/C][C]51.9555[/C][C]-4.9645[/C][C]3.8525[/C][/ROW]
[ROW][C]113[/C][C]0.0205[/C][C]-0.0104[/C][C]0.008[/C][C]0.008[/C][C]4122.1027[/C][C]2877.2123[/C][C]53.6397[/C][C]-5.2314[/C][C]4.0248[/C][/ROW]
[ROW][C]114[/C][C]0.0241[/C][C]-0.0125[/C][C]0.0085[/C][C]0.0085[/C][C]5837.2895[/C][C]3206.1097[/C][C]56.6225[/C][C]-6.2254[/C][C]4.2693[/C][/ROW]
[ROW][C]115[/C][C]0.0278[/C][C]-0.0117[/C][C]0.0088[/C][C]0.0088[/C][C]5127.9149[/C][C]3398.2903[/C][C]58.2949[/C][C]-5.8348[/C][C]4.4259[/C][/ROW]
[ROW][C]116[/C][C]0.0318[/C][C]-0.0172[/C][C]0.0096[/C][C]0.0095[/C][C]11061.3562[/C][C]4094.9326[/C][C]63.9917[/C][C]-8.5697[/C][C]4.8026[/C][/ROW]
[ROW][C]117[/C][C]0.0359[/C][C]-0.0196[/C][C]0.0104[/C][C]0.0104[/C][C]14216.0869[/C][C]4938.3621[/C][C]70.2735[/C][C]-9.7151[/C][C]5.212[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301473&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301473&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0027-0.00130.00130.001368.542500-0.67460.6746
1070.0043-0.00390.00260.0026595.7675332.15518.2251-1.98881.3317
1080.0062-0.00670.0040.0041718.7055794.338528.184-3.3782.0138
1090.0085-0.0110.00580.00574593.69721744.178241.7634-5.52262.891
1100.0112-0.01050.00670.00674129.51312221.245247.1301-5.23613.36
1110.0141-0.01040.00730.00734077.12632530.558750.3047-5.20283.6671
1120.0172-0.00990.00770.00763712.24332699.370851.9555-4.96453.8525
1130.0205-0.01040.0080.0084122.10272877.212353.6397-5.23144.0248
1140.0241-0.01250.00850.00855837.28953206.109756.6225-6.22544.2693
1150.0278-0.01170.00880.00885127.91493398.290358.2949-5.83484.4259
1160.0318-0.01720.00960.009511061.35624094.932663.9917-8.56974.8026
1170.0359-0.01960.01040.010414216.08694938.362170.2735-9.71515.212



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 1 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 1 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '2'
par7 <- '1'
par6 <- '3'
par5 <- '1'
par4 <- '0'
par3 <- '2'
par2 <- '1'
par1 <- '12'
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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')