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:44:56 +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/t1482342387rz5uscrw3ot3ga3.htm/, Retrieved Mon, 06 May 2024 15:16:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302445, Retrieved Mon, 06 May 2024 15:16:54 +0000
QR Codes:

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

Post a new message
Dataseries X:
2490
2560
2890
3420
2700
3290
2650
3060
3200
4600
4370
3340
2410
1920
2620
2840
2880
2380
2820
2480
3230
3860
5050
3630
1700
2590
2130
2350
2680
2270
2810
2200
3420
4300
3440
2670
2460
1920
2890
2600
2860
2010
2470
2210
3530
3790
3520
2510
1860
1760
1540
2240
2600
3060
2040
2230
2720
3740
3100
2100
3630
1620
1870
1680
1830
4620
1560
2800
1810
4260
2770
3280
1830
2590
1760
2950
2020
2530
2530
2220
2250
2630
3550
2670
2260
2170
2430
1700
2200
3140
1900
2260
3580
3050
3130
2350
1650
1760
2010
1910
1850
2030
2110
1900
2170
2690
3620
1920
1480
3910
2120
1980
2040
1820
1700
2210
2070
2650
3260
1590
1880
1390
1890
1640
1840
1620




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302445&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[114])
1022030-------
1032110-------
1041900-------
1052170-------
1062690-------
1073620-------
1081920-------
1091480-------
1103910-------
1112120-------
1121980-------
1132040-------
1141820-------
11517002195.53641394.51693456.66650.22060.72030.55290.7203
11622101972.50321245.41093124.08460.3430.67860.54910.6024
11720702559.54261600.62164092.94620.26570.67250.69070.8277
11826502895.3241809.01124633.96850.39110.82390.59150.8873
11932603426.16252139.59775486.35350.43720.76990.42680.9368
12015902222.30581387.69013558.89460.17690.0640.67120.7224
12118801713.26971069.79742743.78410.37560.59270.67140.4196
12213902706.23741689.8144334.03990.05650.84010.07360.857
12318902090.5181305.34723347.97190.37730.86260.48170.6634
12416401982.41481237.84553174.84570.28680.56040.50160.6053
12518402025.23961264.58573243.43030.38280.73230.49050.6294
12616202160.55211349.07653460.1340.20750.68560.69620.6962

