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 21:49:42 +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/t1482180603nby8fhlb0xpksof.htm/, Retrieved Mon, 20 May 2024 23:40:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301497, Retrieved Mon, 20 May 2024 23:40:08 +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] [N2044 ARIMA forecast] [2016-12-19 20:49:42] [2e11ca31a00cf8de75c33c1af2d59434] [Current]
Feedback Forum

Post a new message
Dataseries X:
3880
3740
3990
3970
4100
3920
3850
4190
3990
4140
4080
3900
4070
3930
4210
4020
4120
4020
3910
4110
4130
4340
4200
4200
4160
3920
4280
3940
4190
4150
4070
4130
3960
4320
4110
4100
4280
3990
4360
4240
4450
4190
3950
4300
4150
4540
4240
4210
4390
4140
4460
4290
4430
4390
4340
4570
4470
4550
4420
4490
4480
4400
4770
4450
4610
4540
4520
4710
4580
4760
4450
4500
4660
4370
5030
4510
4740
4690
4580
4850
4730
4890
4740
4600
4740
4520
5000
4670
4940
4790
4820
5010
4870
5070
4770
4840
4850
4590
5050
4770
4720
4740
4400
4840
4650
4860
4580
4640
4800
4660
5020
4700
4800
4700
4560




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301497&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])
934870-------
945070-------
954770-------
964840-------
974850-------
984590-------
995050-------
1004770-------
1014720-------
1024740-------
1034400-------
1044840-------
1054650-------
10648604883.92154699.46665068.37650.39970.99350.0240.9935
10745804669.39374472.14274866.64480.18720.02910.15870.5764
10846404657.09714447.8314866.36320.43640.76490.04330.5265
10948004747.2164526.70244967.72960.31950.82970.18050.8062
11046604525.7674294.48634757.04770.12770.01010.29310.1462
11150204952.70774711.13955194.2760.29250.99120.21490.993
11247004669.01674417.58144920.45210.40460.00310.21560.5589
11348004817.00984556.08035077.93930.44920.81030.76690.8952
11447004735.14984465.05965005.240.39930.3190.4860.7317
11545604611.6454332.69484890.59520.35830.26740.93150.3938

