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 computationWed, 07 Dec 2016 13:31:06 +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/07/t1481113916wtu1r3fg05xxo01.htm/, Retrieved Tue, 07 May 2024 12:46:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=298054, Retrieved Tue, 07 May 2024 12:46:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-07 12:31:06] [cefbb908b49c27a772f794ee9c78d9df] [Current]
Feedback Forum

Post a new message
Dataseries X:
3055
2835
3245
3370
3665
3735
3100
3175
3350
3410
2880
3190
3495
3285
4200
3940
3530
3845
3400
3700
3090
3695
3305
2560
3060
2795
3180
3515
3445
3100
2840
3280
3330
3420
3085
3075
3585
3455
4450
4050
4690
3945
3070
3680
4195
4240
3650
4140
4165
4210
4955
4535
4750
5175
4110
4265
4150
4630
3620
3660
3705
4195
4205
4525
4365
4460
3650
3780
4410
4295
3785
4340
4340
3420
4175
3850
3875
4700
3900
4125
4050
4530
3545
3925
3910
3930
4520
4145
3815
4145
3475
3560
3310
3570
2975
2635
2965
3045
3335
3840
3860
3460
3000
3490
3265
3230
3145
3150
3260
3185
3515
3060
3470
3380
3195




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298054&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[103])
913475-------
923560-------
933310-------
943570-------
952975-------
962635-------
972965-------
983045-------
993335-------
1003840-------
1013860-------
1023460-------
1033000-------
10434903241.94082736.11283841.28180.20860.78560.14910.7856
10532653304.57532713.08164025.02370.45710.3070.49410.7963
10632303547.77212837.38714436.01330.24160.73370.48040.8866
10731453025.93042379.18043848.49120.38830.31340.54830.5246
10831503080.93322390.8513970.19710.43950.44390.83720.5708
10932603321.48742553.5274320.4080.4520.63170.75790.7359
11031853218.82642455.57494219.31470.47360.46790.63330.6659
11135153762.61852853.25854961.79990.34280.82740.75770.8937
11230603753.40162832.95734972.90350.13250.64920.44470.887
11334703784.2772845.80335032.23550.31080.87230.45270.891
11433803838.61552878.40065119.15150.24140.71370.71890.9004
11531953227.52092414.77554313.81350.47660.39160.65930.6593