\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[114]) \tabularnewline
102 & 2030 & - & - & - & - & - & - & - \tabularnewline
103 & 2110 & - & - & - & - & - & - & - \tabularnewline
104 & 1900 & - & - & - & - & - & - & - \tabularnewline
105 & 2170 & - & - & - & - & - & - & - \tabularnewline
106 & 2690 & - & - & - & - & - & - & - \tabularnewline
107 & 3620 & - & - & - & - & - & - & - \tabularnewline
108 & 1920 & - & - & - & - & - & - & - \tabularnewline
109 & 1480 & - & - & - & - & - & - & - \tabularnewline
110 & 3910 & - & - & - & - & - & - & - \tabularnewline
111 & 2120 & - & - & - & - & - & - & - \tabularnewline
112 & 1980 & - & - & - & - & - & - & - \tabularnewline
113 & 2040 & - & - & - & - & - & - & - \tabularnewline
114 & 1820 & - & - & - & - & - & - & - \tabularnewline
115 & 1700 & 2195.5364 & 1394.5169 & 3456.6665 & 0.2206 & 0.7203 & 0.5529 & 0.7203 \tabularnewline
116 & 2210 & 1972.5032 & 1245.4109 & 3124.0846 & 0.343 & 0.6786 & 0.5491 & 0.6024 \tabularnewline
117 & 2070 & 2559.5426 & 1600.6216 & 4092.9462 & 0.2657 & 0.6725 & 0.6907 & 0.8277 \tabularnewline
118 & 2650 & 2895.324 & 1809.0112 & 4633.9685 & 0.3911 & 0.8239 & 0.5915 & 0.8873 \tabularnewline
119 & 3260 & 3426.1625 & 2139.5977 & 5486.3535 & 0.4372 & 0.7699 & 0.4268 & 0.9368 \tabularnewline
120 & 1590 & 2222.3058 & 1387.6901 & 3558.8946 & 0.1769 & 0.064 & 0.6712 & 0.7224 \tabularnewline
121 & 1880 & 1713.2697 & 1069.7974 & 2743.7841 & 0.3756 & 0.5927 & 0.6714 & 0.4196 \tabularnewline
122 & 1390 & 2706.2374 & 1689.814 & 4334.0399 & 0.0565 & 0.8401 & 0.0736 & 0.857 \tabularnewline
123 & 1890 & 2090.518 & 1305.3472 & 3347.9719 & 0.3773 & 0.8626 & 0.4817 & 0.6634 \tabularnewline
124 & 1640 & 1982.4148 & 1237.8455 & 3174.8457 & 0.2868 & 0.5604 & 0.5016 & 0.6053 \tabularnewline
125 & 1840 & 2025.2396 & 1264.5857 & 3243.4303 & 0.3828 & 0.7323 & 0.4905 & 0.6294 \tabularnewline
126 & 1620 & 2160.5521 & 1349.0765 & 3460.134 & 0.2075 & 0.6856 & 0.6962 & 0.6962 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302445&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[114])[/C][/ROW]
[ROW][C]102[/C][C]2030[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]2110[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]1900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]2170[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]2690[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]3620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]1920[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]3910[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]2120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]1980[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]2040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]1820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]1700[/C][C]2195.5364[/C][C]1394.5169[/C][C]3456.6665[/C][C]0.2206[/C][C]0.7203[/C][C]0.5529[/C][C]0.7203[/C][/ROW]
[ROW][C]116[/C][C]2210[/C][C]1972.5032[/C][C]1245.4109[/C][C]3124.0846[/C][C]0.343[/C][C]0.6786[/C][C]0.5491[/C][C]0.6024[/C][/ROW]
[ROW][C]117[/C][C]2070[/C][C]2559.5426[/C][C]1600.6216[/C][C]4092.9462[/C][C]0.2657[/C][C]0.6725[/C][C]0.6907[/C][C]0.8277[/C][/ROW]
[ROW][C]118[/C][C]2650[/C][C]2895.324[/C][C]1809.0112[/C][C]4633.9685[/C][C]0.3911[/C][C]0.8239[/C][C]0.5915[/C][C]0.8873[/C][/ROW]
[ROW][C]119[/C][C]3260[/C][C]3426.1625[/C][C]2139.5977[/C][C]5486.3535[/C][C]0.4372[/C][C]0.7699[/C][C]0.4268[/C][C]0.9368[/C][/ROW]
[ROW][C]120[/C][C]1590[/C][C]2222.3058[/C][C]1387.6901[/C][C]3558.8946[/C][C]0.1769[/C][C]0.064[/C][C]0.6712[/C][C]0.7224[/C][/ROW]
[ROW][C]121[/C][C]1880[/C][C]1713.2697[/C][C]1069.7974[/C][C]2743.7841[/C][C]0.3756[/C][C]0.5927[/C][C]0.6714[/C][C]0.4196[/C][/ROW]
[ROW][C]122[/C][C]1390[/C][C]2706.2374[/C][C]1689.814[/C][C]4334.0399[/C][C]0.0565[/C][C]0.8401[/C][C]0.0736[/C][C]0.857[/C][/ROW]
[ROW][C]123[/C][C]1890[/C][C]2090.518[/C][C]1305.3472[/C][C]3347.9719[/C][C]0.3773[/C][C]0.8626[/C][C]0.4817[/C][C]0.6634[/C][/ROW]
[ROW][C]124[/C][C]1640[/C][C]1982.4148[/C][C]1237.8455[/C][C]3174.8457[/C][C]0.2868[/C][C]0.5604[/C][C]0.5016[/C][C]0.6053[/C][/ROW]
[ROW][C]125[/C][C]1840[/C][C]2025.2396[/C][C]1264.5857[/C][C]3243.4303[/C][C]0.3828[/C][C]0.7323[/C][C]0.4905[/C][C]0.6294[/C][/ROW]
[ROW][C]126[/C][C]1620[/C][C]2160.5521[/C][C]1349.0765[/C][C]3460.134[/C][C]0.2075[/C][C]0.6856[/C][C]0.6962[/C][C]0.6962[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302445&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302445&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[114])
1022030-------
1032110-------
1041900-------
1052170-------
1062690-------
1073620-------
1081920-------
1091480-------
1103910-------
1112120-------
1121980-------
1132040-------
1141820-------
11517002195.53641394.51693456.66650.22060.72030.55290.7203
11622101972.50321245.41093124.08460.3430.67860.54910.6024
11720702559.54261600.62164092.94620.26570.67250.69070.8277
11826502895.3241809.01124633.96850.39110.82390.59150.8873
11932603426.16252139.59775486.35350.43720.76990.42680.9368
12015902222.30581387.69013558.89460.17690.0640.67120.7224
12118801713.26971069.79742743.78410.37560.59270.67140.4196
12213902706.23741689.8144334.03990.05650.84010.07360.857
12318902090.5181305.34723347.97190.37730.86260.48170.6634
12416401982.41481237.84553174.84570.28680.56040.50160.6053
12518402025.23961264.58573243.43030.38280.73230.49050.6294
12616202160.55211349.07653460.1340.20750.68560.69620.6962







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.2931-0.29150.29150.2544245556.313900-0.99830.9983
1160.29790.10750.19950.18456404.7295150980.5217388.56210.47850.7384
1170.3057-0.23650.21180.1932239651.9339180537.6591424.8972-0.98630.821
1180.3064-0.09260.1820.16760183.8464150449.2059387.8778-0.49420.7393
1190.3068-0.0510.15580.143527609.985125881.3617354.7976-0.33480.6584
1200.3069-0.39770.19610.1749399810.5887171536.2329414.1693-1.27390.761
1210.30690.08870.18080.163227798.9862151002.3405388.59020.33590.7003
1220.3069-0.94690.27650.22311732480.9798348687.1704590.4974-2.65180.9442
1230.3069-0.10610.25760.209540207.4773314411.649560.7242-0.4040.8842
1240.3069-0.20880.25270.2075117247.8832294695.2724542.8584-0.68980.8647
1250.3069-0.10070.23890.197334313.7188271024.2221520.5999-0.37320.8201
1260.3069-0.33370.24680.2047292196.6148272788.5881522.2917-1.0890.8425

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.2931 & -0.2915 & 0.2915 & 0.2544 & 245556.3139 & 0 & 0 & -0.9983 & 0.9983 \tabularnewline
116 & 0.2979 & 0.1075 & 0.1995 & 0.184 & 56404.7295 & 150980.5217 & 388.5621 & 0.4785 & 0.7384 \tabularnewline
117 & 0.3057 & -0.2365 & 0.2118 & 0.1932 & 239651.9339 & 180537.6591 & 424.8972 & -0.9863 & 0.821 \tabularnewline
118 & 0.3064 & -0.0926 & 0.182 & 0.167 & 60183.8464 & 150449.2059 & 387.8778 & -0.4942 & 0.7393 \tabularnewline
119 & 0.3068 & -0.051 & 0.1558 & 0.1435 & 27609.985 & 125881.3617 & 354.7976 & -0.3348 & 0.6584 \tabularnewline
120 & 0.3069 & -0.3977 & 0.1961 & 0.1749 & 399810.5887 & 171536.2329 & 414.1693 & -1.2739 & 0.761 \tabularnewline
121 & 0.3069 & 0.0887 & 0.1808 & 0.1632 & 27798.9862 & 151002.3405 & 388.5902 & 0.3359 & 0.7003 \tabularnewline
122 & 0.3069 & -0.9469 & 0.2765 & 0.2231 & 1732480.9798 & 348687.1704 & 590.4974 & -2.6518 & 0.9442 \tabularnewline
123 & 0.3069 & -0.1061 & 0.2576 & 0.2095 & 40207.4773 & 314411.649 & 560.7242 & -0.404 & 0.8842 \tabularnewline
124 & 0.3069 & -0.2088 & 0.2527 & 0.2075 & 117247.8832 & 294695.2724 & 542.8584 & -0.6898 & 0.8647 \tabularnewline
125 & 0.3069 & -0.1007 & 0.2389 & 0.1973 & 34313.7188 & 271024.2221 & 520.5999 & -0.3732 & 0.8201 \tabularnewline
126 & 0.3069 & -0.3337 & 0.2468 & 0.2047 & 292196.6148 & 272788.5881 & 522.2917 & -1.089 & 0.8425 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302445&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]115[/C][C]0.2931[/C][C]-0.2915[/C][C]0.2915[/C][C]0.2544[/C][C]245556.3139[/C][C]0[/C][C]0[/C][C]-0.9983[/C][C]0.9983[/C][/ROW]
[ROW][C]116[/C][C]0.2979[/C][C]0.1075[/C][C]0.1995[/C][C]0.184[/C][C]56404.7295[/C][C]150980.5217[/C][C]388.5621[/C][C]0.4785[/C][C]0.7384[/C][/ROW]
[ROW][C]117[/C][C]0.3057[/C][C]-0.2365[/C][C]0.2118[/C][C]0.1932[/C][C]239651.9339[/C][C]180537.6591[/C][C]424.8972[/C][C]-0.9863[/C][C]0.821[/C][/ROW]
[ROW][C]118[/C][C]0.3064[/C][C]-0.0926[/C][C]0.182[/C][C]0.167[/C][C]60183.8464[/C][C]150449.2059[/C][C]387.8778[/C][C]-0.4942[/C][C]0.7393[/C][/ROW]
[ROW][C]119[/C][C]0.3068[/C][C]-0.051[/C][C]0.1558[/C][C]0.1435[/C][C]27609.985[/C][C]125881.3617[/C][C]354.7976[/C][C]-0.3348[/C][C]0.6584[/C][/ROW]
[ROW][C]120[/C][C]0.3069[/C][C]-0.3977[/C][C]0.1961[/C][C]0.1749[/C][C]399810.5887[/C][C]171536.2329[/C][C]414.1693[/C][C]-1.2739[/C][C]0.761[/C][/ROW]
[ROW][C]121[/C][C]0.3069[/C][C]0.0887[/C][C]0.1808[/C][C]0.1632[/C][C]27798.9862[/C][C]151002.3405[/C][C]388.5902[/C][C]0.3359[/C][C]0.7003[/C][/ROW]
[ROW][C]122[/C][C]0.3069[/C][C]-0.9469[/C][C]0.2765[/C][C]0.2231[/C][C]1732480.9798[/C][C]348687.1704[/C][C]590.4974[/C][C]-2.6518[/C][C]0.9442[/C][/ROW]
[ROW][C]123[/C][C]0.3069[/C][C]-0.1061[/C][C]0.2576[/C][C]0.2095[/C][C]40207.4773[/C][C]314411.649[/C][C]560.7242[/C][C]-0.404[/C][C]0.8842[/C][/ROW]
[ROW][C]124[/C][C]0.3069[/C][C]-0.2088[/C][C]0.2527[/C][C]0.2075[/C][C]117247.8832[/C][C]294695.2724[/C][C]542.8584[/C][C]-0.6898[/C][C]0.8647[/C][/ROW]
[ROW][C]125[/C][C]0.3069[/C][C]-0.1007[/C][C]0.2389[/C][C]0.1973[/C][C]34313.7188[/C][C]271024.2221[/C][C]520.5999[/C][C]-0.3732[/C][C]0.8201[/C][/ROW]
[ROW][C]126[/C][C]0.3069[/C][C]-0.3337[/C][C]0.2468[/C][C]0.2047[/C][C]292196.6148[/C][C]272788.5881[/C][C]522.2917[/C][C]-1.089[/C][C]0.8425[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302445&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302445&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
1150.2931-0.29150.29150.2544245556.313900-0.99830.9983
1160.29790.10750.19950.18456404.7295150980.5217388.56210.47850.7384
1170.3057-0.23650.21180.1932239651.9339180537.6591424.8972-0.98630.821
1180.3064-0.09260.1820.16760183.8464150449.2059387.8778-0.49420.7393
1190.3068-0.0510.15580.143527609.985125881.3617354.7976-0.33480.6584
1200.3069-0.39770.19610.1749399810.5887171536.2329414.1693-1.27390.761
1210.30690.08870.18080.163227798.9862151002.3405388.59020.33590.7003
1220.3069-0.94690.27650.22311732480.9798348687.1704590.4974-2.65180.9442
1230.3069-0.10610.25760.209540207.4773314411.649560.7242-0.4040.8842
1240.3069-0.20880.25270.2075117247.8832294695.2724542.8584-0.68980.8647
1250.3069-0.10070.23890.197334313.7188271024.2221520.5999-0.37320.8201
1260.3069-0.33370.24680.2047292196.6148272788.5881522.2917-1.0890.8425



Parameters (Session):
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')