\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
93 & 4870 & - & - & - & - & - & - & - \tabularnewline
94 & 5070 & - & - & - & - & - & - & - \tabularnewline
95 & 4770 & - & - & - & - & - & - & - \tabularnewline
96 & 4840 & - & - & - & - & - & - & - \tabularnewline
97 & 4850 & - & - & - & - & - & - & - \tabularnewline
98 & 4590 & - & - & - & - & - & - & - \tabularnewline
99 & 5050 & - & - & - & - & - & - & - \tabularnewline
100 & 4770 & - & - & - & - & - & - & - \tabularnewline
101 & 4720 & - & - & - & - & - & - & - \tabularnewline
102 & 4740 & - & - & - & - & - & - & - \tabularnewline
103 & 4400 & - & - & - & - & - & - & - \tabularnewline
104 & 4840 & - & - & - & - & - & - & - \tabularnewline
105 & 4650 & - & - & - & - & - & - & - \tabularnewline
106 & 4860 & 4883.9215 & 4699.4666 & 5068.3765 & 0.3997 & 0.9935 & 0.024 & 0.9935 \tabularnewline
107 & 4580 & 4669.3937 & 4472.1427 & 4866.6448 & 0.1872 & 0.0291 & 0.1587 & 0.5764 \tabularnewline
108 & 4640 & 4657.0971 & 4447.831 & 4866.3632 & 0.4364 & 0.7649 & 0.0433 & 0.5265 \tabularnewline
109 & 4800 & 4747.216 & 4526.7024 & 4967.7296 & 0.3195 & 0.8297 & 0.1805 & 0.8062 \tabularnewline
110 & 4660 & 4525.767 & 4294.4863 & 4757.0477 & 0.1277 & 0.0101 & 0.2931 & 0.1462 \tabularnewline
111 & 5020 & 4952.7077 & 4711.1395 & 5194.276 & 0.2925 & 0.9912 & 0.2149 & 0.993 \tabularnewline
112 & 4700 & 4669.0167 & 4417.5814 & 4920.4521 & 0.4046 & 0.0031 & 0.2156 & 0.5589 \tabularnewline
113 & 4800 & 4817.0098 & 4556.0803 & 5077.9393 & 0.4492 & 0.8103 & 0.7669 & 0.8952 \tabularnewline
114 & 4700 & 4735.1498 & 4465.0596 & 5005.24 & 0.3993 & 0.319 & 0.486 & 0.7317 \tabularnewline
115 & 4560 & 4611.645 & 4332.6948 & 4890.5952 & 0.3583 & 0.2674 & 0.9315 & 0.3938 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301497&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]93[/C][C]4870[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]5070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]4770[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]4840[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]4850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]4590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]5050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]4770[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]4720[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]4740[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]4840[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4650[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]4860[/C][C]4883.9215[/C][C]4699.4666[/C][C]5068.3765[/C][C]0.3997[/C][C]0.9935[/C][C]0.024[/C][C]0.9935[/C][/ROW]
[ROW][C]107[/C][C]4580[/C][C]4669.3937[/C][C]4472.1427[/C][C]4866.6448[/C][C]0.1872[/C][C]0.0291[/C][C]0.1587[/C][C]0.5764[/C][/ROW]
[ROW][C]108[/C][C]4640[/C][C]4657.0971[/C][C]4447.831[/C][C]4866.3632[/C][C]0.4364[/C][C]0.7649[/C][C]0.0433[/C][C]0.5265[/C][/ROW]
[ROW][C]109[/C][C]4800[/C][C]4747.216[/C][C]4526.7024[/C][C]4967.7296[/C][C]0.3195[/C][C]0.8297[/C][C]0.1805[/C][C]0.8062[/C][/ROW]
[ROW][C]110[/C][C]4660[/C][C]4525.767[/C][C]4294.4863[/C][C]4757.0477[/C][C]0.1277[/C][C]0.0101[/C][C]0.2931[/C][C]0.1462[/C][/ROW]
[ROW][C]111[/C][C]5020[/C][C]4952.7077[/C][C]4711.1395[/C][C]5194.276[/C][C]0.2925[/C][C]0.9912[/C][C]0.2149[/C][C]0.993[/C][/ROW]
[ROW][C]112[/C][C]4700[/C][C]4669.0167[/C][C]4417.5814[/C][C]4920.4521[/C][C]0.4046[/C][C]0.0031[/C][C]0.2156[/C][C]0.5589[/C][/ROW]
[ROW][C]113[/C][C]4800[/C][C]4817.0098[/C][C]4556.0803[/C][C]5077.9393[/C][C]0.4492[/C][C]0.8103[/C][C]0.7669[/C][C]0.8952[/C][/ROW]
[ROW][C]114[/C][C]4700[/C][C]4735.1498[/C][C]4465.0596[/C][C]5005.24[/C][C]0.3993[/C][C]0.319[/C][C]0.486[/C][C]0.7317[/C][/ROW]
[ROW][C]115[/C][C]4560[/C][C]4611.645[/C][C]4332.6948[/C][C]4890.5952[/C][C]0.3583[/C][C]0.2674[/C][C]0.9315[/C][C]0.3938[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301497&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301497&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])
934870-------
945070-------
954770-------
964840-------
974850-------
984590-------
995050-------
1004770-------
1014720-------
1024740-------
1034400-------
1044840-------
1054650-------
10648604883.92154699.46665068.37650.39970.99350.0240.9935
10745804669.39374472.14274866.64480.18720.02910.15870.5764
10846404657.09714447.8314866.36320.43640.76490.04330.5265
10948004747.2164526.70244967.72960.31950.82970.18050.8062
11046604525.7674294.48634757.04770.12770.01010.29310.1462
11150204952.70774711.13955194.2760.29250.99120.21490.993
11247004669.01674417.58144920.45210.40460.00310.21560.5589
11348004817.00984556.08035077.93930.44920.81030.76690.8952
11447004735.14984465.05965005.240.39930.3190.4860.7317
11545604611.6454332.69484890.59520.35830.26740.93150.3938







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0193-0.00490.00490.0049572.240100-0.12970.1297
1070.0216-0.01950.01220.01217991.24164281.740965.435-0.48470.3072
1080.0229-0.00370.00940.0093292.31182951.931254.3317-0.09270.2357
1090.02370.0110.00980.00972786.15322910.486753.94890.28620.2483
1100.02610.02880.01360.013618018.49645932.088677.02010.72780.3442
1110.02490.01340.01360.01364528.24775698.115175.48590.36480.3476
1120.02750.00660.01260.0126959.96285021.236270.86070.1680.322
1130.0276-0.00350.01140.0115289.33394429.748566.5564-0.09220.2933
1140.0291-0.00750.0110.0111235.51074074.833163.8344-0.19060.2818
1150.0309-0.01130.0110.01112667.20873934.070762.7222-0.280.2817

