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 computationSun, 18 Jan 2015 12:53:56 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2015/Jan/18/t1421585676nxjrin4weda2bhs.htm/, Retrieved Tue, 14 May 2024 01:59:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=274171, Retrieved Tue, 14 May 2024 01:59:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2015-01-18 12:53:56] [0a6fc2c777821367d2239c664b701a36] [Current]
Feedback Forum

Post a new message
Dataseries X:
1775
2197
2920
4240
5415
6136
6719
6234
7152
3646
2165
2803
1615
2350
3350
3536
5834
6767
5993
7276
5641
3477
2247
2466
1567
2237
2598
3729
5715
5776
5852
6878
5488
3583
2054
2282
1552
2261
2446
3519
5161
5085
5711
6057
5224
3363
1899
2115
1491
2061
2419
3430
4778
4862
6176
5664
5529
3418
1941
2402
1579
2146
2462
3695
4831
5134
6250
5760
6249
2917
1741
2359
1511
2059
2635
2867
4403
5720
4502
5749
5627
2846
1762
2429
1169
2154
2249
2687
4359
5382
4459
6398
4596
3024
1887
2070
1351
2218
2461
3028
4784
4975
4607
6249
4809
3157
1910
2228
1594
2467
2222
3607
4685
4962
5770
5480
5000
3228
1993
2288
1588
2105
2191
3591
4668
4885
5822
5599
5340
3082
2010
2301




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274171&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274171&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274171&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net







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[120])
1082228-------
1091594-------
1102467-------
1112222-------
1123607-------
1134685-------
1144962-------
1155770-------
1165480-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881511.07421351.25751696.36070.207900.19020
12221052349.37942067.21382683.73310.07610.24530.6405
12321912383.76392086.67342738.27340.14330.93840.81440.7018
12435913387.71072860.56434048.44470.27320.99980.25770.9994
12546684816.92033992.85645876.47570.39150.98830.59641
12648855261.16094308.20166507.34080.2770.82460.6811
12758225456.85994428.29986818.89740.29960.79470.32611
12855995984.25474828.65717526.74330.31220.58170.73921
12953405216.1124221.09636538.88130.42720.28520.62561
13030823213.58192669.12353911.70480.355900.48390.9953
13120101938.40741651.17892294.12590.346600.38180.027
13223012297.85921936.37262752.21560.49460.89280.5170.517

