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, 08 Dec 2017 18:00:21 +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/2017/Dec/08/t1512752495fk7nrxwy1kl6bxs.htm/, Retrieved Tue, 14 May 2024 00:43:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=308820, Retrieved Tue, 14 May 2024 00:43:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsDataset 3 LBE
Estimated Impact57
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting...] [2017-12-08 17:00:21] [3c189a0c4f7caff37e2cfca896353419] [Current]
Feedback Forum

Post a new message
Dataseries X:
46.8
52.8
58.3
54.5
64.7
58.3
57.5
56.7
56
66.2
58.2
53.9
53.1
54.4
59.2
57.8
61.5
60.1
60.1
58.4
56.8
63.8
53.9
63.1
55.7
54.9
64.6
60.2
63.9
69.9
58.5
52
66.7
72
68.4
70.8
56.5
62.6
66.5
69.2
63.7
73.6
64.1
53.8
72.2
80.2
69.1
72
66.3
72.5
88.9
88.6
73.7
86
70
71.6
90.5
85.7
84.8
81.1
70.8
65.7
86.2
76.1
79.8
85.2
75.8
69.4
85
75
77.7
68.5
68.4
65
73.2
67.9
76.5
85.5
71.7
57.9
75.5
78.2
75.7
67.1
74.6
66.2
74.9
69.5
76.1
82.3
82.1
60.5
71.2
81.4
74.5
61.4
83.8
85.4
91.6
91.9
86.3
96.8
81
70.8
98.8
94.5
84.5
92.8
81.2
75.7
86.7
87.5
87.8
103.1
96.4
77.1
106.5
95.7
95.3
86.6
89.6
81.9
98.4
92.9
83.9
121.8
103.9
87.5
118.9
109
112.2
100.1
111.3
102.7
122.6
124.8
120.3
118.3
108.7
100.7
124
103.1
115
112.7
101.7
111.5
114.4
112.5
107.2
136.7
107.8
94.6
110.7
126.6
127.9
109.2
87.1
90.8
94.5
103.3
103.2
105.4
103.9
79.8
105.6
113
87.7
110
90.3
108.9
105.1
113
100.4
110.1
114.7
88.6
117.2
127.7
107.8
102.8
100.2
108.4
114.2
94.4
92.2
115.3
102
86.3
112
112.5
109.5
105.9
115.3
126.2
112.2
112.5
106.9
90.6
75.6
78.8
101.8
93.9
100
89.2
97.7
121.1
108.8
92.9
113.6
112.6
98.8
78




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308820&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 time6 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[200])
18886.3-------
189112-------
190112.5-------
191109.5-------
192105.9-------
193115.3-------
194126.2-------
195112.2-------
196112.5-------
197106.9-------
19890.6-------
19975.6-------
20078.8-------
201101.898.415382.4292118.26970.36910.97360.08990.9736
20293.9101.984784.3695124.20270.23790.50650.17680.9796
20310098.469580.8067120.97370.4470.65470.16840.9567
20489.295.552277.7445118.48580.29360.35190.18820.9239
20597.794.109876.1913117.33050.38090.66070.03680.9019
206121.197.781778.58122.89820.03440.50250.01330.9307
207108.8103.204682.3113130.7960.34550.10180.26140.9585
20892.9101.558480.6626129.29790.27030.30440.21970.9461
209113.699.595778.7998127.33730.16120.68190.30290.9291
210112.6103.559281.4156133.33750.27590.25430.80320.9484
21198.891.568472.0862117.72270.29390.05750.88430.8307
2127882.494264.9846105.98110.35380.08680.62110.6211

