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, 21 Dec 2016 18:50:29 +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/21/t14823428126zx8drhbm8zxqut.htm/, Retrieved Tue, 07 May 2024 03:38:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302449, Retrieved Tue, 07 May 2024 03:38:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact76
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper N2163] [2016-12-21 17:50:29] [3146b6c9a81fba6ba78c11f749c05198] [Current]
Feedback Forum

Post a new message
Dataseries X:
3875
3755
4670
4335
4945
4600
4395
4345
4390
4490
4395
4690
4590
4630
5375
4655
4975
4810
4445
4660
4215
4825
4250
3945
4390
4315
4835
4835
4970
4690
4700
4855
4610
4900
4250
4105
4740
4565
5155
5320
5430
4690
4540
4575
4660
4850
4200
4360
4655
4585
5315
5115
5100
5735
5260
5050
5165
5190
4720
5275
4605
4825
5595
5160
5320
5540
4970
5445
5305
5145
4895
4555
4980
4930
5810
5210
5450
5510
5010
5495
5125
5190
4565
4255
4875
4650
5295
5045
5430
5325
4920
5445
4895
5175
4545
4220
4595
4360
4750
4985
5140
4995
5150
5240
4875
5170
4715
4370
5160
4930
5600
5385
5425
5375
5365




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302449&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])
1024995-------
1035150-------
10452405079.36614376.68455782.04770.32710.42190.42190.4219
10548755081.56914285.64695877.49130.30550.34820.34820.4331
10651705076.20754180.10225972.31280.41870.67010.67010.4359
10747155070.85164084.876056.83320.23970.42190.42190.4375
10843705065.50143997.3456133.65770.10090.73990.73990.4384
10951605060.15673915.86656204.4470.43210.88140.88140.4388
11049305054.81783839.29856270.33710.42020.43270.43270.439
11156005049.48443766.82336332.14560.20010.57240.57240.439
11253855044.15673697.8296390.48450.30990.20920.20920.4388
11354255038.83463631.84356445.82580.29530.31480.31480.4385
11453755033.51813568.49346498.54290.32390.30020.30020.4381
11553655028.20733507.47746548.93720.33210.32740.32740.4376