\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[120]) \tabularnewline
108 & 2228 & - & - & - & - & - & - & - \tabularnewline
109 & 1594 & - & - & - & - & - & - & - \tabularnewline
110 & 2467 & - & - & - & - & - & - & - \tabularnewline
111 & 2222 & - & - & - & - & - & - & - \tabularnewline
112 & 3607 & - & - & - & - & - & - & - \tabularnewline
113 & 4685 & - & - & - & - & - & - & - \tabularnewline
114 & 4962 & - & - & - & - & - & - & - \tabularnewline
115 & 5770 & - & - & - & - & - & - & - \tabularnewline
116 & 5480 & - & - & - & - & - & - & - \tabularnewline
117 & 5000 & - & - & - & - & - & - & - \tabularnewline
118 & 3228 & - & - & - & - & - & - & - \tabularnewline
119 & 1993 & - & - & - & - & - & - & - \tabularnewline
120 & 2288 & - & - & - & - & - & - & - \tabularnewline
121 & 1588 & 1511.0742 & 1351.2575 & 1696.3607 & 0.2079 & 0 & 0.1902 & 0 \tabularnewline
122 & 2105 & 2349.3794 & 2067.2138 & 2683.7331 & 0.076 & 1 & 0.2453 & 0.6405 \tabularnewline
123 & 2191 & 2383.7639 & 2086.6734 & 2738.2734 & 0.1433 & 0.9384 & 0.8144 & 0.7018 \tabularnewline
124 & 3591 & 3387.7107 & 2860.5643 & 4048.4447 & 0.2732 & 0.9998 & 0.2577 & 0.9994 \tabularnewline
125 & 4668 & 4816.9203 & 3992.8564 & 5876.4757 & 0.3915 & 0.9883 & 0.5964 & 1 \tabularnewline
126 & 4885 & 5261.1609 & 4308.2016 & 6507.3408 & 0.277 & 0.8246 & 0.681 & 1 \tabularnewline
127 & 5822 & 5456.8599 & 4428.2998 & 6818.8974 & 0.2996 & 0.7947 & 0.3261 & 1 \tabularnewline
128 & 5599 & 5984.2547 & 4828.6571 & 7526.7433 & 0.3122 & 0.5817 & 0.7392 & 1 \tabularnewline
129 & 5340 & 5216.112 & 4221.0963 & 6538.8813 & 0.4272 & 0.2852 & 0.6256 & 1 \tabularnewline
130 & 3082 & 3213.5819 & 2669.1235 & 3911.7048 & 0.3559 & 0 & 0.4839 & 0.9953 \tabularnewline
131 & 2010 & 1938.4074 & 1651.1789 & 2294.1259 & 0.3466 & 0 & 0.3818 & 0.027 \tabularnewline
132 & 2301 & 2297.8592 & 1936.3726 & 2752.2156 & 0.4946 & 0.8928 & 0.517 & 0.517 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274171&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[120])[/C][/ROW]
[ROW][C]108[/C][C]2228[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]2467[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]2222[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]3607[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]4685[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4962[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5770[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]5480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]5000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]3228[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]1993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]2288[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]1588[/C][C]1511.0742[/C][C]1351.2575[/C][C]1696.3607[/C][C]0.2079[/C][C]0[/C][C]0.1902[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]2105[/C][C]2349.3794[/C][C]2067.2138[/C][C]2683.7331[/C][C]0.076[/C][C]1[/C][C]0.2453[/C][C]0.6405[/C][/ROW]
[ROW][C]123[/C][C]2191[/C][C]2383.7639[/C][C]2086.6734[/C][C]2738.2734[/C][C]0.1433[/C][C]0.9384[/C][C]0.8144[/C][C]0.7018[/C][/ROW]
[ROW][C]124[/C][C]3591[/C][C]3387.7107[/C][C]2860.5643[/C][C]4048.4447[/C][C]0.2732[/C][C]0.9998[/C][C]0.2577[/C][C]0.9994[/C][/ROW]
[ROW][C]125[/C][C]4668[/C][C]4816.9203[/C][C]3992.8564[/C][C]5876.4757[/C][C]0.3915[/C][C]0.9883[/C][C]0.5964[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]4885[/C][C]5261.1609[/C][C]4308.2016[/C][C]6507.3408[/C][C]0.277[/C][C]0.8246[/C][C]0.681[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5822[/C][C]5456.8599[/C][C]4428.2998[/C][C]6818.8974[/C][C]0.2996[/C][C]0.7947[/C][C]0.3261[/C][C]1[/C][/ROW]
[ROW][C]128[/C][C]5599[/C][C]5984.2547[/C][C]4828.6571[/C][C]7526.7433[/C][C]0.3122[/C][C]0.5817[/C][C]0.7392[/C][C]1[/C][/ROW]
[ROW][C]129[/C][C]5340[/C][C]5216.112[/C][C]4221.0963[/C][C]6538.8813[/C][C]0.4272[/C][C]0.2852[/C][C]0.6256[/C][C]1[/C][/ROW]
[ROW][C]130[/C][C]3082[/C][C]3213.5819[/C][C]2669.1235[/C][C]3911.7048[/C][C]0.3559[/C][C]0[/C][C]0.4839[/C][C]0.9953[/C][/ROW]
[ROW][C]131[/C][C]2010[/C][C]1938.4074[/C][C]1651.1789[/C][C]2294.1259[/C][C]0.3466[/C][C]0[/C][C]0.3818[/C][C]0.027[/C][/ROW]
[ROW][C]132[/C][C]2301[/C][C]2297.8592[/C][C]1936.3726[/C][C]2752.2156[/C][C]0.4946[/C][C]0.8928[/C][C]0.517[/C][C]0.517[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274171&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274171&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[120])
1082228-------
1091594-------
1102467-------
1112222-------
1123607-------
1134685-------
1144962-------
1155770-------
1165480-------
1175000-------
1183228-------
1191993-------
1202288-------
12115881511.07421351.25751696.36070.207900.19020
12221052349.37942067.21382683.73310.07610.24530.6405
12321912383.76392086.67342738.27340.14330.93840.81440.7018
12435913387.71072860.56434048.44470.27320.99980.25770.9994
12546684816.92033992.85645876.47570.39150.98830.59641
12648855261.16094308.20166507.34080.2770.82460.6811
12758225456.85994428.29986818.89740.29960.79470.32611
12855995984.25474828.65717526.74330.31220.58170.73921
12953405216.1124221.09636538.88130.42720.28520.62561
13030823213.58192669.12353911.70480.355900.48390.9953
13120101938.40741651.17892294.12590.346600.38180.027
13223012297.85921936.37262752.21560.49460.89280.5170.517







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.06260.04840.04840.04965917.5794000.10150.1015
1220.0726-0.11610.08230.079759721.307832819.4436181.1614-0.32240.212
1230.0759-0.0880.08420.081237157.915534265.6009185.1097-0.25430.2261
1240.09950.05660.07730.075541326.529636030.8331189.81790.26820.2366
1250.1122-0.03190.06820.066722177.253833260.1172182.3736-0.19650.2286
1260.1208-0.0770.06970.0679141497.014751299.6001226.4942-0.49630.2732
1270.12730.06270.06870.0675133327.275663017.8395251.03350.48180.303
1280.1315-0.06880.06870.0673148421.189773693.2583271.465-0.50830.3287
1290.12940.02320.06360.062515348.244167210.4789259.24980.16350.3103
1300.1108-0.04270.06150.060417313.795562220.8106249.441-0.17360.2966
1310.09360.03560.05920.05825125.498657030.3277238.81020.09450.2783
1320.10090.00140.05440.05359.864552278.6224228.64520.00410.2554

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
121 & 0.0626 & 0.0484 & 0.0484 & 0.0496 & 5917.5794 & 0 & 0 & 0.1015 & 0.1015 \tabularnewline
122 & 0.0726 & -0.1161 & 0.0823 & 0.0797 & 59721.3078 & 32819.4436 & 181.1614 & -0.3224 & 0.212 \tabularnewline
123 & 0.0759 & -0.088 & 0.0842 & 0.0812 & 37157.9155 & 34265.6009 & 185.1097 & -0.2543 & 0.2261 \tabularnewline
124 & 0.0995 & 0.0566 & 0.0773 & 0.0755 & 41326.5296 & 36030.8331 & 189.8179 & 0.2682 & 0.2366 \tabularnewline
125 & 0.1122 & -0.0319 & 0.0682 & 0.0667 & 22177.2538 & 33260.1172 & 182.3736 & -0.1965 & 0.2286 \tabularnewline
126 & 0.1208 & -0.077 & 0.0697 & 0.0679 & 141497.0147 & 51299.6001 & 226.4942 & -0.4963 & 0.2732 \tabularnewline
127 & 0.1273 & 0.0627 & 0.0687 & 0.0675 & 133327.2756 & 63017.8395 & 251.0335 & 0.4818 & 0.303 \tabularnewline
128 & 0.1315 & -0.0688 & 0.0687 & 0.0673 & 148421.1897 & 73693.2583 & 271.465 & -0.5083 & 0.3287 \tabularnewline
129 & 0.1294 & 0.0232 & 0.0636 & 0.0625 & 15348.2441 & 67210.4789 & 259.2498 & 0.1635 & 0.3103 \tabularnewline
130 & 0.1108 & -0.0427 & 0.0615 & 0.0604 & 17313.7955 & 62220.8106 & 249.441 & -0.1736 & 0.2966 \tabularnewline
131 & 0.0936 & 0.0356 & 0.0592 & 0.0582 & 5125.4986 & 57030.3277 & 238.8102 & 0.0945 & 0.2783 \tabularnewline
132 & 0.1009 & 0.0014 & 0.0544 & 0.0535 & 9.8645 & 52278.6224 & 228.6452 & 0.0041 & 0.2554 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=274171&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]121[/C][C]0.0626[/C][C]0.0484[/C][C]0.0484[/C][C]0.0496[/C][C]5917.5794[/C][C]0[/C][C]0[/C][C]0.1015[/C][C]0.1015[/C][/ROW]
[ROW][C]122[/C][C]0.0726[/C][C]-0.1161[/C][C]0.0823[/C][C]0.0797[/C][C]59721.3078[/C][C]32819.4436[/C][C]181.1614[/C][C]-0.3224[/C][C]0.212[/C][/ROW]
[ROW][C]123[/C][C]0.0759[/C][C]-0.088[/C][C]0.0842[/C][C]0.0812[/C][C]37157.9155[/C][C]34265.6009[/C][C]185.1097[/C][C]-0.2543[/C][C]0.2261[/C][/ROW]
[ROW][C]124[/C][C]0.0995[/C][C]0.0566[/C][C]0.0773[/C][C]0.0755[/C][C]41326.5296[/C][C]36030.8331[/C][C]189.8179[/C][C]0.2682[/C][C]0.2366[/C][/ROW]
[ROW][C]125[/C][C]0.1122[/C][C]-0.0319[/C][C]0.0682[/C][C]0.0667[/C][C]22177.2538[/C][C]33260.1172[/C][C]182.3736[/C][C]-0.1965[/C][C]0.2286[/C][/ROW]
[ROW][C]126[/C][C]0.1208[/C][C]-0.077[/C][C]0.0697[/C][C]0.0679[/C][C]141497.0147[/C][C]51299.6001[/C][C]226.4942[/C][C]-0.4963[/C][C]0.2732[/C][/ROW]
[ROW][C]127[/C][C]0.1273[/C][C]0.0627[/C][C]0.0687[/C][C]0.0675[/C][C]133327.2756[/C][C]63017.8395[/C][C]251.0335[/C][C]0.4818[/C][C]0.303[/C][/ROW]
[ROW][C]128[/C][C]0.1315[/C][C]-0.0688[/C][C]0.0687[/C][C]0.0673[/C][C]148421.1897[/C][C]73693.2583[/C][C]271.465[/C][C]-0.5083[/C][C]0.3287[/C][/ROW]
[ROW][C]129[/C][C]0.1294[/C][C]0.0232[/C][C]0.0636[/C][C]0.0625[/C][C]15348.2441[/C][C]67210.4789[/C][C]259.2498[/C][C]0.1635[/C][C]0.3103[/C][/ROW]
[ROW][C]130[/C][C]0.1108[/C][C]-0.0427[/C][C]0.0615[/C][C]0.0604[/C][C]17313.7955[/C][C]62220.8106[/C][C]249.441[/C][C]-0.1736[/C][C]0.2966[/C][/ROW]
[ROW][C]131[/C][C]0.0936[/C][C]0.0356[/C][C]0.0592[/C][C]0.0582[/C][C]5125.4986[/C][C]57030.3277[/C][C]238.8102[/C][C]0.0945[/C][C]0.2783[/C][/ROW]
[ROW][C]132[/C][C]0.1009[/C][C]0.0014[/C][C]0.0544[/C][C]0.0535[/C][C]9.8645[/C][C]52278.6224[/C][C]228.6452[/C][C]0.0041[/C][C]0.2554[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=274171&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=274171&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
1210.06260.04840.04840.04965917.5794000.10150.1015
1220.0726-0.11610.08230.079759721.307832819.4436181.1614-0.32240.212
1230.0759-0.0880.08420.081237157.915534265.6009185.1097-0.25430.2261
1240.09950.05660.07730.075541326.529636030.8331189.81790.26820.2366
1250.1122-0.03190.06820.066722177.253833260.1172182.3736-0.19650.2286
1260.1208-0.0770.06970.0679141497.014751299.6001226.4942-0.49630.2732
1270.12730.06270.06870.0675133327.275663017.8395251.03350.48180.303
1280.1315-0.06880.06870.0673148421.189773693.2583271.465-0.50830.3287
1290.12940.02320.06360.062515348.244167210.4789259.24980.16350.3103
1300.1108-0.04270.06150.060417313.795562220.8106249.441-0.17360.2966
1310.09360.03560.05920.05825125.498657030.3277238.81020.09450.2783
1320.10090.00140.05440.05359.864552278.6224228.64520.00410.2554



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