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 13:59:28 +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/t1482325339ttwm7gao22py8dy.htm/, Retrieved Fri, 01 Nov 2024 03:40:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302246, Retrieved Fri, 01 Nov 2024 03:40:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ ARIMA FORECAST] [2016-12-15 19:00:32] [d1d385d9b7e195437bdc484ddbefdda4]
- RMPD  [ARIMA Backward Selection] [Arima Backward Se...] [2016-12-19 20:48:05] [d1d385d9b7e195437bdc484ddbefdda4]
- RMP       [ARIMA Forecasting] [Arima Forecast new ] [2016-12-21 12:59:28] [b95f76f605693b3a3343a287ab24f42a] [Current]
- R           [ARIMA Forecasting] [Arima forecast ge...] [2016-12-22 20:17:05] [d1d385d9b7e195437bdc484ddbefdda4]
- RM          [Variance Reduction Matrix] [Variance Reductio...] [2016-12-23 08:50:27] [d1d385d9b7e195437bdc484ddbefdda4]
Feedback Forum

Post a new message
Dataseries X:
3300
4100
3550
3650
3400
4050
2950
3300
3950
3950
3900
3700
3850
4350
4350
3550
3800
4150
3500
3850
4250
4150
4200
4100
4200
4350
4150
4200
3850
4100
3800
4250
4400
4400
4450
4050
4100
4450
4600
4100
4300
4850
3800
4450
4800
4900
4900
4350
4500
5050
5150
4450
4900
5450
4100
5050
5550
5450
5500
4950
5400
5750
5950
5950
5750
6450
5000
5950
6250
6300
6400
5700
5750
6450
6500
5950
6200
6750
5300
6450
6900
6800
6750
6050
6100
7400
7300
6200
6550
7500
5400
6750
7400
7450
7200
6500
7150
8000
7000
7600
7100
8050
5700
7550
7800
7800
8250
7150
7350
7800
8250
7500
8150
8550




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302246&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302246&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302246&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 time2 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[102])
907500-------
915400-------
926750-------
937400.00000000001-------
947450-------
957200-------
966500.00000000001-------
977150-------
988000-------
997000-------
1007600-------
1017100-------
1028050-------
10357006218.33065666.14076836.37150.050100.99530
10475507548.67116844.7028341.33470.498710.97590.1076
10578008084.04127299.39298972.11160.26540.88070.93440.5299
10678008104.68157261.73419067.81710.26760.73240.90860.5443
10782508102.21687197.31649147.13270.39080.71460.95470.539
10871507360.3216531.06048319.19570.33360.03450.96070.0793
10973507617.43026722.04788659.81180.30750.81030.81030.208
11078008638.83787556.65169912.4280.09840.97630.83720.8176
11182508378.65367300.07259654.22860.42160.8130.98290.6932
11275007852.08186825.43749069.71910.28540.26090.65750.375
11381507889.01696826.24639156.65260.34330.72620.88880.4017
11485508890.48777632.386110405.83250.32980.83090.86150.8615