\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[200]) \tabularnewline
188 & 86.3 & - & - & - & - & - & - & - \tabularnewline
189 & 112 & - & - & - & - & - & - & - \tabularnewline
190 & 112.5 & - & - & - & - & - & - & - \tabularnewline
191 & 109.5 & - & - & - & - & - & - & - \tabularnewline
192 & 105.9 & - & - & - & - & - & - & - \tabularnewline
193 & 115.3 & - & - & - & - & - & - & - \tabularnewline
194 & 126.2 & - & - & - & - & - & - & - \tabularnewline
195 & 112.2 & - & - & - & - & - & - & - \tabularnewline
196 & 112.5 & - & - & - & - & - & - & - \tabularnewline
197 & 106.9 & - & - & - & - & - & - & - \tabularnewline
198 & 90.6 & - & - & - & - & - & - & - \tabularnewline
199 & 75.6 & - & - & - & - & - & - & - \tabularnewline
200 & 78.8 & - & - & - & - & - & - & - \tabularnewline
201 & 101.8 & 98.4153 & 82.4292 & 118.2697 & 0.3691 & 0.9736 & 0.0899 & 0.9736 \tabularnewline
202 & 93.9 & 101.9847 & 84.3695 & 124.2027 & 0.2379 & 0.5065 & 0.1768 & 0.9796 \tabularnewline
203 & 100 & 98.4695 & 80.8067 & 120.9737 & 0.447 & 0.6547 & 0.1684 & 0.9567 \tabularnewline
204 & 89.2 & 95.5522 & 77.7445 & 118.4858 & 0.2936 & 0.3519 & 0.1882 & 0.9239 \tabularnewline
205 & 97.7 & 94.1098 & 76.1913 & 117.3305 & 0.3809 & 0.6607 & 0.0368 & 0.9019 \tabularnewline
206 & 121.1 & 97.7817 & 78.58 & 122.8982 & 0.0344 & 0.5025 & 0.0133 & 0.9307 \tabularnewline
207 & 108.8 & 103.2046 & 82.3113 & 130.796 & 0.3455 & 0.1018 & 0.2614 & 0.9585 \tabularnewline
208 & 92.9 & 101.5584 & 80.6626 & 129.2979 & 0.2703 & 0.3044 & 0.2197 & 0.9461 \tabularnewline
209 & 113.6 & 99.5957 & 78.7998 & 127.3373 & 0.1612 & 0.6819 & 0.3029 & 0.9291 \tabularnewline
210 & 112.6 & 103.5592 & 81.4156 & 133.3375 & 0.2759 & 0.2543 & 0.8032 & 0.9484 \tabularnewline
211 & 98.8 & 91.5684 & 72.0862 & 117.7227 & 0.2939 & 0.0575 & 0.8843 & 0.8307 \tabularnewline
212 & 78 & 82.4942 & 64.9846 & 105.9811 & 0.3538 & 0.0868 & 0.6211 & 0.6211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308820&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[200])[/C][/ROW]
[ROW][C]188[/C][C]86.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]189[/C][C]112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]190[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]191[/C][C]109.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]192[/C][C]105.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]193[/C][C]115.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]194[/C][C]126.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]195[/C][C]112.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]196[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]197[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]198[/C][C]90.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]199[/C][C]75.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]78.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]101.8[/C][C]98.4153[/C][C]82.4292[/C][C]118.2697[/C][C]0.3691[/C][C]0.9736[/C][C]0.0899[/C][C]0.9736[/C][/ROW]
[ROW][C]202[/C][C]93.9[/C][C]101.9847[/C][C]84.3695[/C][C]124.2027[/C][C]0.2379[/C][C]0.5065[/C][C]0.1768[/C][C]0.9796[/C][/ROW]
[ROW][C]203[/C][C]100[/C][C]98.4695[/C][C]80.8067[/C][C]120.9737[/C][C]0.447[/C][C]0.6547[/C][C]0.1684[/C][C]0.9567[/C][/ROW]
[ROW][C]204[/C][C]89.2[/C][C]95.5522[/C][C]77.7445[/C][C]118.4858[/C][C]0.2936[/C][C]0.3519[/C][C]0.1882[/C][C]0.9239[/C][/ROW]
[ROW][C]205[/C][C]97.7[/C][C]94.1098[/C][C]76.1913[/C][C]117.3305[/C][C]0.3809[/C][C]0.6607[/C][C]0.0368[/C][C]0.9019[/C][/ROW]
[ROW][C]206[/C][C]121.1[/C][C]97.7817[/C][C]78.58[/C][C]122.8982[/C][C]0.0344[/C][C]0.5025[/C][C]0.0133[/C][C]0.9307[/C][/ROW]
[ROW][C]207[/C][C]108.8[/C][C]103.2046[/C][C]82.3113[/C][C]130.796[/C][C]0.3455[/C][C]0.1018[/C][C]0.2614[/C][C]0.9585[/C][/ROW]
[ROW][C]208[/C][C]92.9[/C][C]101.5584[/C][C]80.6626[/C][C]129.2979[/C][C]0.2703[/C][C]0.3044[/C][C]0.2197[/C][C]0.9461[/C][/ROW]
[ROW][C]209[/C][C]113.6[/C][C]99.5957[/C][C]78.7998[/C][C]127.3373[/C][C]0.1612[/C][C]0.6819[/C][C]0.3029[/C][C]0.9291[/C][/ROW]
[ROW][C]210[/C][C]112.6[/C][C]103.5592[/C][C]81.4156[/C][C]133.3375[/C][C]0.2759[/C][C]0.2543[/C][C]0.8032[/C][C]0.9484[/C][/ROW]
[ROW][C]211[/C][C]98.8[/C][C]91.5684[/C][C]72.0862[/C][C]117.7227[/C][C]0.2939[/C][C]0.0575[/C][C]0.8843[/C][C]0.8307[/C][/ROW]
[ROW][C]212[/C][C]78[/C][C]82.4942[/C][C]64.9846[/C][C]105.9811[/C][C]0.3538[/C][C]0.0868[/C][C]0.6211[/C][C]0.6211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308820&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308820&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[200])
18886.3-------
189112-------
190112.5-------
191109.5-------
192105.9-------
193115.3-------
194126.2-------
195112.2-------
196112.5-------
197106.9-------
19890.6-------
19975.6-------
20078.8-------
201101.898.415382.4292118.26970.36910.97360.08990.9736
20293.9101.984784.3695124.20270.23790.50650.17680.9796
20310098.469580.8067120.97370.4470.65470.16840.9567
20489.295.552277.7445118.48580.29360.35190.18820.9239
20597.794.109876.1913117.33050.38090.66070.03680.9019
206121.197.781778.58122.89820.03440.50250.01330.9307
207108.8103.204682.3113130.7960.34550.10180.26140.9585
20892.9101.558480.6626129.29790.27030.30440.21970.9461
209113.699.595778.7998127.33730.16120.68190.30290.9291
210112.6103.559281.4156133.33750.27590.25430.80320.9484
21198.891.568472.0862117.72270.29390.05750.88430.8307
2127882.494264.9846105.98110.35380.08680.62110.6211







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.10290.03320.03320.033811.4563000.26370.2637
2020.1112-0.08610.05970.058265.361738.4096.1975-0.62980.4468
2030.11660.01530.04490.04392.342426.38685.13680.11920.3376
2040.1225-0.07120.05150.050140.351129.87795.4661-0.49490.3769
2050.12590.03670.04850.047612.889626.48025.14590.27970.3575
2060.13110.19260.07250.0752543.7413112.690410.61561.81660.6006
2070.13640.05140.06950.07231.3085101.064410.05310.43590.5771
2080.1394-0.09320.07250.074174.967297.80239.8895-0.67450.5893
2090.14210.12330.07810.0805196.12108.726410.42721.0910.645
2100.14670.08030.07830.080881.7352106.027310.2970.70430.651
2110.14570.07320.07790.080452.2961101.142710.0570.56340.643
2120.1453-0.05760.07620.078320.197594.39729.7158-0.35010.6186

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
201 & 0.1029 & 0.0332 & 0.0332 & 0.0338 & 11.4563 & 0 & 0 & 0.2637 & 0.2637 \tabularnewline
202 & 0.1112 & -0.0861 & 0.0597 & 0.0582 & 65.3617 & 38.409 & 6.1975 & -0.6298 & 0.4468 \tabularnewline
203 & 0.1166 & 0.0153 & 0.0449 & 0.0439 & 2.3424 & 26.3868 & 5.1368 & 0.1192 & 0.3376 \tabularnewline
204 & 0.1225 & -0.0712 & 0.0515 & 0.0501 & 40.3511 & 29.8779 & 5.4661 & -0.4949 & 0.3769 \tabularnewline
205 & 0.1259 & 0.0367 & 0.0485 & 0.0476 & 12.8896 & 26.4802 & 5.1459 & 0.2797 & 0.3575 \tabularnewline
206 & 0.1311 & 0.1926 & 0.0725 & 0.0752 & 543.7413 & 112.6904 & 10.6156 & 1.8166 & 0.6006 \tabularnewline
207 & 0.1364 & 0.0514 & 0.0695 & 0.072 & 31.3085 & 101.0644 & 10.0531 & 0.4359 & 0.5771 \tabularnewline
208 & 0.1394 & -0.0932 & 0.0725 & 0.0741 & 74.9672 & 97.8023 & 9.8895 & -0.6745 & 0.5893 \tabularnewline
209 & 0.1421 & 0.1233 & 0.0781 & 0.0805 & 196.12 & 108.7264 & 10.4272 & 1.091 & 0.645 \tabularnewline
210 & 0.1467 & 0.0803 & 0.0783 & 0.0808 & 81.7352 & 106.0273 & 10.297 & 0.7043 & 0.651 \tabularnewline
211 & 0.1457 & 0.0732 & 0.0779 & 0.0804 & 52.2961 & 101.1427 & 10.057 & 0.5634 & 0.643 \tabularnewline
212 & 0.1453 & -0.0576 & 0.0762 & 0.0783 & 20.1975 & 94.3972 & 9.7158 & -0.3501 & 0.6186 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=308820&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]201[/C][C]0.1029[/C][C]0.0332[/C][C]0.0332[/C][C]0.0338[/C][C]11.4563[/C][C]0[/C][C]0[/C][C]0.2637[/C][C]0.2637[/C][/ROW]
[ROW][C]202[/C][C]0.1112[/C][C]-0.0861[/C][C]0.0597[/C][C]0.0582[/C][C]65.3617[/C][C]38.409[/C][C]6.1975[/C][C]-0.6298[/C][C]0.4468[/C][/ROW]
[ROW][C]203[/C][C]0.1166[/C][C]0.0153[/C][C]0.0449[/C][C]0.0439[/C][C]2.3424[/C][C]26.3868[/C][C]5.1368[/C][C]0.1192[/C][C]0.3376[/C][/ROW]
[ROW][C]204[/C][C]0.1225[/C][C]-0.0712[/C][C]0.0515[/C][C]0.0501[/C][C]40.3511[/C][C]29.8779[/C][C]5.4661[/C][C]-0.4949[/C][C]0.3769[/C][/ROW]
[ROW][C]205[/C][C]0.1259[/C][C]0.0367[/C][C]0.0485[/C][C]0.0476[/C][C]12.8896[/C][C]26.4802[/C][C]5.1459[/C][C]0.2797[/C][C]0.3575[/C][/ROW]
[ROW][C]206[/C][C]0.1311[/C][C]0.1926[/C][C]0.0725[/C][C]0.0752[/C][C]543.7413[/C][C]112.6904[/C][C]10.6156[/C][C]1.8166[/C][C]0.6006[/C][/ROW]
[ROW][C]207[/C][C]0.1364[/C][C]0.0514[/C][C]0.0695[/C][C]0.072[/C][C]31.3085[/C][C]101.0644[/C][C]10.0531[/C][C]0.4359[/C][C]0.5771[/C][/ROW]
[ROW][C]208[/C][C]0.1394[/C][C]-0.0932[/C][C]0.0725[/C][C]0.0741[/C][C]74.9672[/C][C]97.8023[/C][C]9.8895[/C][C]-0.6745[/C][C]0.5893[/C][/ROW]
[ROW][C]209[/C][C]0.1421[/C][C]0.1233[/C][C]0.0781[/C][C]0.0805[/C][C]196.12[/C][C]108.7264[/C][C]10.4272[/C][C]1.091[/C][C]0.645[/C][/ROW]
[ROW][C]210[/C][C]0.1467[/C][C]0.0803[/C][C]0.0783[/C][C]0.0808[/C][C]81.7352[/C][C]106.0273[/C][C]10.297[/C][C]0.7043[/C][C]0.651[/C][/ROW]
[ROW][C]211[/C][C]0.1457[/C][C]0.0732[/C][C]0.0779[/C][C]0.0804[/C][C]52.2961[/C][C]101.1427[/C][C]10.057[/C][C]0.5634[/C][C]0.643[/C][/ROW]
[ROW][C]212[/C][C]0.1453[/C][C]-0.0576[/C][C]0.0762[/C][C]0.0783[/C][C]20.1975[/C][C]94.3972[/C][C]9.7158[/C][C]-0.3501[/C][C]0.6186[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=308820&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=308820&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
2010.10290.03320.03320.033811.4563000.26370.2637
2020.1112-0.08610.05970.058265.361738.4096.1975-0.62980.4468
2030.11660.01530.04490.04392.342426.38685.13680.11920.3376
2040.1225-0.07120.05150.050140.351129.87795.4661-0.49490.3769
2050.12590.03670.04850.047612.889626.48025.14590.27970.3575
2060.13110.19260.07250.0752543.7413112.690410.61561.81660.6006
2070.13640.05140.06950.07231.3085101.064410.05310.43590.5771
2080.1394-0.09320.07250.074174.967297.80239.8895-0.67450.5893
2090.14210.12330.07810.0805196.12108.726410.42721.0910.645
2100.14670.08030.07830.080881.7352106.027310.2970.70430.651
2110.14570.07320.07790.080452.2961101.142710.0570.56340.643
2120.1453-0.05760.07620.078320.197594.39729.7158-0.35010.6186



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