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 computationSat, 24 Dec 2016 10:34:03 +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/24/t1482572071c2bz7ww7a4wgwta.htm/, Retrieved Fri, 01 Nov 2024 03:35:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=303070, Retrieved Fri, 01 Nov 2024 03:35:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact163
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA] [2016-12-24 09:34:03] [695928fec7566687630f1ba48b31beaa] [Current]
Feedback Forum

Post a new message
Dataseries X:
7687
6881
6033
5058
4171
3275
2608
2195
1878
3783
6896
8160
7734
6554
5252
4081
3124
2341
1822
1509
1578
3180
5070
5927
5846
5109
4227
3469
2808
2202
1687
1491
1940
4059
7064
9268
9488
8729
7921
7112
6292
5542
5269
4998
5293
7575
10190
11101
11101
10225
9713
8796
7930
7419
6656
6268
5814
7192
8665
8924
7643
6359
4997
3960
2993
2212
1757
1491
1432
3155
7486
7551
7580
6541
5644
4817
3989
3576
2908
2830
3726
6165
8963
10696
10726
10271
9624
9035
8645
7931
8124
7393
7996
9519
10148
10252
9942
9033
7894
6832
5870
4807
3809
3239
4864
7398
9456
10555
10197
9151
7972
7028
5987
5073
4714
4348
5027
8210
11722
13524
13141
12048
10734
9353
8229
6760




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303070&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])
1024807-------
1033809-------
1043239-------
1054864-------
1067398-------
1079456-------
10810555-------
10910197-------
1109151-------
1117972-------
1127028-------
1135987-------
1145073-------
11547144595.56523616.06095575.06950.40630.16970.94220.1697
11643484255.06932869.84115640.29740.44770.25810.92470.1236
11750274500.06422803.51326196.61520.27130.56970.33710.254
11882106396.71964437.71138355.72790.03480.91470.15820.9073
119117228856.84056666.602811047.07820.00520.71870.29590.9996
120135249785.35297386.067812184.63790.00110.05680.26480.9999
121131419554.61286963.088912146.13670.00330.00130.31350.9996
122120488655.93735887.262711424.61190.00827e-040.3630.9944
123107347715.62624780.473310650.7790.02190.00190.4320.9612
12493536810.09823717.41589902.78070.05350.00640.44510.8645
12582295989.18642746.61839231.75440.08790.0210.50050.7101
12667605261.22251875.39768647.04730.19280.04290.54340.5434

