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, 17 Dec 2016 22:13:05 +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/17/t1482009220rr54u5dyo4qjy9c.htm/, Retrieved Thu, 02 May 2024 02:50:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300958, Retrieved Thu, 02 May 2024 02:50:58 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact72
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting] [2016-12-17 21:13:05] [f20c721eaecf28dbff8d9b9768e8b0c7] [Current]
Feedback Forum

Post a new message
Dataseries X:
3904.45
4137.2
4334.5
4188.6
4304.1
4570.45
4178.85
4515.15
4740.55
4582.2
4493.6
4437
4294
4581.35
4780.15
4632
4648.2
4834.85
4465.25
4671.65
4871.3
4707.8
4580.45
4562.25
4329.7
4646.1
4844.1
4623
4707.2
4844.9
4436.75
4680.85
4873.8
4735.15
4681.9
4607
4436.4
4614.1
4619.25
4507.1
4515.85
4725.4
4250.85
4591.6
4898.15
4675.45
4568.95
4531.05
4387.35
4826.1
4954.35
4814.85
4821.55
5148.05
4810.75
4988.05
5322.65
5157
5006.65
4910.2
4764.05
5093.7
5312.2
5157.6
5192.4
5546.6
5092.05
5423.25
5647.2
5450.05
5360.3
5309.25
5181
5488.6
5668.15
5560.8
5590.45
5850.7
5252.2
5626.1
5819.8
5676.35
5525.5
5359.55
5296.85
5623.75
5899.3
5672.6
5724.75
5995.1
5475.2
6143.95
6366.95
6306.1
6077
5672.4
5458.6
5716.9
5828.1
5706.85
5888.3
6007.7
5581.85
5970.95
6190.4
6079.15
5902.2
5554.4
5320.45
5683.1
5987.9
5843.7
5917.5
6299.45
5846.75
5998.1




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=300958&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=300958&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300958&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[104])
1035581.85-------
1045970.95-------
1056190.46034.38475628.21156440.55790.22580.62020.62020.6202
1066079.155898.20175439.84326356.56020.21950.10570.10570.3779
1075902.25955.74315494.30226417.18390.410.30010.30010.4742
1085554.45979.03225500.55846457.5060.0410.62350.62350.5132
1095320.455989.14555494.53816483.75290.0040.95750.95750.5287
1105683.16007.39445498.83636515.95250.10570.99590.99590.5559
1115987.96024.78665501.78286547.79040.4450.89980.89980.5799
1125843.76041.44995504.11336578.78640.23540.57740.57740.6015
1135917.56058.43725506.99256609.88190.30820.77730.77730.6221
1146299.456075.41525509.96696640.86350.21870.70790.70790.6414
1155846.756092.35675513.01816671.69520.2030.24180.24180.6594
1165998.16109.31035516.19416702.42640.35660.80720.80720.6762