\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[102]) \tabularnewline
90 & 7500 & - & - & - & - & - & - & - \tabularnewline
91 & 5400 & - & - & - & - & - & - & - \tabularnewline
92 & 6750 & - & - & - & - & - & - & - \tabularnewline
93 & 7400.00000000001 & - & - & - & - & - & - & - \tabularnewline
94 & 7450 & - & - & - & - & - & - & - \tabularnewline
95 & 7200 & - & - & - & - & - & - & - \tabularnewline
96 & 6500.00000000001 & - & - & - & - & - & - & - \tabularnewline
97 & 7150 & - & - & - & - & - & - & - \tabularnewline
98 & 8000 & - & - & - & - & - & - & - \tabularnewline
99 & 7000 & - & - & - & - & - & - & - \tabularnewline
100 & 7600 & - & - & - & - & - & - & - \tabularnewline
101 & 7100 & - & - & - & - & - & - & - \tabularnewline
102 & 8050 & - & - & - & - & - & - & - \tabularnewline
103 & 5700 & 6218.3306 & 5666.1407 & 6836.3715 & 0.0501 & 0 & 0.9953 & 0 \tabularnewline
104 & 7550 & 7548.6711 & 6844.702 & 8341.3347 & 0.4987 & 1 & 0.9759 & 0.1076 \tabularnewline
105 & 7800 & 8084.0412 & 7299.3929 & 8972.1116 & 0.2654 & 0.8807 & 0.9344 & 0.5299 \tabularnewline
106 & 7800 & 8104.6815 & 7261.7341 & 9067.8171 & 0.2676 & 0.7324 & 0.9086 & 0.5443 \tabularnewline
107 & 8250 & 8102.2168 & 7197.3164 & 9147.1327 & 0.3908 & 0.7146 & 0.9547 & 0.539 \tabularnewline
108 & 7150 & 7360.321 & 6531.0604 & 8319.1957 & 0.3336 & 0.0345 & 0.9607 & 0.0793 \tabularnewline
109 & 7350 & 7617.4302 & 6722.0478 & 8659.8118 & 0.3075 & 0.8103 & 0.8103 & 0.208 \tabularnewline
110 & 7800 & 8638.8378 & 7556.6516 & 9912.428 & 0.0984 & 0.9763 & 0.8372 & 0.8176 \tabularnewline
111 & 8250 & 8378.6536 & 7300.0725 & 9654.2286 & 0.4216 & 0.813 & 0.9829 & 0.6932 \tabularnewline
112 & 7500 & 7852.0818 & 6825.4374 & 9069.7191 & 0.2854 & 0.2609 & 0.6575 & 0.375 \tabularnewline
113 & 8150 & 7889.0169 & 6826.2463 & 9156.6526 & 0.3433 & 0.7262 & 0.8888 & 0.4017 \tabularnewline
114 & 8550 & 8890.4877 & 7632.3861 & 10405.8325 & 0.3298 & 0.8309 & 0.8615 & 0.8615 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302246&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[102])[/C][/ROW]
[ROW][C]90[/C][C]7500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]6750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]7400.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]7450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]7200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]6500.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]7150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]8000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]7000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]7600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]7100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]8050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5700[/C][C]6218.3306[/C][C]5666.1407[/C][C]6836.3715[/C][C]0.0501[/C][C]0[/C][C]0.9953[/C][C]0[/C][/ROW]
[ROW][C]104[/C][C]7550[/C][C]7548.6711[/C][C]6844.702[/C][C]8341.3347[/C][C]0.4987[/C][C]1[/C][C]0.9759[/C][C]0.1076[/C][/ROW]
[ROW][C]105[/C][C]7800[/C][C]8084.0412[/C][C]7299.3929[/C][C]8972.1116[/C][C]0.2654[/C][C]0.8807[/C][C]0.9344[/C][C]0.5299[/C][/ROW]
[ROW][C]106[/C][C]7800[/C][C]8104.6815[/C][C]7261.7341[/C][C]9067.8171[/C][C]0.2676[/C][C]0.7324[/C][C]0.9086[/C][C]0.5443[/C][/ROW]
[ROW][C]107[/C][C]8250[/C][C]8102.2168[/C][C]7197.3164[/C][C]9147.1327[/C][C]0.3908[/C][C]0.7146[/C][C]0.9547[/C][C]0.539[/C][/ROW]
[ROW][C]108[/C][C]7150[/C][C]7360.321[/C][C]6531.0604[/C][C]8319.1957[/C][C]0.3336[/C][C]0.0345[/C][C]0.9607[/C][C]0.0793[/C][/ROW]
[ROW][C]109[/C][C]7350[/C][C]7617.4302[/C][C]6722.0478[/C][C]8659.8118[/C][C]0.3075[/C][C]0.8103[/C][C]0.8103[/C][C]0.208[/C][/ROW]
[ROW][C]110[/C][C]7800[/C][C]8638.8378[/C][C]7556.6516[/C][C]9912.428[/C][C]0.0984[/C][C]0.9763[/C][C]0.8372[/C][C]0.8176[/C][/ROW]
[ROW][C]111[/C][C]8250[/C][C]8378.6536[/C][C]7300.0725[/C][C]9654.2286[/C][C]0.4216[/C][C]0.813[/C][C]0.9829[/C][C]0.6932[/C][/ROW]
[ROW][C]112[/C][C]7500[/C][C]7852.0818[/C][C]6825.4374[/C][C]9069.7191[/C][C]0.2854[/C][C]0.2609[/C][C]0.6575[/C][C]0.375[/C][/ROW]
[ROW][C]113[/C][C]8150[/C][C]7889.0169[/C][C]6826.2463[/C][C]9156.6526[/C][C]0.3433[/C][C]0.7262[/C][C]0.8888[/C][C]0.4017[/C][/ROW]
[ROW][C]114[/C][C]8550[/C][C]8890.4877[/C][C]7632.3861[/C][C]10405.8325[/C][C]0.3298[/C][C]0.8309[/C][C]0.8615[/C][C]0.8615[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302246&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302246&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[102])
907500-------
915400-------
926750-------
937400.00000000001-------
947450-------
957200-------
966500.00000000001-------
977150-------
988000-------
997000-------
1007600-------
1017100-------
1028050-------
10357006218.33065666.14076836.37150.050100.99530
10475507548.67116844.7028341.33470.498710.97590.1076
10578008084.04127299.39298972.11160.26540.88070.93440.5299
10678008104.68157261.73419067.81710.26760.73240.90860.5443
10782508102.21687197.31649147.13270.39080.71460.95470.539
10871507360.3216531.06048319.19570.33360.03450.96070.0793
10973507617.43026722.04788659.81180.30750.81030.81030.208
11078008638.83787556.65169912.4280.09840.97630.83720.8176
11182508378.65367300.07259654.22860.42160.8130.98290.6932
11275007852.08186825.43749069.71910.28540.26090.65750.375
11381507889.01696826.24639156.65260.34330.72620.88880.4017
11485508890.48777632.386110405.83250.32980.83090.86150.8615







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1030.0507-0.09090.09090.087268666.652600-0.87050.8705
1040.05362e-040.04560.04361.766134334.2093366.51630.00220.4364
1050.056-0.03640.04250.04180679.3772116449.2653341.2466-0.4770.4499
1060.0606-0.03910.04160.040392830.8015110544.6493332.4826-0.51170.4654
1070.06580.01790.03690.035921839.881292803.6957304.6370.24820.4219
1080.0665-0.02940.03570.034744234.909284708.898291.0479-0.35320.4105
1090.0698-0.03640.03580.034971518.888582824.6109287.7927-0.44910.416
1100.0752-0.10750.04470.0433703648.7818160427.6322400.5342-1.40870.5401
1110.0777-0.01560.04150.040216551.747144441.4228380.0545-0.21610.5041
1120.0791-0.04690.0420.0407123961.56142393.4365377.3505-0.59130.5128
1130.0820.0320.04110.0468112.1548135640.5927368.29420.43830.506
1140.087-0.03980.0410.0399115931.8729133998.1994366.0576-0.57180.5115

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
103 & 0.0507 & -0.0909 & 0.0909 & 0.087 & 268666.6526 & 0 & 0 & -0.8705 & 0.8705 \tabularnewline
104 & 0.0536 & 2e-04 & 0.0456 & 0.0436 & 1.766 & 134334.2093 & 366.5163 & 0.0022 & 0.4364 \tabularnewline
105 & 0.056 & -0.0364 & 0.0425 & 0.041 & 80679.3772 & 116449.2653 & 341.2466 & -0.477 & 0.4499 \tabularnewline
106 & 0.0606 & -0.0391 & 0.0416 & 0.0403 & 92830.8015 & 110544.6493 & 332.4826 & -0.5117 & 0.4654 \tabularnewline
107 & 0.0658 & 0.0179 & 0.0369 & 0.0359 & 21839.8812 & 92803.6957 & 304.637 & 0.2482 & 0.4219 \tabularnewline
108 & 0.0665 & -0.0294 & 0.0357 & 0.0347 & 44234.9092 & 84708.898 & 291.0479 & -0.3532 & 0.4105 \tabularnewline
109 & 0.0698 & -0.0364 & 0.0358 & 0.0349 & 71518.8885 & 82824.6109 & 287.7927 & -0.4491 & 0.416 \tabularnewline
110 & 0.0752 & -0.1075 & 0.0447 & 0.0433 & 703648.7818 & 160427.6322 & 400.5342 & -1.4087 & 0.5401 \tabularnewline
111 & 0.0777 & -0.0156 & 0.0415 & 0.0402 & 16551.747 & 144441.4228 & 380.0545 & -0.2161 & 0.5041 \tabularnewline
112 & 0.0791 & -0.0469 & 0.042 & 0.0407 & 123961.56 & 142393.4365 & 377.3505 & -0.5913 & 0.5128 \tabularnewline
113 & 0.082 & 0.032 & 0.0411 & 0.04 & 68112.1548 & 135640.5927 & 368.2942 & 0.4383 & 0.506 \tabularnewline
114 & 0.087 & -0.0398 & 0.041 & 0.0399 & 115931.8729 & 133998.1994 & 366.0576 & -0.5718 & 0.5115 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302246&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]103[/C][C]0.0507[/C][C]-0.0909[/C][C]0.0909[/C][C]0.087[/C][C]268666.6526[/C][C]0[/C][C]0[/C][C]-0.8705[/C][C]0.8705[/C][/ROW]
[ROW][C]104[/C][C]0.0536[/C][C]2e-04[/C][C]0.0456[/C][C]0.0436[/C][C]1.766[/C][C]134334.2093[/C][C]366.5163[/C][C]0.0022[/C][C]0.4364[/C][/ROW]
[ROW][C]105[/C][C]0.056[/C][C]-0.0364[/C][C]0.0425[/C][C]0.041[/C][C]80679.3772[/C][C]116449.2653[/C][C]341.2466[/C][C]-0.477[/C][C]0.4499[/C][/ROW]
[ROW][C]106[/C][C]0.0606[/C][C]-0.0391[/C][C]0.0416[/C][C]0.0403[/C][C]92830.8015[/C][C]110544.6493[/C][C]332.4826[/C][C]-0.5117[/C][C]0.4654[/C][/ROW]
[ROW][C]107[/C][C]0.0658[/C][C]0.0179[/C][C]0.0369[/C][C]0.0359[/C][C]21839.8812[/C][C]92803.6957[/C][C]304.637[/C][C]0.2482[/C][C]0.4219[/C][/ROW]
[ROW][C]108[/C][C]0.0665[/C][C]-0.0294[/C][C]0.0357[/C][C]0.0347[/C][C]44234.9092[/C][C]84708.898[/C][C]291.0479[/C][C]-0.3532[/C][C]0.4105[/C][/ROW]
[ROW][C]109[/C][C]0.0698[/C][C]-0.0364[/C][C]0.0358[/C][C]0.0349[/C][C]71518.8885[/C][C]82824.6109[/C][C]287.7927[/C][C]-0.4491[/C][C]0.416[/C][/ROW]
[ROW][C]110[/C][C]0.0752[/C][C]-0.1075[/C][C]0.0447[/C][C]0.0433[/C][C]703648.7818[/C][C]160427.6322[/C][C]400.5342[/C][C]-1.4087[/C][C]0.5401[/C][/ROW]
[ROW][C]111[/C][C]0.0777[/C][C]-0.0156[/C][C]0.0415[/C][C]0.0402[/C][C]16551.747[/C][C]144441.4228[/C][C]380.0545[/C][C]-0.2161[/C][C]0.5041[/C][/ROW]
[ROW][C]112[/C][C]0.0791[/C][C]-0.0469[/C][C]0.042[/C][C]0.0407[/C][C]123961.56[/C][C]142393.4365[/C][C]377.3505[/C][C]-0.5913[/C][C]0.5128[/C][/ROW]
[ROW][C]113[/C][C]0.082[/C][C]0.032[/C][C]0.0411[/C][C]0.04[/C][C]68112.1548[/C][C]135640.5927[/C][C]368.2942[/C][C]0.4383[/C][C]0.506[/C][/ROW]
[ROW][C]114[/C][C]0.087[/C][C]-0.0398[/C][C]0.041[/C][C]0.0399[/C][C]115931.8729[/C][C]133998.1994[/C][C]366.0576[/C][C]-0.5718[/C][C]0.5115[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302246&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302246&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
1030.0507-0.09090.09090.087268666.652600-0.87050.8705
1040.05362e-040.04560.04361.766134334.2093366.51630.00220.4364
1050.056-0.03640.04250.04180679.3772116449.2653341.2466-0.4770.4499
1060.0606-0.03910.04160.040392830.8015110544.6493332.4826-0.51170.4654
1070.06580.01790.03690.035921839.881292803.6957304.6370.24820.4219
1080.0665-0.02940.03570.034744234.909284708.898291.0479-0.35320.4105
1090.0698-0.03640.03580.034971518.888582824.6109287.7927-0.44910.416
1100.0752-0.10750.04470.0433703648.7818160427.6322400.5342-1.40870.5401
1110.0777-0.01560.04150.040216551.747144441.4228380.0545-0.21610.5041
1120.0791-0.04690.0420.0407123961.56142393.4365377.3505-0.59130.5128
1130.0820.0320.04110.0468112.1548135640.5927368.29420.43830.506
1140.087-0.03980.0410.0399115931.8729133998.1994366.0576-0.57180.5115



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