\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 & 4807 & - & - & - & - & - & - & - \tabularnewline
103 & 3809 & - & - & - & - & - & - & - \tabularnewline
104 & 3239 & - & - & - & - & - & - & - \tabularnewline
105 & 4864 & - & - & - & - & - & - & - \tabularnewline
106 & 7398 & - & - & - & - & - & - & - \tabularnewline
107 & 9456 & - & - & - & - & - & - & - \tabularnewline
108 & 10555 & - & - & - & - & - & - & - \tabularnewline
109 & 10197 & - & - & - & - & - & - & - \tabularnewline
110 & 9151 & - & - & - & - & - & - & - \tabularnewline
111 & 7972 & - & - & - & - & - & - & - \tabularnewline
112 & 7028 & - & - & - & - & - & - & - \tabularnewline
113 & 5987 & - & - & - & - & - & - & - \tabularnewline
114 & 5073 & - & - & - & - & - & - & - \tabularnewline
115 & 4714 & 4595.5652 & 3616.0609 & 5575.0695 & 0.4063 & 0.1697 & 0.9422 & 0.1697 \tabularnewline
116 & 4348 & 4255.0693 & 2869.8411 & 5640.2974 & 0.4477 & 0.2581 & 0.9247 & 0.1236 \tabularnewline
117 & 5027 & 4500.0642 & 2803.5132 & 6196.6152 & 0.2713 & 0.5697 & 0.3371 & 0.254 \tabularnewline
118 & 8210 & 6396.7196 & 4437.7113 & 8355.7279 & 0.0348 & 0.9147 & 0.1582 & 0.9073 \tabularnewline
119 & 11722 & 8856.8405 & 6666.6028 & 11047.0782 & 0.0052 & 0.7187 & 0.2959 & 0.9996 \tabularnewline
120 & 13524 & 9785.3529 & 7386.0678 & 12184.6379 & 0.0011 & 0.0568 & 0.2648 & 0.9999 \tabularnewline
121 & 13141 & 9554.6128 & 6963.0889 & 12146.1367 & 0.0033 & 0.0013 & 0.3135 & 0.9996 \tabularnewline
122 & 12048 & 8655.9373 & 5887.2627 & 11424.6119 & 0.0082 & 7e-04 & 0.363 & 0.9944 \tabularnewline
123 & 10734 & 7715.6262 & 4780.4733 & 10650.779 & 0.0219 & 0.0019 & 0.432 & 0.9612 \tabularnewline
124 & 9353 & 6810.0982 & 3717.4158 & 9902.7807 & 0.0535 & 0.0064 & 0.4451 & 0.8645 \tabularnewline
125 & 8229 & 5989.1864 & 2746.6183 & 9231.7544 & 0.0879 & 0.021 & 0.5005 & 0.7101 \tabularnewline
126 & 6760 & 5261.2225 & 1875.3976 & 8647.0473 & 0.1928 & 0.0429 & 0.5434 & 0.5434 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=303070&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]4807[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]3809[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]3239[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4864[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]7398[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]9456[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]10555[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]10197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]9151[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]7972[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]7028[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5987[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]4714[/C][C]4595.5652[/C][C]3616.0609[/C][C]5575.0695[/C][C]0.4063[/C][C]0.1697[/C][C]0.9422[/C][C]0.1697[/C][/ROW]
[ROW][C]116[/C][C]4348[/C][C]4255.0693[/C][C]2869.8411[/C][C]5640.2974[/C][C]0.4477[/C][C]0.2581[/C][C]0.9247[/C][C]0.1236[/C][/ROW]
[ROW][C]117[/C][C]5027[/C][C]4500.0642[/C][C]2803.5132[/C][C]6196.6152[/C][C]0.2713[/C][C]0.5697[/C][C]0.3371[/C][C]0.254[/C][/ROW]
[ROW][C]118[/C][C]8210[/C][C]6396.7196[/C][C]4437.7113[/C][C]8355.7279[/C][C]0.0348[/C][C]0.9147[/C][C]0.1582[/C][C]0.9073[/C][/ROW]
[ROW][C]119[/C][C]11722[/C][C]8856.8405[/C][C]6666.6028[/C][C]11047.0782[/C][C]0.0052[/C][C]0.7187[/C][C]0.2959[/C][C]0.9996[/C][/ROW]
[ROW][C]120[/C][C]13524[/C][C]9785.3529[/C][C]7386.0678[/C][C]12184.6379[/C][C]0.0011[/C][C]0.0568[/C][C]0.2648[/C][C]0.9999[/C][/ROW]
[ROW][C]121[/C][C]13141[/C][C]9554.6128[/C][C]6963.0889[/C][C]12146.1367[/C][C]0.0033[/C][C]0.0013[/C][C]0.3135[/C][C]0.9996[/C][/ROW]
[ROW][C]122[/C][C]12048[/C][C]8655.9373[/C][C]5887.2627[/C][C]11424.6119[/C][C]0.0082[/C][C]7e-04[/C][C]0.363[/C][C]0.9944[/C][/ROW]
[ROW][C]123[/C][C]10734[/C][C]7715.6262[/C][C]4780.4733[/C][C]10650.779[/C][C]0.0219[/C][C]0.0019[/C][C]0.432[/C][C]0.9612[/C][/ROW]
[ROW][C]124[/C][C]9353[/C][C]6810.0982[/C][C]3717.4158[/C][C]9902.7807[/C][C]0.0535[/C][C]0.0064[/C][C]0.4451[/C][C]0.8645[/C][/ROW]
[ROW][C]125[/C][C]8229[/C][C]5989.1864[/C][C]2746.6183[/C][C]9231.7544[/C][C]0.0879[/C][C]0.021[/C][C]0.5005[/C][C]0.7101[/C][/ROW]
[ROW][C]126[/C][C]6760[/C][C]5261.2225[/C][C]1875.3976[/C][C]8647.0473[/C][C]0.1928[/C][C]0.0429[/C][C]0.5434[/C][C]0.5434[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=303070&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303070&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])
1024807-------
1033809-------
1043239-------
1054864-------
1067398-------
1079456-------
10810555-------
10910197-------
1109151-------
1117972-------
1127028-------
1135987-------
1145073-------
11547144595.56523616.06095575.06950.40630.16970.94220.1697
11643484255.06932869.84115640.29740.44770.25810.92470.1236
11750274500.06422803.51326196.61520.27130.56970.33710.254
11882106396.71964437.71138355.72790.03480.91470.15820.9073
119117228856.84056666.602811047.07820.00520.71870.29590.9996
120135249785.35297386.067812184.63790.00110.05680.26480.9999
121131419554.61286963.088912146.13670.00330.00130.31350.9996
122120488655.93735887.262711424.61190.00827e-040.3630.9944
123107347715.62624780.473310650.7790.02190.00190.4320.9612
12493536810.09823717.41589902.78070.05350.00640.44510.8645
12582295989.18642746.61839231.75440.08790.0210.50050.7101
12667605261.22251875.39768647.04730.19280.04290.54340.5434







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.10870.02510.02510.025414026.8053000.07990.0799
1160.16610.02140.02320.02358636.121711331.4635106.44930.06270.0713
1170.19230.10480.05040.0526277661.3065100108.0778316.39860.35550.166
1180.15630.22090.0930.10153287985.7328897077.4916947.14171.22320.4303
1190.12620.24440.12330.13698209138.96712359489.78671536.06311.93280.7308
1200.12510.27640.14880.167513977482.44644295821.89662072.63652.52211.0294
1210.13840.27290.16660.188712862173.05795519586.34822349.382.41941.2279
1220.16320.28150.18090.206111506089.43926267899.23462503.57732.28831.3605
1230.19410.28120.19210.21969110580.69016583752.72972565.88242.03621.4356
1240.23170.27190.20010.22916466349.3626572012.39292563.59361.71541.4635
1250.27620.27220.20660.23695016764.98546430626.26492535.8681.5111.4679
1260.32830.22170.20790.23792246334.08556081935.252466.1581.01111.4298

