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 computationFri, 23 Dec 2016 15:26:47 +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/23/t1482504949y7e2irjbomepz9z.htm/, Retrieved Tue, 07 May 2024 22:12:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302971, Retrieved Tue, 07 May 2024 22:12:31 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact77
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-23 14:26:47] [c6ea875f0603e0876d03f43aca979571] [Current]
Feedback Forum

Post a new message
Dataseries X:
5750
5400
6150
6350
6450
6400
5900
6450
6600
7100
6850
6050
6750
6450
7000
6650
6650
6550
6900
6450
6150
6750
6300
5650
6250
5950
6450
6150
5800
5700
5950
6700
6150
7350
6850
5600
6400
5850
6350
6350
6000
6150
6400
6300
6600
6850
6700
6200
6750
6350
6900
6000
6050
6000
6600
6350
6300
6200
5600
5550
6450
6550
7050
6450
6850
6150
6800
7450
7150
7450
6600
6300
7400
6600
7250
7400
7150
6850
7350
7550
7550
8300
7600
6100
7800
7050
7450
7000
6900
7100
7600
7350
6850
8400
7550
7350
7250
6650
7400
6900
7000
7250
7950
7600
7750
8150
7150
7000
6400
5800
6700
6350
6200
6150
7000




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302971&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])
917600-------
927350-------
936850-------
948400-------
957550-------
967350-------
977250-------
986650-------
997400-------
1006900-------
1017000-------
1027250-------
1037950-------
10476007613.25896723.98048502.53740.48830.2290.71910.229
10577507064.44546039.42428089.46660.09490.15290.65910.0452
10681508586.97577520.08479653.86660.21110.93790.63440.879
10771507721.51716640.32588802.70840.15010.21870.62210.3394
10870007512.81786426.36498599.27070.17740.74360.61550.2151
10964007407.92236319.37488496.46980.03480.76870.61190.1645
11058006805.16735715.71357894.62120.03530.7670.60990.0197
11167007553.6176463.73928643.49480.06240.99920.60880.238
11263507052.74455962.65538142.83380.10320.7370.60820.0533
11362007152.25366062.0548242.45310.04340.92540.60790.0758
11461507401.97736311.71838492.23620.01220.98460.60770.1623
11570008101.82187011.53039192.11330.02380.99980.60750.6075