\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.0193 & -0.0049 & 0.0049 & 0.0049 & 572.2401 & 0 & 0 & -0.1297 & 0.1297 \tabularnewline
107 & 0.0216 & -0.0195 & 0.0122 & 0.0121 & 7991.2416 & 4281.7409 & 65.435 & -0.4847 & 0.3072 \tabularnewline
108 & 0.0229 & -0.0037 & 0.0094 & 0.0093 & 292.3118 & 2951.9312 & 54.3317 & -0.0927 & 0.2357 \tabularnewline
109 & 0.0237 & 0.011 & 0.0098 & 0.0097 & 2786.1532 & 2910.4867 & 53.9489 & 0.2862 & 0.2483 \tabularnewline
110 & 0.0261 & 0.0288 & 0.0136 & 0.0136 & 18018.4964 & 5932.0886 & 77.0201 & 0.7278 & 0.3442 \tabularnewline
111 & 0.0249 & 0.0134 & 0.0136 & 0.0136 & 4528.2477 & 5698.1151 & 75.4859 & 0.3648 & 0.3476 \tabularnewline
112 & 0.0275 & 0.0066 & 0.0126 & 0.0126 & 959.9628 & 5021.2362 & 70.8607 & 0.168 & 0.322 \tabularnewline
113 & 0.0276 & -0.0035 & 0.0114 & 0.0115 & 289.3339 & 4429.7485 & 66.5564 & -0.0922 & 0.2933 \tabularnewline
114 & 0.0291 & -0.0075 & 0.011 & 0.011 & 1235.5107 & 4074.8331 & 63.8344 & -0.1906 & 0.2818 \tabularnewline
115 & 0.0309 & -0.0113 & 0.011 & 0.0111 & 2667.2087 & 3934.0707 & 62.7222 & -0.28 & 0.2817 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301497&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.0193[/C][C]-0.0049[/C][C]0.0049[/C][C]0.0049[/C][C]572.2401[/C][C]0[/C][C]0[/C][C]-0.1297[/C][C]0.1297[/C][/ROW]
[ROW][C]107[/C][C]0.0216[/C][C]-0.0195[/C][C]0.0122[/C][C]0.0121[/C][C]7991.2416[/C][C]4281.7409[/C][C]65.435[/C][C]-0.4847[/C][C]0.3072[/C][/ROW]
[ROW][C]108[/C][C]0.0229[/C][C]-0.0037[/C][C]0.0094[/C][C]0.0093[/C][C]292.3118[/C][C]2951.9312[/C][C]54.3317[/C][C]-0.0927[/C][C]0.2357[/C][/ROW]
[ROW][C]109[/C][C]0.0237[/C][C]0.011[/C][C]0.0098[/C][C]0.0097[/C][C]2786.1532[/C][C]2910.4867[/C][C]53.9489[/C][C]0.2862[/C][C]0.2483[/C][/ROW]
[ROW][C]110[/C][C]0.0261[/C][C]0.0288[/C][C]0.0136[/C][C]0.0136[/C][C]18018.4964[/C][C]5932.0886[/C][C]77.0201[/C][C]0.7278[/C][C]0.3442[/C][/ROW]
[ROW][C]111[/C][C]0.0249[/C][C]0.0134[/C][C]0.0136[/C][C]0.0136[/C][C]4528.2477[/C][C]5698.1151[/C][C]75.4859[/C][C]0.3648[/C][C]0.3476[/C][/ROW]
[ROW][C]112[/C][C]0.0275[/C][C]0.0066[/C][C]0.0126[/C][C]0.0126[/C][C]959.9628[/C][C]5021.2362[/C][C]70.8607[/C][C]0.168[/C][C]0.322[/C][/ROW]
[ROW][C]113[/C][C]0.0276[/C][C]-0.0035[/C][C]0.0114[/C][C]0.0115[/C][C]289.3339[/C][C]4429.7485[/C][C]66.5564[/C][C]-0.0922[/C][C]0.2933[/C][/ROW]
[ROW][C]114[/C][C]0.0291[/C][C]-0.0075[/C][C]0.011[/C][C]0.011[/C][C]1235.5107[/C][C]4074.8331[/C][C]63.8344[/C][C]-0.1906[/C][C]0.2818[/C][/ROW]
[ROW][C]115[/C][C]0.0309[/C][C]-0.0113[/C][C]0.011[/C][C]0.0111[/C][C]2667.2087[/C][C]3934.0707[/C][C]62.7222[/C][C]-0.28[/C][C]0.2817[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301497&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301497&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.0193-0.00490.00490.0049572.240100-0.12970.1297
1070.0216-0.01950.01220.01217991.24164281.740965.435-0.48470.3072
1080.0229-0.00370.00940.0093292.31182951.931254.3317-0.09270.2357
1090.02370.0110.00980.00972786.15322910.486753.94890.28620.2483
1100.02610.02880.01360.013618018.49645932.088677.02010.72780.3442
1110.02490.01340.01360.01364528.24775698.115175.48590.36480.3476
1120.02750.00660.01260.0126959.96285021.236270.86070.1680.322
1130.0276-0.00350.01140.0115289.33394429.748566.5564-0.09220.2933
1140.0291-0.00750.0110.0111235.51074074.833163.8344-0.19060.2818
1150.0309-0.01130.0110.01112667.20873934.070762.7222-0.280.2817



Parameters (Session):
par1 = 12 ;
Parameters (R input):
par1 = 10 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '1'
par3 <- '1'
par2 <- '1'
par1 <- '0'
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')