\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.1087 & 0.0251 & 0.0251 & 0.0254 & 14026.8053 & 0 & 0 & 0.0799 & 0.0799 \tabularnewline
116 & 0.1661 & 0.0214 & 0.0232 & 0.0235 & 8636.1217 & 11331.4635 & 106.4493 & 0.0627 & 0.0713 \tabularnewline
117 & 0.1923 & 0.1048 & 0.0504 & 0.0526 & 277661.3065 & 100108.0778 & 316.3986 & 0.3555 & 0.166 \tabularnewline
118 & 0.1563 & 0.2209 & 0.093 & 0.1015 & 3287985.7328 & 897077.4916 & 947.1417 & 1.2232 & 0.4303 \tabularnewline
119 & 0.1262 & 0.2444 & 0.1233 & 0.1369 & 8209138.9671 & 2359489.7867 & 1536.0631 & 1.9328 & 0.7308 \tabularnewline
120 & 0.1251 & 0.2764 & 0.1488 & 0.1675 & 13977482.4464 & 4295821.8966 & 2072.6365 & 2.5221 & 1.0294 \tabularnewline
121 & 0.1384 & 0.2729 & 0.1666 & 0.1887 & 12862173.0579 & 5519586.3482 & 2349.38 & 2.4194 & 1.2279 \tabularnewline
122 & 0.1632 & 0.2815 & 0.1809 & 0.2061 & 11506089.4392 & 6267899.2346 & 2503.5773 & 2.2883 & 1.3605 \tabularnewline
123 & 0.1941 & 0.2812 & 0.1921 & 0.2196 & 9110580.6901 & 6583752.7297 & 2565.8824 & 2.0362 & 1.4356 \tabularnewline
124 & 0.2317 & 0.2719 & 0.2001 & 0.2291 & 6466349.362 & 6572012.3929 & 2563.5936 & 1.7154 & 1.4635 \tabularnewline
125 & 0.2762 & 0.2722 & 0.2066 & 0.2369 & 5016764.9854 & 6430626.2649 & 2535.868 & 1.511 & 1.4679 \tabularnewline
126 & 0.3283 & 0.2217 & 0.2079 & 0.2379 & 2246334.0855 & 6081935.25 & 2466.158 & 1.0111 & 1.4298 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=303070&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.1087[/C][C]0.0251[/C][C]0.0251[/C][C]0.0254[/C][C]14026.8053[/C][C]0[/C][C]0[/C][C]0.0799[/C][C]0.0799[/C][/ROW]
[ROW][C]116[/C][C]0.1661[/C][C]0.0214[/C][C]0.0232[/C][C]0.0235[/C][C]8636.1217[/C][C]11331.4635[/C][C]106.4493[/C][C]0.0627[/C][C]0.0713[/C][/ROW]
[ROW][C]117[/C][C]0.1923[/C][C]0.1048[/C][C]0.0504[/C][C]0.0526[/C][C]277661.3065[/C][C]100108.0778[/C][C]316.3986[/C][C]0.3555[/C][C]0.166[/C][/ROW]
[ROW][C]118[/C][C]0.1563[/C][C]0.2209[/C][C]0.093[/C][C]0.1015[/C][C]3287985.7328[/C][C]897077.4916[/C][C]947.1417[/C][C]1.2232[/C][C]0.4303[/C][/ROW]
[ROW][C]119[/C][C]0.1262[/C][C]0.2444[/C][C]0.1233[/C][C]0.1369[/C][C]8209138.9671[/C][C]2359489.7867[/C][C]1536.0631[/C][C]1.9328[/C][C]0.7308[/C][/ROW]
[ROW][C]120[/C][C]0.1251[/C][C]0.2764[/C][C]0.1488[/C][C]0.1675[/C][C]13977482.4464[/C][C]4295821.8966[/C][C]2072.6365[/C][C]2.5221[/C][C]1.0294[/C][/ROW]
[ROW][C]121[/C][C]0.1384[/C][C]0.2729[/C][C]0.1666[/C][C]0.1887[/C][C]12862173.0579[/C][C]5519586.3482[/C][C]2349.38[/C][C]2.4194[/C][C]1.2279[/C][/ROW]
[ROW][C]122[/C][C]0.1632[/C][C]0.2815[/C][C]0.1809[/C][C]0.2061[/C][C]11506089.4392[/C][C]6267899.2346[/C][C]2503.5773[/C][C]2.2883[/C][C]1.3605[/C][/ROW]
[ROW][C]123[/C][C]0.1941[/C][C]0.2812[/C][C]0.1921[/C][C]0.2196[/C][C]9110580.6901[/C][C]6583752.7297[/C][C]2565.8824[/C][C]2.0362[/C][C]1.4356[/C][/ROW]
[ROW][C]124[/C][C]0.2317[/C][C]0.2719[/C][C]0.2001[/C][C]0.2291[/C][C]6466349.362[/C][C]6572012.3929[/C][C]2563.5936[/C][C]1.7154[/C][C]1.4635[/C][/ROW]
[ROW][C]125[/C][C]0.2762[/C][C]0.2722[/C][C]0.2066[/C][C]0.2369[/C][C]5016764.9854[/C][C]6430626.2649[/C][C]2535.868[/C][C]1.511[/C][C]1.4679[/C][/ROW]
[ROW][C]126[/C][C]0.3283[/C][C]0.2217[/C][C]0.2079[/C][C]0.2379[/C][C]2246334.0855[/C][C]6081935.25[/C][C]2466.158[/C][C]1.0111[/C][C]1.4298[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=303070&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303070&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.10870.02510.02510.025414026.8053000.07990.0799
1160.16610.02140.02320.02358636.121711331.4635106.44930.06270.0713
1170.19230.10480.05040.0526277661.3065100108.0778316.39860.35550.166
1180.15630.22090.0930.10153287985.7328897077.4916947.14171.22320.4303
1190.12620.24440.12330.13698209138.96712359489.78671536.06311.93280.7308
1200.12510.27640.14880.167513977482.44644295821.89662072.63652.52211.0294
1210.13840.27290.16660.188712862173.05795519586.34822349.382.41941.2279
1220.16320.28150.18090.206111506089.43926267899.23462503.57732.28831.3605
1230.19410.28120.19210.21969110580.69016583752.72972565.88242.03621.4356
1240.23170.27190.20010.22916466349.3626572012.39292563.59361.71541.4635
1250.27620.27220.20660.23695016764.98546430626.26492535.8681.5111.4679
1260.32830.22170.20790.23792246334.08556081935.252466.1581.01111.4298



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