\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 & 7600 & - & - & - & - & - & - & - \tabularnewline
92 & 7350 & - & - & - & - & - & - & - \tabularnewline
93 & 6850 & - & - & - & - & - & - & - \tabularnewline
94 & 8400 & - & - & - & - & - & - & - \tabularnewline
95 & 7550 & - & - & - & - & - & - & - \tabularnewline
96 & 7350 & - & - & - & - & - & - & - \tabularnewline
97 & 7250 & - & - & - & - & - & - & - \tabularnewline
98 & 6650 & - & - & - & - & - & - & - \tabularnewline
99 & 7400 & - & - & - & - & - & - & - \tabularnewline
100 & 6900 & - & - & - & - & - & - & - \tabularnewline
101 & 7000 & - & - & - & - & - & - & - \tabularnewline
102 & 7250 & - & - & - & - & - & - & - \tabularnewline
103 & 7950 & - & - & - & - & - & - & - \tabularnewline
104 & 7600 & 7613.2589 & 6723.9804 & 8502.5374 & 0.4883 & 0.229 & 0.7191 & 0.229 \tabularnewline
105 & 7750 & 7064.4454 & 6039.4242 & 8089.4666 & 0.0949 & 0.1529 & 0.6591 & 0.0452 \tabularnewline
106 & 8150 & 8586.9757 & 7520.0847 & 9653.8666 & 0.2111 & 0.9379 & 0.6344 & 0.879 \tabularnewline
107 & 7150 & 7721.5171 & 6640.3258 & 8802.7084 & 0.1501 & 0.2187 & 0.6221 & 0.3394 \tabularnewline
108 & 7000 & 7512.8178 & 6426.3649 & 8599.2707 & 0.1774 & 0.7436 & 0.6155 & 0.2151 \tabularnewline
109 & 6400 & 7407.9223 & 6319.3748 & 8496.4698 & 0.0348 & 0.7687 & 0.6119 & 0.1645 \tabularnewline
110 & 5800 & 6805.1673 & 5715.7135 & 7894.6212 & 0.0353 & 0.767 & 0.6099 & 0.0197 \tabularnewline
111 & 6700 & 7553.617 & 6463.7392 & 8643.4948 & 0.0624 & 0.9992 & 0.6088 & 0.238 \tabularnewline
112 & 6350 & 7052.7445 & 5962.6553 & 8142.8338 & 0.1032 & 0.737 & 0.6082 & 0.0533 \tabularnewline
113 & 6200 & 7152.2536 & 6062.054 & 8242.4531 & 0.0434 & 0.9254 & 0.6079 & 0.0758 \tabularnewline
114 & 6150 & 7401.9773 & 6311.7183 & 8492.2362 & 0.0122 & 0.9846 & 0.6077 & 0.1623 \tabularnewline
115 & 7000 & 8101.8218 & 7011.5303 & 9192.1133 & 0.0238 & 0.9998 & 0.6075 & 0.6075 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302971&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]7600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]7350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]6850[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]8400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]7550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]7350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]7250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]6650[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]7400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]6900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]7000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]7250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]7950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7600[/C][C]7613.2589[/C][C]6723.9804[/C][C]8502.5374[/C][C]0.4883[/C][C]0.229[/C][C]0.7191[/C][C]0.229[/C][/ROW]
[ROW][C]105[/C][C]7750[/C][C]7064.4454[/C][C]6039.4242[/C][C]8089.4666[/C][C]0.0949[/C][C]0.1529[/C][C]0.6591[/C][C]0.0452[/C][/ROW]
[ROW][C]106[/C][C]8150[/C][C]8586.9757[/C][C]7520.0847[/C][C]9653.8666[/C][C]0.2111[/C][C]0.9379[/C][C]0.6344[/C][C]0.879[/C][/ROW]
[ROW][C]107[/C][C]7150[/C][C]7721.5171[/C][C]6640.3258[/C][C]8802.7084[/C][C]0.1501[/C][C]0.2187[/C][C]0.6221[/C][C]0.3394[/C][/ROW]
[ROW][C]108[/C][C]7000[/C][C]7512.8178[/C][C]6426.3649[/C][C]8599.2707[/C][C]0.1774[/C][C]0.7436[/C][C]0.6155[/C][C]0.2151[/C][/ROW]
[ROW][C]109[/C][C]6400[/C][C]7407.9223[/C][C]6319.3748[/C][C]8496.4698[/C][C]0.0348[/C][C]0.7687[/C][C]0.6119[/C][C]0.1645[/C][/ROW]
[ROW][C]110[/C][C]5800[/C][C]6805.1673[/C][C]5715.7135[/C][C]7894.6212[/C][C]0.0353[/C][C]0.767[/C][C]0.6099[/C][C]0.0197[/C][/ROW]
[ROW][C]111[/C][C]6700[/C][C]7553.617[/C][C]6463.7392[/C][C]8643.4948[/C][C]0.0624[/C][C]0.9992[/C][C]0.6088[/C][C]0.238[/C][/ROW]
[ROW][C]112[/C][C]6350[/C][C]7052.7445[/C][C]5962.6553[/C][C]8142.8338[/C][C]0.1032[/C][C]0.737[/C][C]0.6082[/C][C]0.0533[/C][/ROW]
[ROW][C]113[/C][C]6200[/C][C]7152.2536[/C][C]6062.054[/C][C]8242.4531[/C][C]0.0434[/C][C]0.9254[/C][C]0.6079[/C][C]0.0758[/C][/ROW]
[ROW][C]114[/C][C]6150[/C][C]7401.9773[/C][C]6311.7183[/C][C]8492.2362[/C][C]0.0122[/C][C]0.9846[/C][C]0.6077[/C][C]0.1623[/C][/ROW]
[ROW][C]115[/C][C]7000[/C][C]8101.8218[/C][C]7011.5303[/C][C]9192.1133[/C][C]0.0238[/C][C]0.9998[/C][C]0.6075[/C][C]0.6075[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302971&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302971&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])
917600-------
927350-------
936850-------
948400-------
957550-------
967350-------
977250-------
986650-------
997400-------
1006900-------
1017000-------
1027250-------
1037950-------
10476007613.25896723.98048502.53740.48830.2290.71910.229
10577507064.44546039.42428089.46660.09490.15290.65910.0452
10681508586.97577520.08479653.86660.21110.93790.63440.879
10771507721.51716640.32588802.70840.15010.21870.62210.3394
10870007512.81786426.36498599.27070.17740.74360.61550.2151
10964007407.92236319.37488496.46980.03480.76870.61190.1645
11058006805.16735715.71357894.62120.03530.7670.60990.0197
11167007553.6176463.73928643.49480.06240.99920.60880.238
11263507052.74455962.65538142.83380.10320.7370.60820.0533
11362007152.25366062.0548242.45310.04340.92540.60790.0758
11461507401.97736311.71838492.23620.01220.98460.60770.1623
11570008101.82187011.53039192.11330.02380.99980.60750.6075







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.0596-0.00170.00170.0017175.798600-0.0280.028
1050.0740.08850.04510.0471469985.0702235080.4344484.85091.45020.7391
1060.0634-0.05360.04790.0488190947.7507220369.5398469.4353-0.92440.8009
1070.0714-0.07990.05590.0558326631.8103246935.1074496.9257-1.2090.9029
1080.0738-0.07330.05940.0588262982.11250144.508500.1445-1.08480.9393
1090.075-0.15750.07570.07331015907.3438377771.6473614.6313-2.13211.1381
1100.0817-0.17330.08970.08561010361.3797468141.609684.2087-2.12631.2793
1110.0736-0.12740.09440.0899728661.97500706.6542707.6063-1.80571.3451
1120.0789-0.11070.09620.0916493849.8834499944.7907707.0677-1.48661.3608
1130.0778-0.15360.10190.0967906786.8471540628.9964735.2748-2.01441.4262
1140.0751-0.20360.11120.10471567447.0776633976.0947796.2262-2.64841.5373
1150.0687-0.15740.1150.10811214011.24682312.3568826.022-2.33081.6034