\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
102 & 4995 & - & - & - & - & - & - & - \tabularnewline
103 & 5150 & - & - & - & - & - & - & - \tabularnewline
104 & 5240 & 5079.3661 & 4376.6845 & 5782.0477 & 0.3271 & 0.4219 & 0.4219 & 0.4219 \tabularnewline
105 & 4875 & 5081.5691 & 4285.6469 & 5877.4913 & 0.3055 & 0.3482 & 0.3482 & 0.4331 \tabularnewline
106 & 5170 & 5076.2075 & 4180.1022 & 5972.3128 & 0.4187 & 0.6701 & 0.6701 & 0.4359 \tabularnewline
107 & 4715 & 5070.8516 & 4084.87 & 6056.8332 & 0.2397 & 0.4219 & 0.4219 & 0.4375 \tabularnewline
108 & 4370 & 5065.5014 & 3997.345 & 6133.6577 & 0.1009 & 0.7399 & 0.7399 & 0.4384 \tabularnewline
109 & 5160 & 5060.1567 & 3915.8665 & 6204.447 & 0.4321 & 0.8814 & 0.8814 & 0.4388 \tabularnewline
110 & 4930 & 5054.8178 & 3839.2985 & 6270.3371 & 0.4202 & 0.4327 & 0.4327 & 0.439 \tabularnewline
111 & 5600 & 5049.4844 & 3766.8233 & 6332.1456 & 0.2001 & 0.5724 & 0.5724 & 0.439 \tabularnewline
112 & 5385 & 5044.1567 & 3697.829 & 6390.4845 & 0.3099 & 0.2092 & 0.2092 & 0.4388 \tabularnewline
113 & 5425 & 5038.8346 & 3631.8435 & 6445.8258 & 0.2953 & 0.3148 & 0.3148 & 0.4385 \tabularnewline
114 & 5375 & 5033.5181 & 3568.4934 & 6498.5429 & 0.3239 & 0.3002 & 0.3002 & 0.4381 \tabularnewline
115 & 5365 & 5028.2073 & 3507.4774 & 6548.9372 & 0.3321 & 0.3274 & 0.3274 & 0.4376 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302449&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]102[/C][C]4995[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5240[/C][C]5079.3661[/C][C]4376.6845[/C][C]5782.0477[/C][C]0.3271[/C][C]0.4219[/C][C]0.4219[/C][C]0.4219[/C][/ROW]
[ROW][C]105[/C][C]4875[/C][C]5081.5691[/C][C]4285.6469[/C][C]5877.4913[/C][C]0.3055[/C][C]0.3482[/C][C]0.3482[/C][C]0.4331[/C][/ROW]
[ROW][C]106[/C][C]5170[/C][C]5076.2075[/C][C]4180.1022[/C][C]5972.3128[/C][C]0.4187[/C][C]0.6701[/C][C]0.6701[/C][C]0.4359[/C][/ROW]
[ROW][C]107[/C][C]4715[/C][C]5070.8516[/C][C]4084.87[/C][C]6056.8332[/C][C]0.2397[/C][C]0.4219[/C][C]0.4219[/C][C]0.4375[/C][/ROW]
[ROW][C]108[/C][C]4370[/C][C]5065.5014[/C][C]3997.345[/C][C]6133.6577[/C][C]0.1009[/C][C]0.7399[/C][C]0.7399[/C][C]0.4384[/C][/ROW]
[ROW][C]109[/C][C]5160[/C][C]5060.1567[/C][C]3915.8665[/C][C]6204.447[/C][C]0.4321[/C][C]0.8814[/C][C]0.8814[/C][C]0.4388[/C][/ROW]
[ROW][C]110[/C][C]4930[/C][C]5054.8178[/C][C]3839.2985[/C][C]6270.3371[/C][C]0.4202[/C][C]0.4327[/C][C]0.4327[/C][C]0.439[/C][/ROW]
[ROW][C]111[/C][C]5600[/C][C]5049.4844[/C][C]3766.8233[/C][C]6332.1456[/C][C]0.2001[/C][C]0.5724[/C][C]0.5724[/C][C]0.439[/C][/ROW]
[ROW][C]112[/C][C]5385[/C][C]5044.1567[/C][C]3697.829[/C][C]6390.4845[/C][C]0.3099[/C][C]0.2092[/C][C]0.2092[/C][C]0.4388[/C][/ROW]
[ROW][C]113[/C][C]5425[/C][C]5038.8346[/C][C]3631.8435[/C][C]6445.8258[/C][C]0.2953[/C][C]0.3148[/C][C]0.3148[/C][C]0.4385[/C][/ROW]
[ROW][C]114[/C][C]5375[/C][C]5033.5181[/C][C]3568.4934[/C][C]6498.5429[/C][C]0.3239[/C][C]0.3002[/C][C]0.3002[/C][C]0.4381[/C][/ROW]
[ROW][C]115[/C][C]5365[/C][C]5028.2073[/C][C]3507.4774[/C][C]6548.9372[/C][C]0.3321[/C][C]0.3274[/C][C]0.3274[/C][C]0.4376[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302449&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302449&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])
1024995-------
1035150-------
10452405079.36614376.68455782.04770.32710.42190.42190.4219
10548755081.56914285.64695877.49130.30550.34820.34820.4331
10651705076.20754180.10225972.31280.41870.67010.67010.4359
10747155070.85164084.876056.83320.23970.42190.42190.4375
10843705065.50143997.3456133.65770.10090.73990.73990.4384
10951605060.15673915.86656204.4470.43210.88140.88140.4388
11049305054.81783839.29856270.33710.42020.43270.43270.439
11156005049.48443766.82336332.14560.20010.57240.57240.439
11253855044.15673697.8296390.48450.30990.20920.20920.4388
11354255038.83463631.84356445.82580.29530.31480.31480.4385
11453755033.51813568.49346498.54290.32390.30020.30020.4381
11553655028.20733507.47746548.93720.33210.32740.32740.4376







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.07060.03070.03070.031125803.247000.50990.5099
1050.0799-0.04240.03650.036342670.789834237.0184185.0325-0.65580.5829
1060.09010.01810.03040.03038797.028225757.0217160.48990.29780.4878
1070.0992-0.07550.04170.0409126630.372850975.3595225.7772-1.12970.6483
1080.1076-0.15920.06520.0622483722.1388137524.7153370.8432-2.20790.9602
1090.11540.01930.05750.05519968.6756116265.3754340.97710.3170.853
1100.1227-0.02530.05290.050815579.4758101881.6755319.1891-0.39620.7878
1110.12960.09830.05860.0574303067.3935127029.8902356.41251.74770.9077
1120.13620.06330.05910.0583116174.1446125823.6963354.71641.0820.9271
1130.14250.07120.06030.0598149123.6984128153.6965357.98561.22590.957
1140.14850.06350.06060.0603116609.8568127104.2565356.51681.08410.9685
1150.15430.06280.06080.0607113429.3377125964.6799354.9151.06920.9769