\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[103]) \tabularnewline
91 & 3475 & - & - & - & - & - & - & - \tabularnewline
92 & 3560 & - & - & - & - & - & - & - \tabularnewline
93 & 3310 & - & - & - & - & - & - & - \tabularnewline
94 & 3570 & - & - & - & - & - & - & - \tabularnewline
95 & 2975 & - & - & - & - & - & - & - \tabularnewline
96 & 2635 & - & - & - & - & - & - & - \tabularnewline
97 & 2965 & - & - & - & - & - & - & - \tabularnewline
98 & 3045 & - & - & - & - & - & - & - \tabularnewline
99 & 3335 & - & - & - & - & - & - & - \tabularnewline
100 & 3840 & - & - & - & - & - & - & - \tabularnewline
101 & 3860 & - & - & - & - & - & - & - \tabularnewline
102 & 3460 & - & - & - & - & - & - & - \tabularnewline
103 & 3000 & - & - & - & - & - & - & - \tabularnewline
104 & 3490 & 3241.9408 & 2736.1128 & 3841.2818 & 0.2086 & 0.7856 & 0.1491 & 0.7856 \tabularnewline
105 & 3265 & 3304.5753 & 2713.0816 & 4025.0237 & 0.4571 & 0.307 & 0.4941 & 0.7963 \tabularnewline
106 & 3230 & 3547.7721 & 2837.3871 & 4436.0133 & 0.2416 & 0.7337 & 0.4804 & 0.8866 \tabularnewline
107 & 3145 & 3025.9304 & 2379.1804 & 3848.4912 & 0.3883 & 0.3134 & 0.5483 & 0.5246 \tabularnewline
108 & 3150 & 3080.9332 & 2390.851 & 3970.1971 & 0.4395 & 0.4439 & 0.8372 & 0.5708 \tabularnewline
109 & 3260 & 3321.4874 & 2553.527 & 4320.408 & 0.452 & 0.6317 & 0.7579 & 0.7359 \tabularnewline
110 & 3185 & 3218.8264 & 2455.5749 & 4219.3147 & 0.4736 & 0.4679 & 0.6333 & 0.6659 \tabularnewline
111 & 3515 & 3762.6185 & 2853.2585 & 4961.7999 & 0.3428 & 0.8274 & 0.7577 & 0.8937 \tabularnewline
112 & 3060 & 3753.4016 & 2832.9573 & 4972.9035 & 0.1325 & 0.6492 & 0.4447 & 0.887 \tabularnewline
113 & 3470 & 3784.277 & 2845.8033 & 5032.2355 & 0.3108 & 0.8723 & 0.4527 & 0.891 \tabularnewline
114 & 3380 & 3838.6155 & 2878.4006 & 5119.1515 & 0.2414 & 0.7137 & 0.7189 & 0.9004 \tabularnewline
115 & 3195 & 3227.5209 & 2414.7755 & 4313.8135 & 0.4766 & 0.3916 & 0.6593 & 0.6593 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298054&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[103])[/C][/ROW]
[ROW][C]91[/C][C]3475[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]3560[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]3310[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3570[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2975[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2635[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2965[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]3045[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]3335[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]3840[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]3860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]3460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]3000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]3490[/C][C]3241.9408[/C][C]2736.1128[/C][C]3841.2818[/C][C]0.2086[/C][C]0.7856[/C][C]0.1491[/C][C]0.7856[/C][/ROW]
[ROW][C]105[/C][C]3265[/C][C]3304.5753[/C][C]2713.0816[/C][C]4025.0237[/C][C]0.4571[/C][C]0.307[/C][C]0.4941[/C][C]0.7963[/C][/ROW]
[ROW][C]106[/C][C]3230[/C][C]3547.7721[/C][C]2837.3871[/C][C]4436.0133[/C][C]0.2416[/C][C]0.7337[/C][C]0.4804[/C][C]0.8866[/C][/ROW]
[ROW][C]107[/C][C]3145[/C][C]3025.9304[/C][C]2379.1804[/C][C]3848.4912[/C][C]0.3883[/C][C]0.3134[/C][C]0.5483[/C][C]0.5246[/C][/ROW]
[ROW][C]108[/C][C]3150[/C][C]3080.9332[/C][C]2390.851[/C][C]3970.1971[/C][C]0.4395[/C][C]0.4439[/C][C]0.8372[/C][C]0.5708[/C][/ROW]
[ROW][C]109[/C][C]3260[/C][C]3321.4874[/C][C]2553.527[/C][C]4320.408[/C][C]0.452[/C][C]0.6317[/C][C]0.7579[/C][C]0.7359[/C][/ROW]
[ROW][C]110[/C][C]3185[/C][C]3218.8264[/C][C]2455.5749[/C][C]4219.3147[/C][C]0.4736[/C][C]0.4679[/C][C]0.6333[/C][C]0.6659[/C][/ROW]
[ROW][C]111[/C][C]3515[/C][C]3762.6185[/C][C]2853.2585[/C][C]4961.7999[/C][C]0.3428[/C][C]0.8274[/C][C]0.7577[/C][C]0.8937[/C][/ROW]
[ROW][C]112[/C][C]3060[/C][C]3753.4016[/C][C]2832.9573[/C][C]4972.9035[/C][C]0.1325[/C][C]0.6492[/C][C]0.4447[/C][C]0.887[/C][/ROW]
[ROW][C]113[/C][C]3470[/C][C]3784.277[/C][C]2845.8033[/C][C]5032.2355[/C][C]0.3108[/C][C]0.8723[/C][C]0.4527[/C][C]0.891[/C][/ROW]
[ROW][C]114[/C][C]3380[/C][C]3838.6155[/C][C]2878.4006[/C][C]5119.1515[/C][C]0.2414[/C][C]0.7137[/C][C]0.7189[/C][C]0.9004[/C][/ROW]
[ROW][C]115[/C][C]3195[/C][C]3227.5209[/C][C]2414.7755[/C][C]4313.8135[/C][C]0.4766[/C][C]0.3916[/C][C]0.6593[/C][C]0.6593[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298054&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298054&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[103])
913475-------
923560-------
933310-------
943570-------
952975-------
962635-------
972965-------
983045-------
993335-------
1003840-------
1013860-------
1023460-------
1033000-------
10434903241.94082736.11283841.28180.20860.78560.14910.7856
10532653304.57532713.08164025.02370.45710.3070.49410.7963
10632303547.77212837.38714436.01330.24160.73370.48040.8866
10731453025.93042379.18043848.49120.38830.31340.54830.5246
10831503080.93322390.8513970.19710.43950.44390.83720.5708
10932603321.48742553.5274320.4080.4520.63170.75790.7359
11031853218.82642455.57494219.31470.47360.46790.63330.6659
11135153762.61852853.25854961.79990.34280.82740.75770.8937
11230603753.40162832.95734972.90350.13250.64920.44470.887
11334703784.2772845.80335032.23550.31080.87230.45270.891
11433803838.61552878.40065119.15150.24140.71370.71890.9004
11531953227.52092414.77554313.81350.47660.39160.65930.6593







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.09430.07110.07110.073761533.3734001.36091.3609
1050.1112-0.01210.04160.04291566.204331549.7889177.6226-0.21710.789
1060.1277-0.09840.06050.0598100979.117954692.8986233.8651-1.74341.1071
1070.13870.03790.05490.054514177.570944564.0666211.1020.65320.9937
1080.14730.02190.04830.04814770.217636605.2968191.32510.37890.8707
1090.1534-0.01890.04340.04323780.704831134.5315176.4498-0.33730.7818
1100.1586-0.01060.03870.03851144.223726850.2018163.8603-0.18560.6966
1110.1626-0.07040.04270.042261314.909431158.2903176.5171-1.35850.7794
1120.1658-0.22660.06310.0601480805.765781119.1209284.8142-3.80421.1155
1130.1683-0.09060.06580.062898770.017782884.2105287.8962-1.72421.1763
1140.1702-0.13570.07220.0686210328.146194470.0229307.3598-2.51611.2981
1150.1717-0.01020.0670.06371057.606786685.6548294.4243-0.17841.2048

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
104 & 0.0943 & 0.0711 & 0.0711 & 0.0737 & 61533.3734 & 0 & 0 & 1.3609 & 1.3609 \tabularnewline
105 & 0.1112 & -0.0121 & 0.0416 & 0.0429 & 1566.2043 & 31549.7889 & 177.6226 & -0.2171 & 0.789 \tabularnewline
106 & 0.1277 & -0.0984 & 0.0605 & 0.0598 & 100979.1179 & 54692.8986 & 233.8651 & -1.7434 & 1.1071 \tabularnewline
107 & 0.1387 & 0.0379 & 0.0549 & 0.0545 & 14177.5709 & 44564.0666 & 211.102 & 0.6532 & 0.9937 \tabularnewline
108 & 0.1473 & 0.0219 & 0.0483 & 0.0481 & 4770.2176 & 36605.2968 & 191.3251 & 0.3789 & 0.8707 \tabularnewline
109 & 0.1534 & -0.0189 & 0.0434 & 0.0432 & 3780.7048 & 31134.5315 & 176.4498 & -0.3373 & 0.7818 \tabularnewline
110 & 0.1586 & -0.0106 & 0.0387 & 0.0385 & 1144.2237 & 26850.2018 & 163.8603 & -0.1856 & 0.6966 \tabularnewline
111 & 0.1626 & -0.0704 & 0.0427 & 0.0422 & 61314.9094 & 31158.2903 & 176.5171 & -1.3585 & 0.7794 \tabularnewline
112 & 0.1658 & -0.2266 & 0.0631 & 0.0601 & 480805.7657 & 81119.1209 & 284.8142 & -3.8042 & 1.1155 \tabularnewline
113 & 0.1683 & -0.0906 & 0.0658 & 0.0628 & 98770.0177 & 82884.2105 & 287.8962 & -1.7242 & 1.1763 \tabularnewline
114 & 0.1702 & -0.1357 & 0.0722 & 0.0686 & 210328.1461 & 94470.0229 & 307.3598 & -2.5161 & 1.2981 \tabularnewline
115 & 0.1717 & -0.0102 & 0.067 & 0.0637 & 1057.6067 & 86685.6548 & 294.4243 & -0.1784 & 1.2048 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298054&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]104[/C][C]0.0943[/C][C]0.0711[/C][C]0.0711[/C][C]0.0737[/C][C]61533.3734[/C][C]0[/C][C]0[/C][C]1.3609[/C][C]1.3609[/C][/ROW]
[ROW][C]105[/C][C]0.1112[/C][C]-0.0121[/C][C]0.0416[/C][C]0.0429[/C][C]1566.2043[/C][C]31549.7889[/C][C]177.6226[/C][C]-0.2171[/C][C]0.789[/C][/ROW]
[ROW][C]106[/C][C]0.1277[/C][C]-0.0984[/C][C]0.0605[/C][C]0.0598[/C][C]100979.1179[/C][C]54692.8986[/C][C]233.8651[/C][C]-1.7434[/C][C]1.1071[/C][/ROW]
[ROW][C]107[/C][C]0.1387[/C][C]0.0379[/C][C]0.0549[/C][C]0.0545[/C][C]14177.5709[/C][C]44564.0666[/C][C]211.102[/C][C]0.6532[/C][C]0.9937[/C][/ROW]
[ROW][C]108[/C][C]0.1473[/C][C]0.0219[/C][C]0.0483[/C][C]0.0481[/C][C]4770.2176[/C][C]36605.2968[/C][C]191.3251[/C][C]0.3789[/C][C]0.8707[/C][/ROW]
[ROW][C]109[/C][C]0.1534[/C][C]-0.0189[/C][C]0.0434[/C][C]0.0432[/C][C]3780.7048[/C][C]31134.5315[/C][C]176.4498[/C][C]-0.3373[/C][C]0.7818[/C][/ROW]
[ROW][C]110[/C][C]0.1586[/C][C]-0.0106[/C][C]0.0387[/C][C]0.0385[/C][C]1144.2237[/C][C]26850.2018[/C][C]163.8603[/C][C]-0.1856[/C][C]0.6966[/C][/ROW]
[ROW][C]111[/C][C]0.1626[/C][C]-0.0704[/C][C]0.0427[/C][C]0.0422[/C][C]61314.9094[/C][C]31158.2903[/C][C]176.5171[/C][C]-1.3585[/C][C]0.7794[/C][/ROW]
[ROW][C]112[/C][C]0.1658[/C][C]-0.2266[/C][C]0.0631[/C][C]0.0601[/C][C]480805.7657[/C][C]81119.1209[/C][C]284.8142[/C][C]-3.8042[/C][C]1.1155[/C][/ROW]
[ROW][C]113[/C][C]0.1683[/C][C]-0.0906[/C][C]0.0658[/C][C]0.0628[/C][C]98770.0177[/C][C]82884.2105[/C][C]287.8962[/C][C]-1.7242[/C][C]1.1763[/C][/ROW]
[ROW][C]114[/C][C]0.1702[/C][C]-0.1357[/C][C]0.0722[/C][C]0.0686[/C][C]210328.1461[/C][C]94470.0229[/C][C]307.3598[/C][C]-2.5161[/C][C]1.2981[/C][/ROW]
[ROW][C]115[/C][C]0.1717[/C][C]-0.0102[/C][C]0.067[/C][C]0.0637[/C][C]1057.6067[/C][C]86685.6548[/C][C]294.4243[/C][C]-0.1784[/C][C]1.2048[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298054&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298054&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
1040.09430.07110.07110.073761533.3734001.36091.3609
1050.1112-0.01210.04160.04291566.204331549.7889177.6226-0.21710.789
1060.1277-0.09840.06050.0598100979.117954692.8986233.8651-1.74341.1071
1070.13870.03790.05490.054514177.570944564.0666211.1020.65320.9937
1080.14730.02190.04830.04814770.217636605.2968191.32510.37890.8707
1090.1534-0.01890.04340.04323780.704831134.5315176.4498-0.33730.7818
1100.1586-0.01060.03870.03851144.223726850.2018163.8603-0.18560.6966
1110.1626-0.07040.04270.042261314.909431158.2903176.5171-1.35850.7794
1120.1658-0.22660.06310.0601480805.765781119.1209284.8142-3.80421.1155
1130.1683-0.09060.06580.062898770.017782884.2105287.8962-1.72421.1763
1140.1702-0.13570.07220.0686210328.146194470.0229307.3598-2.51611.2981
1150.1717-0.01020.0670.06371057.606786685.6548294.4243-0.17841.2048



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