\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.0596 & -0.0017 & 0.0017 & 0.0017 & 175.7986 & 0 & 0 & -0.028 & 0.028 \tabularnewline
105 & 0.074 & 0.0885 & 0.0451 & 0.0471 & 469985.0702 & 235080.4344 & 484.8509 & 1.4502 & 0.7391 \tabularnewline
106 & 0.0634 & -0.0536 & 0.0479 & 0.0488 & 190947.7507 & 220369.5398 & 469.4353 & -0.9244 & 0.8009 \tabularnewline
107 & 0.0714 & -0.0799 & 0.0559 & 0.0558 & 326631.8103 & 246935.1074 & 496.9257 & -1.209 & 0.9029 \tabularnewline
108 & 0.0738 & -0.0733 & 0.0594 & 0.0588 & 262982.11 & 250144.508 & 500.1445 & -1.0848 & 0.9393 \tabularnewline
109 & 0.075 & -0.1575 & 0.0757 & 0.0733 & 1015907.3438 & 377771.6473 & 614.6313 & -2.1321 & 1.1381 \tabularnewline
110 & 0.0817 & -0.1733 & 0.0897 & 0.0856 & 1010361.3797 & 468141.609 & 684.2087 & -2.1263 & 1.2793 \tabularnewline
111 & 0.0736 & -0.1274 & 0.0944 & 0.0899 & 728661.97 & 500706.6542 & 707.6063 & -1.8057 & 1.3451 \tabularnewline
112 & 0.0789 & -0.1107 & 0.0962 & 0.0916 & 493849.8834 & 499944.7907 & 707.0677 & -1.4866 & 1.3608 \tabularnewline
113 & 0.0778 & -0.1536 & 0.1019 & 0.0967 & 906786.8471 & 540628.9964 & 735.2748 & -2.0144 & 1.4262 \tabularnewline
114 & 0.0751 & -0.2036 & 0.1112 & 0.1047 & 1567447.0776 & 633976.0947 & 796.2262 & -2.6484 & 1.5373 \tabularnewline
115 & 0.0687 & -0.1574 & 0.115 & 0.1081 & 1214011.24 & 682312.3568 & 826.022 & -2.3308 & 1.6034 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302971&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.0596[/C][C]-0.0017[/C][C]0.0017[/C][C]0.0017[/C][C]175.7986[/C][C]0[/C][C]0[/C][C]-0.028[/C][C]0.028[/C][/ROW]
[ROW][C]105[/C][C]0.074[/C][C]0.0885[/C][C]0.0451[/C][C]0.0471[/C][C]469985.0702[/C][C]235080.4344[/C][C]484.8509[/C][C]1.4502[/C][C]0.7391[/C][/ROW]
[ROW][C]106[/C][C]0.0634[/C][C]-0.0536[/C][C]0.0479[/C][C]0.0488[/C][C]190947.7507[/C][C]220369.5398[/C][C]469.4353[/C][C]-0.9244[/C][C]0.8009[/C][/ROW]
[ROW][C]107[/C][C]0.0714[/C][C]-0.0799[/C][C]0.0559[/C][C]0.0558[/C][C]326631.8103[/C][C]246935.1074[/C][C]496.9257[/C][C]-1.209[/C][C]0.9029[/C][/ROW]
[ROW][C]108[/C][C]0.0738[/C][C]-0.0733[/C][C]0.0594[/C][C]0.0588[/C][C]262982.11[/C][C]250144.508[/C][C]500.1445[/C][C]-1.0848[/C][C]0.9393[/C][/ROW]
[ROW][C]109[/C][C]0.075[/C][C]-0.1575[/C][C]0.0757[/C][C]0.0733[/C][C]1015907.3438[/C][C]377771.6473[/C][C]614.6313[/C][C]-2.1321[/C][C]1.1381[/C][/ROW]
[ROW][C]110[/C][C]0.0817[/C][C]-0.1733[/C][C]0.0897[/C][C]0.0856[/C][C]1010361.3797[/C][C]468141.609[/C][C]684.2087[/C][C]-2.1263[/C][C]1.2793[/C][/ROW]
[ROW][C]111[/C][C]0.0736[/C][C]-0.1274[/C][C]0.0944[/C][C]0.0899[/C][C]728661.97[/C][C]500706.6542[/C][C]707.6063[/C][C]-1.8057[/C][C]1.3451[/C][/ROW]
[ROW][C]112[/C][C]0.0789[/C][C]-0.1107[/C][C]0.0962[/C][C]0.0916[/C][C]493849.8834[/C][C]499944.7907[/C][C]707.0677[/C][C]-1.4866[/C][C]1.3608[/C][/ROW]
[ROW][C]113[/C][C]0.0778[/C][C]-0.1536[/C][C]0.1019[/C][C]0.0967[/C][C]906786.8471[/C][C]540628.9964[/C][C]735.2748[/C][C]-2.0144[/C][C]1.4262[/C][/ROW]
[ROW][C]114[/C][C]0.0751[/C][C]-0.2036[/C][C]0.1112[/C][C]0.1047[/C][C]1567447.0776[/C][C]633976.0947[/C][C]796.2262[/C][C]-2.6484[/C][C]1.5373[/C][/ROW]
[ROW][C]115[/C][C]0.0687[/C][C]-0.1574[/C][C]0.115[/C][C]0.1081[/C][C]1214011.24[/C][C]682312.3568[/C][C]826.022[/C][C]-2.3308[/C][C]1.6034[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302971&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302971&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.0596-0.00170.00170.0017175.798600-0.0280.028
1050.0740.08850.04510.0471469985.0702235080.4344484.85091.45020.7391
1060.0634-0.05360.04790.0488190947.7507220369.5398469.4353-0.92440.8009
1070.0714-0.07990.05590.0558326631.8103246935.1074496.9257-1.2090.9029
1080.0738-0.07330.05940.0588262982.11250144.508500.1445-1.08480.9393
1090.075-0.15750.07570.07331015907.3438377771.6473614.6313-2.13211.1381
1100.0817-0.17330.08970.08561010361.3797468141.609684.2087-2.12631.2793
1110.0736-0.12740.09440.0899728661.97500706.6542707.6063-1.80571.3451
1120.0789-0.11070.09620.0916493849.8834499944.7907707.0677-1.48661.3608
1130.0778-0.15360.10190.0967906786.8471540628.9964735.2748-2.01441.4262
1140.0751-0.20360.11120.10471567447.0776633976.0947796.2262-2.64841.5373
1150.0687-0.15740.1150.10811214011.24682312.3568826.022-2.33081.6034



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