\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[104]) \tabularnewline
103 & 5581.85 & - & - & - & - & - & - & - \tabularnewline
104 & 5970.95 & - & - & - & - & - & - & - \tabularnewline
105 & 6190.4 & 6034.3847 & 5628.2115 & 6440.5579 & 0.2258 & 0.6202 & 0.6202 & 0.6202 \tabularnewline
106 & 6079.15 & 5898.2017 & 5439.8432 & 6356.5602 & 0.2195 & 0.1057 & 0.1057 & 0.3779 \tabularnewline
107 & 5902.2 & 5955.7431 & 5494.3022 & 6417.1839 & 0.41 & 0.3001 & 0.3001 & 0.4742 \tabularnewline
108 & 5554.4 & 5979.0322 & 5500.5584 & 6457.506 & 0.041 & 0.6235 & 0.6235 & 0.5132 \tabularnewline
109 & 5320.45 & 5989.1455 & 5494.5381 & 6483.7529 & 0.004 & 0.9575 & 0.9575 & 0.5287 \tabularnewline
110 & 5683.1 & 6007.3944 & 5498.8363 & 6515.9525 & 0.1057 & 0.9959 & 0.9959 & 0.5559 \tabularnewline
111 & 5987.9 & 6024.7866 & 5501.7828 & 6547.7904 & 0.445 & 0.8998 & 0.8998 & 0.5799 \tabularnewline
112 & 5843.7 & 6041.4499 & 5504.1133 & 6578.7864 & 0.2354 & 0.5774 & 0.5774 & 0.6015 \tabularnewline
113 & 5917.5 & 6058.4372 & 5506.9925 & 6609.8819 & 0.3082 & 0.7773 & 0.7773 & 0.6221 \tabularnewline
114 & 6299.45 & 6075.4152 & 5509.9669 & 6640.8635 & 0.2187 & 0.7079 & 0.7079 & 0.6414 \tabularnewline
115 & 5846.75 & 6092.3567 & 5513.0181 & 6671.6952 & 0.203 & 0.2418 & 0.2418 & 0.6594 \tabularnewline
116 & 5998.1 & 6109.3103 & 5516.1941 & 6702.4264 & 0.3566 & 0.8072 & 0.8072 & 0.6762 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300958&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[104])[/C][/ROW]
[ROW][C]103[/C][C]5581.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5970.95[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6190.4[/C][C]6034.3847[/C][C]5628.2115[/C][C]6440.5579[/C][C]0.2258[/C][C]0.6202[/C][C]0.6202[/C][C]0.6202[/C][/ROW]
[ROW][C]106[/C][C]6079.15[/C][C]5898.2017[/C][C]5439.8432[/C][C]6356.5602[/C][C]0.2195[/C][C]0.1057[/C][C]0.1057[/C][C]0.3779[/C][/ROW]
[ROW][C]107[/C][C]5902.2[/C][C]5955.7431[/C][C]5494.3022[/C][C]6417.1839[/C][C]0.41[/C][C]0.3001[/C][C]0.3001[/C][C]0.4742[/C][/ROW]
[ROW][C]108[/C][C]5554.4[/C][C]5979.0322[/C][C]5500.5584[/C][C]6457.506[/C][C]0.041[/C][C]0.6235[/C][C]0.6235[/C][C]0.5132[/C][/ROW]
[ROW][C]109[/C][C]5320.45[/C][C]5989.1455[/C][C]5494.5381[/C][C]6483.7529[/C][C]0.004[/C][C]0.9575[/C][C]0.9575[/C][C]0.5287[/C][/ROW]
[ROW][C]110[/C][C]5683.1[/C][C]6007.3944[/C][C]5498.8363[/C][C]6515.9525[/C][C]0.1057[/C][C]0.9959[/C][C]0.9959[/C][C]0.5559[/C][/ROW]
[ROW][C]111[/C][C]5987.9[/C][C]6024.7866[/C][C]5501.7828[/C][C]6547.7904[/C][C]0.445[/C][C]0.8998[/C][C]0.8998[/C][C]0.5799[/C][/ROW]
[ROW][C]112[/C][C]5843.7[/C][C]6041.4499[/C][C]5504.1133[/C][C]6578.7864[/C][C]0.2354[/C][C]0.5774[/C][C]0.5774[/C][C]0.6015[/C][/ROW]
[ROW][C]113[/C][C]5917.5[/C][C]6058.4372[/C][C]5506.9925[/C][C]6609.8819[/C][C]0.3082[/C][C]0.7773[/C][C]0.7773[/C][C]0.6221[/C][/ROW]
[ROW][C]114[/C][C]6299.45[/C][C]6075.4152[/C][C]5509.9669[/C][C]6640.8635[/C][C]0.2187[/C][C]0.7079[/C][C]0.7079[/C][C]0.6414[/C][/ROW]
[ROW][C]115[/C][C]5846.75[/C][C]6092.3567[/C][C]5513.0181[/C][C]6671.6952[/C][C]0.203[/C][C]0.2418[/C][C]0.2418[/C][C]0.6594[/C][/ROW]
[ROW][C]116[/C][C]5998.1[/C][C]6109.3103[/C][C]5516.1941[/C][C]6702.4264[/C][C]0.3566[/C][C]0.8072[/C][C]0.8072[/C][C]0.6762[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300958&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300958&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[104])
1035581.85-------
1045970.95-------
1056190.46034.38475628.21156440.55790.22580.62020.62020.6202
1066079.155898.20175439.84326356.56020.21950.10570.10570.3779
1075902.25955.74315494.30226417.18390.410.30010.30010.4742
1085554.45979.03225500.55846457.5060.0410.62350.62350.5132
1095320.455989.14555494.53816483.75290.0040.95750.95750.5287
1105683.16007.39445498.83636515.95250.10570.99590.99590.5559
1115987.96024.78665501.78286547.79040.4450.89980.89980.5799
1125843.76041.44995504.11336578.78640.23540.57740.57740.6015
1135917.56058.43725506.99256609.88190.30820.77730.77730.6221
1146299.456075.41525509.96696640.86350.21870.70790.70790.6414
1155846.756092.35675513.01816671.69520.2030.24180.24180.6594
1165998.16109.31035516.19416702.42640.35660.80720.80720.6762







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.03430.02520.02520.025524340.7704000.6260.626
1060.03960.02980.02750.027932742.287228541.5288168.94240.72610.676
1070.0395-0.00910.02130.02162866.859919983.3058141.3623-0.21480.5223
1080.0408-0.07640.03510.0346180312.51660065.6084245.0829-1.70390.8177
1090.0421-0.12570.05320.0513447153.667137483.2201370.7873-2.68321.1908
1100.0432-0.05710.05390.052105166.8459132097.1577363.4517-1.30121.2092
1110.0443-0.00620.04710.04551360.6225113420.5099336.7796-0.1481.0576
1120.0454-0.03380.04540.043939105.0154104131.073322.6935-0.79351.0246
1130.0464-0.02380.0430.041719863.295994767.9867307.8441-0.56550.9736
1140.04750.03560.04230.041150191.596690310.3477300.51680.8990.9661
1150.0485-0.0420.04220.041160322.628787584.1914295.9463-0.98550.9679
1160.0495-0.01850.04030.039212367.726181316.1526285.1599-0.44620.9244

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.0343 & 0.0252 & 0.0252 & 0.0255 & 24340.7704 & 0 & 0 & 0.626 & 0.626 \tabularnewline
106 & 0.0396 & 0.0298 & 0.0275 & 0.0279 & 32742.2872 & 28541.5288 & 168.9424 & 0.7261 & 0.676 \tabularnewline
107 & 0.0395 & -0.0091 & 0.0213 & 0.0216 & 2866.8599 & 19983.3058 & 141.3623 & -0.2148 & 0.5223 \tabularnewline
108 & 0.0408 & -0.0764 & 0.0351 & 0.0346 & 180312.516 & 60065.6084 & 245.0829 & -1.7039 & 0.8177 \tabularnewline
109 & 0.0421 & -0.1257 & 0.0532 & 0.0513 & 447153.667 & 137483.2201 & 370.7873 & -2.6832 & 1.1908 \tabularnewline
110 & 0.0432 & -0.0571 & 0.0539 & 0.052 & 105166.8459 & 132097.1577 & 363.4517 & -1.3012 & 1.2092 \tabularnewline
111 & 0.0443 & -0.0062 & 0.0471 & 0.0455 & 1360.6225 & 113420.5099 & 336.7796 & -0.148 & 1.0576 \tabularnewline
112 & 0.0454 & -0.0338 & 0.0454 & 0.0439 & 39105.0154 & 104131.073 & 322.6935 & -0.7935 & 1.0246 \tabularnewline
113 & 0.0464 & -0.0238 & 0.043 & 0.0417 & 19863.2959 & 94767.9867 & 307.8441 & -0.5655 & 0.9736 \tabularnewline
114 & 0.0475 & 0.0356 & 0.0423 & 0.0411 & 50191.5966 & 90310.3477 & 300.5168 & 0.899 & 0.9661 \tabularnewline
115 & 0.0485 & -0.042 & 0.0422 & 0.0411 & 60322.6287 & 87584.1914 & 295.9463 & -0.9855 & 0.9679 \tabularnewline
116 & 0.0495 & -0.0185 & 0.0403 & 0.0392 & 12367.7261 & 81316.1526 & 285.1599 & -0.4462 & 0.9244 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300958&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]105[/C][C]0.0343[/C][C]0.0252[/C][C]0.0252[/C][C]0.0255[/C][C]24340.7704[/C][C]0[/C][C]0[/C][C]0.626[/C][C]0.626[/C][/ROW]
[ROW][C]106[/C][C]0.0396[/C][C]0.0298[/C][C]0.0275[/C][C]0.0279[/C][C]32742.2872[/C][C]28541.5288[/C][C]168.9424[/C][C]0.7261[/C][C]0.676[/C][/ROW]
[ROW][C]107[/C][C]0.0395[/C][C]-0.0091[/C][C]0.0213[/C][C]0.0216[/C][C]2866.8599[/C][C]19983.3058[/C][C]141.3623[/C][C]-0.2148[/C][C]0.5223[/C][/ROW]
[ROW][C]108[/C][C]0.0408[/C][C]-0.0764[/C][C]0.0351[/C][C]0.0346[/C][C]180312.516[/C][C]60065.6084[/C][C]245.0829[/C][C]-1.7039[/C][C]0.8177[/C][/ROW]
[ROW][C]109[/C][C]0.0421[/C][C]-0.1257[/C][C]0.0532[/C][C]0.0513[/C][C]447153.667[/C][C]137483.2201[/C][C]370.7873[/C][C]-2.6832[/C][C]1.1908[/C][/ROW]
[ROW][C]110[/C][C]0.0432[/C][C]-0.0571[/C][C]0.0539[/C][C]0.052[/C][C]105166.8459[/C][C]132097.1577[/C][C]363.4517[/C][C]-1.3012[/C][C]1.2092[/C][/ROW]
[ROW][C]111[/C][C]0.0443[/C][C]-0.0062[/C][C]0.0471[/C][C]0.0455[/C][C]1360.6225[/C][C]113420.5099[/C][C]336.7796[/C][C]-0.148[/C][C]1.0576[/C][/ROW]
[ROW][C]112[/C][C]0.0454[/C][C]-0.0338[/C][C]0.0454[/C][C]0.0439[/C][C]39105.0154[/C][C]104131.073[/C][C]322.6935[/C][C]-0.7935[/C][C]1.0246[/C][/ROW]
[ROW][C]113[/C][C]0.0464[/C][C]-0.0238[/C][C]0.043[/C][C]0.0417[/C][C]19863.2959[/C][C]94767.9867[/C][C]307.8441[/C][C]-0.5655[/C][C]0.9736[/C][/ROW]
[ROW][C]114[/C][C]0.0475[/C][C]0.0356[/C][C]0.0423[/C][C]0.0411[/C][C]50191.5966[/C][C]90310.3477[/C][C]300.5168[/C][C]0.899[/C][C]0.9661[/C][/ROW]
[ROW][C]115[/C][C]0.0485[/C][C]-0.042[/C][C]0.0422[/C][C]0.0411[/C][C]60322.6287[/C][C]87584.1914[/C][C]295.9463[/C][C]-0.9855[/C][C]0.9679[/C][/ROW]
[ROW][C]116[/C][C]0.0495[/C][C]-0.0185[/C][C]0.0403[/C][C]0.0392[/C][C]12367.7261[/C][C]81316.1526[/C][C]285.1599[/C][C]-0.4462[/C][C]0.9244[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300958&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300958&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
1050.03430.02520.02520.025524340.7704000.6260.626
1060.03960.02980.02750.027932742.287228541.5288168.94240.72610.676
1070.0395-0.00910.02130.02162866.859919983.3058141.3623-0.21480.5223
1080.0408-0.07640.03510.0346180312.51660065.6084245.0829-1.70390.8177
1090.0421-0.12570.05320.0513447153.667137483.2201370.7873-2.68321.1908
1100.0432-0.05710.05390.052105166.8459132097.1577363.4517-1.30121.2092
1110.0443-0.00620.04710.04551360.6225113420.5099336.7796-0.1481.0576
1120.0454-0.03380.04540.043939105.0154104131.073322.6935-0.79351.0246
1130.0464-0.02380.0430.041719863.295994767.9867307.8441-0.56550.9736
1140.04750.03560.04230.041150191.596690310.3477300.51680.8990.9661
1150.0485-0.0420.04220.041160322.628787584.1914295.9463-0.98550.9679
1160.0495-0.01850.04030.039212367.726181316.1526285.1599-0.44620.9244



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