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 computationMon, 15 Dec 2008 15:36:09 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Dec/15/t1229380628cs2zi2xjuwscauo.htm/, Retrieved Wed, 15 May 2024 17:20:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33841, Retrieved Wed, 15 May 2024 17:20:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact192
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [Run sequence plot...] [2008-12-02 22:19:27] [ed2ba3b6182103c15c0ab511ae4e6284]
- RMPD  [Standard Deviation-Mean Plot] [SD mean plot] [2008-12-06 11:49:39] [ed2ba3b6182103c15c0ab511ae4e6284]
F RMP     [(Partial) Autocorrelation Function] [ACF d=1 en D=1 la...] [2008-12-06 13:30:27] [ed2ba3b6182103c15c0ab511ae4e6284]
- RM        [ARIMA Backward Selection] [ARIMA model met q...] [2008-12-06 17:04:18] [4242609301e759e844b9196c1994e4ef]
-   P         [ARIMA Backward Selection] [ARima backward se...] [2008-12-08 11:53:47] [ed2ba3b6182103c15c0ab511ae4e6284]
F RMP           [ARIMA Forecasting] [ARIMA forecasting] [2008-12-09 20:21:38] [ed2ba3b6182103c15c0ab511ae4e6284]
F                   [ARIMA Forecasting] [arima forecasting] [2008-12-15 22:36:09] [b0654df83a8a0e1de3ceb7bf60f0d58f] [Current]
Feedback Forum
2008-12-22 20:21:36 [An De Koninck] [reply
Step 1: Je had misschien eerst kunnen uitleggen wat alle tabellen betekenen...
Ik vind dat er niet genoeg vermeld wordt dat de waarden wel erg gelijk lopen met de voorspelde waarden. Dit is toch zeker een opmerkelijkheid en iets dat niet erg veel voorkomt. Tot waarde 56 loopt de curve van de voorspelde waarden immers bijna helemaal gelijk aan de werkelijke waarden. Vanaf waarde 58 tot 60 is dit weer het geval. Tussen 56 en 58 zijn er ook geen opmerkelijk grote afwijkingen.
2008-12-22 20:23:05 [An De Koninck] [reply
Step 2: er is inderdaad een zekere trend waar te nemen maar ik denk niet dat er over seizonaliteit gesproken moet worden aangezien er geen opmerkelijke outliers te bekennen zijn op seizonale lags (12, 24, 36, 48 en 60)
2008-12-22 20:27:27 [An De Koninck] [reply
Step 3: Je had misschien de voorspellingsfout kunnen vergelijken met de werkelijke standaardfout.
2008-12-22 20:28:13 [An De Koninck] [reply
Step 4 en 5: goed beantwoord

Post a new message
Dataseries X:
92.66
94.2
94.37
94.45
94.62
94.37
93.43
94.79
94.88
94.79
94.62
94.71
93.77
95.73
95.99
95.82
95.47
95.82
94.71
96.33
96.5
96.16
96.33
96.33
95.05
96.84
96.92
97.44
97.78
97.69
96.67
98.29
98.2
98.71
98.54
98.2
96.92
99.06
99.65
99.82
99.99
100.33
99.31
101.1
101.1
100.93
100.85
100.93
99.6
101.88
101.81
102.38
102.74
102.82
101.72
103.47
102.98
102.68
102.9
103.03
101.29




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 3 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33841&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33841&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33841&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 time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[49])
3796.92-------
3899.06-------
3999.65-------
4099.82-------
4199.99-------
42100.33-------
4399.31-------
44101.1-------
45101.1-------
46100.93-------
47100.85-------
48100.93-------
4999.6-------
50101.88101.4867101.0135101.95980.0516111
51101.81101.75101.0808102.41920.43030.351711
52102.38102.2514101.4318103.07090.37920.854411
53102.74102.6661101.7198103.61250.43920.723311
54102.82102.6507101.5927103.70880.37690.434311
55101.72101.6561100.497102.81510.4570.024510.9997
56103.47103.3337102.0818104.58560.41550.99420.99981
57102.98103.2335101.8952104.57190.35520.36460.99911
58102.68103.6102102.1907105.02970.09950.80790.99991
59102.9103.401101.9047104.89730.25580.82750.99961
60103.03103.1892101.6199104.75850.42120.6410.99761
61101.29101.9079100.2688103.5470.230.08980.99710.9971

\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[49]) \tabularnewline
37 & 96.92 & - & - & - & - & - & - & - \tabularnewline
38 & 99.06 & - & - & - & - & - & - & - \tabularnewline
39 & 99.65 & - & - & - & - & - & - & - \tabularnewline
40 & 99.82 & - & - & - & - & - & - & - \tabularnewline
41 & 99.99 & - & - & - & - & - & - & - \tabularnewline
42 & 100.33 & - & - & - & - & - & - & - \tabularnewline
43 & 99.31 & - & - & - & - & - & - & - \tabularnewline
44 & 101.1 & - & - & - & - & - & - & - \tabularnewline
45 & 101.1 & - & - & - & - & - & - & - \tabularnewline
46 & 100.93 & - & - & - & - & - & - & - \tabularnewline
47 & 100.85 & - & - & - & - & - & - & - \tabularnewline
48 & 100.93 & - & - & - & - & - & - & - \tabularnewline
49 & 99.6 & - & - & - & - & - & - & - \tabularnewline
50 & 101.88 & 101.4867 & 101.0135 & 101.9598 & 0.0516 & 1 & 1 & 1 \tabularnewline
51 & 101.81 & 101.75 & 101.0808 & 102.4192 & 0.4303 & 0.3517 & 1 & 1 \tabularnewline
52 & 102.38 & 102.2514 & 101.4318 & 103.0709 & 0.3792 & 0.8544 & 1 & 1 \tabularnewline
53 & 102.74 & 102.6661 & 101.7198 & 103.6125 & 0.4392 & 0.7233 & 1 & 1 \tabularnewline
54 & 102.82 & 102.6507 & 101.5927 & 103.7088 & 0.3769 & 0.4343 & 1 & 1 \tabularnewline
55 & 101.72 & 101.6561 & 100.497 & 102.8151 & 0.457 & 0.0245 & 1 & 0.9997 \tabularnewline
56 & 103.47 & 103.3337 & 102.0818 & 104.5856 & 0.4155 & 0.9942 & 0.9998 & 1 \tabularnewline
57 & 102.98 & 103.2335 & 101.8952 & 104.5719 & 0.3552 & 0.3646 & 0.9991 & 1 \tabularnewline
58 & 102.68 & 103.6102 & 102.1907 & 105.0297 & 0.0995 & 0.8079 & 0.9999 & 1 \tabularnewline
59 & 102.9 & 103.401 & 101.9047 & 104.8973 & 0.2558 & 0.8275 & 0.9996 & 1 \tabularnewline
60 & 103.03 & 103.1892 & 101.6199 & 104.7585 & 0.4212 & 0.641 & 0.9976 & 1 \tabularnewline
61 & 101.29 & 101.9079 & 100.2688 & 103.547 & 0.23 & 0.0898 & 0.9971 & 0.9971 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33841&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[49])[/C][/ROW]
[ROW][C]37[/C][C]96.92[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]99.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]99.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]99.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]99.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]100.33[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]99.31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]101.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]101.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]100.93[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]100.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]100.93[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]99.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]101.88[/C][C]101.4867[/C][C]101.0135[/C][C]101.9598[/C][C]0.0516[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]101.81[/C][C]101.75[/C][C]101.0808[/C][C]102.4192[/C][C]0.4303[/C][C]0.3517[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]102.38[/C][C]102.2514[/C][C]101.4318[/C][C]103.0709[/C][C]0.3792[/C][C]0.8544[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]102.74[/C][C]102.6661[/C][C]101.7198[/C][C]103.6125[/C][C]0.4392[/C][C]0.7233[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]102.82[/C][C]102.6507[/C][C]101.5927[/C][C]103.7088[/C][C]0.3769[/C][C]0.4343[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]101.72[/C][C]101.6561[/C][C]100.497[/C][C]102.8151[/C][C]0.457[/C][C]0.0245[/C][C]1[/C][C]0.9997[/C][/ROW]
[ROW][C]56[/C][C]103.47[/C][C]103.3337[/C][C]102.0818[/C][C]104.5856[/C][C]0.4155[/C][C]0.9942[/C][C]0.9998[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]102.98[/C][C]103.2335[/C][C]101.8952[/C][C]104.5719[/C][C]0.3552[/C][C]0.3646[/C][C]0.9991[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]102.68[/C][C]103.6102[/C][C]102.1907[/C][C]105.0297[/C][C]0.0995[/C][C]0.8079[/C][C]0.9999[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]102.9[/C][C]103.401[/C][C]101.9047[/C][C]104.8973[/C][C]0.2558[/C][C]0.8275[/C][C]0.9996[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]103.03[/C][C]103.1892[/C][C]101.6199[/C][C]104.7585[/C][C]0.4212[/C][C]0.641[/C][C]0.9976[/C][C]1[/C][/ROW]
[ROW][C]61[/C][C]101.29[/C][C]101.9079[/C][C]100.2688[/C][C]103.547[/C][C]0.23[/C][C]0.0898[/C][C]0.9971[/C][C]0.9971[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33841&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33841&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[49])
3796.92-------
3899.06-------
3999.65-------
4099.82-------
4199.99-------
42100.33-------
4399.31-------
44101.1-------
45101.1-------
46100.93-------
47100.85-------
48100.93-------
4999.6-------
50101.88101.4867101.0135101.95980.0516111
51101.81101.75101.0808102.41920.43030.351711
52102.38102.2514101.4318103.07090.37920.854411
53102.74102.6661101.7198103.61250.43920.723311
54102.82102.6507101.5927103.70880.37690.434311
55101.72101.6561100.497102.81510.4570.024510.9997
56103.47103.3337102.0818104.58560.41550.99420.99981
57102.98103.2335101.8952104.57190.35520.36460.99911
58102.68103.6102102.1907105.02970.09950.80790.99991
59102.9103.401101.9047104.89730.25580.82750.99961
60103.03103.1892101.6199104.75850.42120.6410.99761
61101.29101.9079100.2688103.5470.230.08980.99710.9971







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.00240.00393e-040.15470.01290.1135
510.00346e-0400.00363e-040.0173
520.00410.00131e-040.01650.00140.0371
530.00477e-041e-040.00555e-040.0213
540.00530.00161e-040.02870.00240.0489
550.00586e-041e-040.00413e-040.0185
560.00620.00131e-040.01860.00150.0394
570.0066-0.00252e-040.06430.00540.0732
580.007-0.0097e-040.86520.07210.2685
590.0074-0.00484e-040.2510.02090.1446
600.0078-0.00151e-040.02540.00210.046
610.0082-0.00615e-040.38180.03180.1784

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0024 & 0.0039 & 3e-04 & 0.1547 & 0.0129 & 0.1135 \tabularnewline
51 & 0.0034 & 6e-04 & 0 & 0.0036 & 3e-04 & 0.0173 \tabularnewline
52 & 0.0041 & 0.0013 & 1e-04 & 0.0165 & 0.0014 & 0.0371 \tabularnewline
53 & 0.0047 & 7e-04 & 1e-04 & 0.0055 & 5e-04 & 0.0213 \tabularnewline
54 & 0.0053 & 0.0016 & 1e-04 & 0.0287 & 0.0024 & 0.0489 \tabularnewline
55 & 0.0058 & 6e-04 & 1e-04 & 0.0041 & 3e-04 & 0.0185 \tabularnewline
56 & 0.0062 & 0.0013 & 1e-04 & 0.0186 & 0.0015 & 0.0394 \tabularnewline
57 & 0.0066 & -0.0025 & 2e-04 & 0.0643 & 0.0054 & 0.0732 \tabularnewline
58 & 0.007 & -0.009 & 7e-04 & 0.8652 & 0.0721 & 0.2685 \tabularnewline
59 & 0.0074 & -0.0048 & 4e-04 & 0.251 & 0.0209 & 0.1446 \tabularnewline
60 & 0.0078 & -0.0015 & 1e-04 & 0.0254 & 0.0021 & 0.046 \tabularnewline
61 & 0.0082 & -0.0061 & 5e-04 & 0.3818 & 0.0318 & 0.1784 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33841&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]50[/C][C]0.0024[/C][C]0.0039[/C][C]3e-04[/C][C]0.1547[/C][C]0.0129[/C][C]0.1135[/C][/ROW]
[ROW][C]51[/C][C]0.0034[/C][C]6e-04[/C][C]0[/C][C]0.0036[/C][C]3e-04[/C][C]0.0173[/C][/ROW]
[ROW][C]52[/C][C]0.0041[/C][C]0.0013[/C][C]1e-04[/C][C]0.0165[/C][C]0.0014[/C][C]0.0371[/C][/ROW]
[ROW][C]53[/C][C]0.0047[/C][C]7e-04[/C][C]1e-04[/C][C]0.0055[/C][C]5e-04[/C][C]0.0213[/C][/ROW]
[ROW][C]54[/C][C]0.0053[/C][C]0.0016[/C][C]1e-04[/C][C]0.0287[/C][C]0.0024[/C][C]0.0489[/C][/ROW]
[ROW][C]55[/C][C]0.0058[/C][C]6e-04[/C][C]1e-04[/C][C]0.0041[/C][C]3e-04[/C][C]0.0185[/C][/ROW]
[ROW][C]56[/C][C]0.0062[/C][C]0.0013[/C][C]1e-04[/C][C]0.0186[/C][C]0.0015[/C][C]0.0394[/C][/ROW]
[ROW][C]57[/C][C]0.0066[/C][C]-0.0025[/C][C]2e-04[/C][C]0.0643[/C][C]0.0054[/C][C]0.0732[/C][/ROW]
[ROW][C]58[/C][C]0.007[/C][C]-0.009[/C][C]7e-04[/C][C]0.8652[/C][C]0.0721[/C][C]0.2685[/C][/ROW]
[ROW][C]59[/C][C]0.0074[/C][C]-0.0048[/C][C]4e-04[/C][C]0.251[/C][C]0.0209[/C][C]0.1446[/C][/ROW]
[ROW][C]60[/C][C]0.0078[/C][C]-0.0015[/C][C]1e-04[/C][C]0.0254[/C][C]0.0021[/C][C]0.046[/C][/ROW]
[ROW][C]61[/C][C]0.0082[/C][C]-0.0061[/C][C]5e-04[/C][C]0.3818[/C][C]0.0318[/C][C]0.1784[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33841&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33841&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.PEMAPESq.EMSERMSE
500.00240.00393e-040.15470.01290.1135
510.00346e-0400.00363e-040.0173
520.00410.00131e-040.01650.00140.0371
530.00477e-041e-040.00555e-040.0213
540.00530.00161e-040.02870.00240.0489
550.00586e-041e-040.00413e-040.0185
560.00620.00131e-040.01860.00150.0394
570.0066-0.00252e-040.06430.00540.0732
580.007-0.0097e-040.86520.07210.2685
590.0074-0.00484e-040.2510.02090.1446
600.0078-0.00151e-040.02540.00210.046
610.0082-0.00615e-040.38180.03180.1784



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 ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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,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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')