\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.0706 & 0.0307 & 0.0307 & 0.0311 & 25803.247 & 0 & 0 & 0.5099 & 0.5099 \tabularnewline
105 & 0.0799 & -0.0424 & 0.0365 & 0.0363 & 42670.7898 & 34237.0184 & 185.0325 & -0.6558 & 0.5829 \tabularnewline
106 & 0.0901 & 0.0181 & 0.0304 & 0.0303 & 8797.0282 & 25757.0217 & 160.4899 & 0.2978 & 0.4878 \tabularnewline
107 & 0.0992 & -0.0755 & 0.0417 & 0.0409 & 126630.3728 & 50975.3595 & 225.7772 & -1.1297 & 0.6483 \tabularnewline
108 & 0.1076 & -0.1592 & 0.0652 & 0.0622 & 483722.1388 & 137524.7153 & 370.8432 & -2.2079 & 0.9602 \tabularnewline
109 & 0.1154 & 0.0193 & 0.0575 & 0.0551 & 9968.6756 & 116265.3754 & 340.9771 & 0.317 & 0.853 \tabularnewline
110 & 0.1227 & -0.0253 & 0.0529 & 0.0508 & 15579.4758 & 101881.6755 & 319.1891 & -0.3962 & 0.7878 \tabularnewline
111 & 0.1296 & 0.0983 & 0.0586 & 0.0574 & 303067.3935 & 127029.8902 & 356.4125 & 1.7477 & 0.9077 \tabularnewline
112 & 0.1362 & 0.0633 & 0.0591 & 0.0583 & 116174.1446 & 125823.6963 & 354.7164 & 1.082 & 0.9271 \tabularnewline
113 & 0.1425 & 0.0712 & 0.0603 & 0.0598 & 149123.6984 & 128153.6965 & 357.9856 & 1.2259 & 0.957 \tabularnewline
114 & 0.1485 & 0.0635 & 0.0606 & 0.0603 & 116609.8568 & 127104.2565 & 356.5168 & 1.0841 & 0.9685 \tabularnewline
115 & 0.1543 & 0.0628 & 0.0608 & 0.0607 & 113429.3377 & 125964.6799 & 354.915 & 1.0692 & 0.9769 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302449&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.0706[/C][C]0.0307[/C][C]0.0307[/C][C]0.0311[/C][C]25803.247[/C][C]0[/C][C]0[/C][C]0.5099[/C][C]0.5099[/C][/ROW]
[ROW][C]105[/C][C]0.0799[/C][C]-0.0424[/C][C]0.0365[/C][C]0.0363[/C][C]42670.7898[/C][C]34237.0184[/C][C]185.0325[/C][C]-0.6558[/C][C]0.5829[/C][/ROW]
[ROW][C]106[/C][C]0.0901[/C][C]0.0181[/C][C]0.0304[/C][C]0.0303[/C][C]8797.0282[/C][C]25757.0217[/C][C]160.4899[/C][C]0.2978[/C][C]0.4878[/C][/ROW]
[ROW][C]107[/C][C]0.0992[/C][C]-0.0755[/C][C]0.0417[/C][C]0.0409[/C][C]126630.3728[/C][C]50975.3595[/C][C]225.7772[/C][C]-1.1297[/C][C]0.6483[/C][/ROW]
[ROW][C]108[/C][C]0.1076[/C][C]-0.1592[/C][C]0.0652[/C][C]0.0622[/C][C]483722.1388[/C][C]137524.7153[/C][C]370.8432[/C][C]-2.2079[/C][C]0.9602[/C][/ROW]
[ROW][C]109[/C][C]0.1154[/C][C]0.0193[/C][C]0.0575[/C][C]0.0551[/C][C]9968.6756[/C][C]116265.3754[/C][C]340.9771[/C][C]0.317[/C][C]0.853[/C][/ROW]
[ROW][C]110[/C][C]0.1227[/C][C]-0.0253[/C][C]0.0529[/C][C]0.0508[/C][C]15579.4758[/C][C]101881.6755[/C][C]319.1891[/C][C]-0.3962[/C][C]0.7878[/C][/ROW]
[ROW][C]111[/C][C]0.1296[/C][C]0.0983[/C][C]0.0586[/C][C]0.0574[/C][C]303067.3935[/C][C]127029.8902[/C][C]356.4125[/C][C]1.7477[/C][C]0.9077[/C][/ROW]
[ROW][C]112[/C][C]0.1362[/C][C]0.0633[/C][C]0.0591[/C][C]0.0583[/C][C]116174.1446[/C][C]125823.6963[/C][C]354.7164[/C][C]1.082[/C][C]0.9271[/C][/ROW]
[ROW][C]113[/C][C]0.1425[/C][C]0.0712[/C][C]0.0603[/C][C]0.0598[/C][C]149123.6984[/C][C]128153.6965[/C][C]357.9856[/C][C]1.2259[/C][C]0.957[/C][/ROW]
[ROW][C]114[/C][C]0.1485[/C][C]0.0635[/C][C]0.0606[/C][C]0.0603[/C][C]116609.8568[/C][C]127104.2565[/C][C]356.5168[/C][C]1.0841[/C][C]0.9685[/C][/ROW]
[ROW][C]115[/C][C]0.1543[/C][C]0.0628[/C][C]0.0608[/C][C]0.0607[/C][C]113429.3377[/C][C]125964.6799[/C][C]354.915[/C][C]1.0692[/C][C]0.9769[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302449&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302449&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.07060.03070.03070.031125803.247000.50990.5099
1050.0799-0.04240.03650.036342670.789834237.0184185.0325-0.65580.5829
1060.09010.01810.03040.03038797.028225757.0217160.48990.29780.4878
1070.0992-0.07550.04170.0409126630.372850975.3595225.7772-1.12970.6483
1080.1076-0.15920.06520.0622483722.1388137524.7153370.8432-2.20790.9602
1090.11540.01930.05750.05519968.6756116265.3754340.97710.3170.853
1100.1227-0.02530.05290.050815579.4758101881.6755319.1891-0.39620.7878
1110.12960.09830.05860.0574303067.3935127029.8902356.41251.74770.9077
1120.13620.06330.05910.0583116174.1446125823.6963354.71641.0820.9271
1130.14250.07120.06030.0598149123.6984128153.6965357.98561.22590.957
1140.14850.06350.06060.0603116609.8568127104.2565356.51681.08410.9685
1150.15430.06280.06080.0607113429.3377125964.6799354.9151.06920.9769



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