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, 10 Dec 2008 11:36:07 -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/10/t1228934227g61qa81w8n4cn0l.htm/, Retrieved Fri, 17 May 2024 05:45:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=32067, Retrieved Fri, 17 May 2024 05:45:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact241
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [Airline data] [2007-10-18 09:58:47] [42daae401fd3def69a25014f2252b4c2]
F RMPD  [Variance Reduction Matrix] [] [2008-11-30 18:13:06] [b745fd448f60064800b631a75a630267]
F RM D    [Standard Deviation-Mean Plot] [SMP Q1] [2008-12-07 13:12:10] [e5d91604aae608e98a8ea24759233f66]
F RM        [Variance Reduction Matrix] [VRM Q1] [2008-12-07 13:13:31] [e5d91604aae608e98a8ea24759233f66]
F RMP         [(Partial) Autocorrelation Function] [ACF Q2] [2008-12-07 13:20:49] [e5d91604aae608e98a8ea24759233f66]
F RMP           [ARIMA Backward Selection] [ARMA Q5] [2008-12-07 13:46:58] [e5d91604aae608e98a8ea24759233f66]
F RMPD              [ARIMA Forecasting] [Forecasting Infla...] [2008-12-10 18:36:07] [55ca0ca4a201c9689dcf5fae352c92eb] [Current]
-   P                 [ARIMA Forecasting] [Forecasting] [2008-12-18 16:01:41] [e5d91604aae608e98a8ea24759233f66]
Feedback Forum
2008-12-19 16:15:39 [Kristof Van Esbroeck] [reply
Studente lost de taak correct op, gebruikt de juiste software en trekt duidelijke besluiten.


Mbt step 4 kan er nog een uitbreidende verklaring worden gegeven van enkele kolommen van de Univariate ARIMA Extrapolation Forecast tabel.

In de 6de kolom lezen we P(F[t]>Y[t-1]). Dit is de stijgingskans 1 periode in de toekomst. Hier vinden we maw de kans dat er een stijging is wanneer we 1 periode vooruit gaan. Zo merken we bv wanneer we van maand 117 naar maand 118 gaan dat er 89% kans is op een stijging. Als we de logica doortrekken is er dan 11% kans op een daling.

In de voorlaatste kolom lezen we P(F[t]>Y[t-s]). Dit is de kans op een stijging tegenover dezelfde maand van het jaar voordien (s = 12). Wanneer we terug maand 117 beschouwen is er 86% kans op een stijging tov maand 117 van vorig jaar.

In de laatste kolom lezen we tenslotte P(F[t]>Y[108]). Dit is de kans op stijging, tegenover de laatst gekende waarde. In maand 117 is er bijgevolg 67% kans op stijging tov maand 108.
2008-12-22 22:41:09 [Kenny Simons] [reply
De student heeft de taak goed opgelost, enkel stap 4 niet, maar dit heeft Kristof goed beantwoordt.
2008-12-22 22:41:47 [Kenny Simons] [reply
*correctie: beantwoord

Post a new message
Dataseries X:
0.42
0.74
1.02
1.51
1.86
1.59
1.03
0.44
0.82
0.86
0.57
0.59
0.95
0.98
1.23
1.17
0.84
0.74
0.65
0.91
1.19
1.3
1.53
1.94
1.79
1.95
2.26
2.04
2.16
2.75
2.79
2.88
3.36
2.97
3.1
2.49
2.2
2.25
2.09
2.79
3.14
2.93
2.65
2.67
2.26
2.35
2.13
2.18
2.9
2.63
2.67
1.81
1.33
0.88
1.28
1.26
1.26
1.29
1.1
1.37
1.21
1.74
1.76
1.48
1.04
1.62
1.49
1.79
1.8
1.58
1.86
1.74
1.59
1.26
1.13
1.92
2.61
2.26
2.41
2.26
2.03
2.86
2.55
2.27
2.26
2.57
3.07
2.76
2.51
2.87
3.14
3.11
3.16
2.47
2.57
2.89
2.63
2.38
1.69
1.96
2.19
1.87
1.6
1.63
1.22
1.21
1.49
1.64
1.66
1.77
1.82
1.78
1.28
1.29
1.37
1.12
1.51
2.24
2.94
3.09




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32067&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32067&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32067&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'Gwilym Jenkins' @ 72.249.127.135







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[108])
962.89-------
972.63-------
982.38-------
991.69-------
1001.96-------
1012.19-------
1021.87-------
1031.6-------
1041.63-------
1051.22-------
1061.21-------
1071.49-------
1081.64-------
1091.661.87541.36462.37240.19780.82330.00150.8233
1101.771.78371.00852.52550.48550.62810.05760.648
1111.821.92531.00882.79840.40650.63640.70140.7391
1121.781.73980.70732.71040.46770.43570.32830.5799
1131.281.57680.43932.62910.29020.35250.12670.4532
1141.291.65120.44132.76880.26320.74250.35060.5079
1151.371.62060.32492.80610.33930.70770.51360.4872
1161.121.5260.12772.78050.26290.59630.43550.4293
1171.511.93280.53493.22570.26080.89110.86010.6714
1182.242.0980.65373.43990.41790.80480.90270.7483
1192.941.960.43043.36340.08560.34790.74420.6725
1203.091.80610.17813.27090.04290.06460.5880.588

\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[108]) \tabularnewline
96 & 2.89 & - & - & - & - & - & - & - \tabularnewline
97 & 2.63 & - & - & - & - & - & - & - \tabularnewline
98 & 2.38 & - & - & - & - & - & - & - \tabularnewline
99 & 1.69 & - & - & - & - & - & - & - \tabularnewline
100 & 1.96 & - & - & - & - & - & - & - \tabularnewline
101 & 2.19 & - & - & - & - & - & - & - \tabularnewline
102 & 1.87 & - & - & - & - & - & - & - \tabularnewline
103 & 1.6 & - & - & - & - & - & - & - \tabularnewline
104 & 1.63 & - & - & - & - & - & - & - \tabularnewline
105 & 1.22 & - & - & - & - & - & - & - \tabularnewline
106 & 1.21 & - & - & - & - & - & - & - \tabularnewline
107 & 1.49 & - & - & - & - & - & - & - \tabularnewline
108 & 1.64 & - & - & - & - & - & - & - \tabularnewline
109 & 1.66 & 1.8754 & 1.3646 & 2.3724 & 0.1978 & 0.8233 & 0.0015 & 0.8233 \tabularnewline
110 & 1.77 & 1.7837 & 1.0085 & 2.5255 & 0.4855 & 0.6281 & 0.0576 & 0.648 \tabularnewline
111 & 1.82 & 1.9253 & 1.0088 & 2.7984 & 0.4065 & 0.6364 & 0.7014 & 0.7391 \tabularnewline
112 & 1.78 & 1.7398 & 0.7073 & 2.7104 & 0.4677 & 0.4357 & 0.3283 & 0.5799 \tabularnewline
113 & 1.28 & 1.5768 & 0.4393 & 2.6291 & 0.2902 & 0.3525 & 0.1267 & 0.4532 \tabularnewline
114 & 1.29 & 1.6512 & 0.4413 & 2.7688 & 0.2632 & 0.7425 & 0.3506 & 0.5079 \tabularnewline
115 & 1.37 & 1.6206 & 0.3249 & 2.8061 & 0.3393 & 0.7077 & 0.5136 & 0.4872 \tabularnewline
116 & 1.12 & 1.526 & 0.1277 & 2.7805 & 0.2629 & 0.5963 & 0.4355 & 0.4293 \tabularnewline
117 & 1.51 & 1.9328 & 0.5349 & 3.2257 & 0.2608 & 0.8911 & 0.8601 & 0.6714 \tabularnewline
118 & 2.24 & 2.098 & 0.6537 & 3.4399 & 0.4179 & 0.8048 & 0.9027 & 0.7483 \tabularnewline
119 & 2.94 & 1.96 & 0.4304 & 3.3634 & 0.0856 & 0.3479 & 0.7442 & 0.6725 \tabularnewline
120 & 3.09 & 1.8061 & 0.1781 & 3.2709 & 0.0429 & 0.0646 & 0.588 & 0.588 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32067&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[108])[/C][/ROW]
[ROW][C]96[/C][C]2.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2.38[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]1.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]1.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]2.19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]1.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]1.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]1.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]1.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]1.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]1.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]1.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1.66[/C][C]1.8754[/C][C]1.3646[/C][C]2.3724[/C][C]0.1978[/C][C]0.8233[/C][C]0.0015[/C][C]0.8233[/C][/ROW]
[ROW][C]110[/C][C]1.77[/C][C]1.7837[/C][C]1.0085[/C][C]2.5255[/C][C]0.4855[/C][C]0.6281[/C][C]0.0576[/C][C]0.648[/C][/ROW]
[ROW][C]111[/C][C]1.82[/C][C]1.9253[/C][C]1.0088[/C][C]2.7984[/C][C]0.4065[/C][C]0.6364[/C][C]0.7014[/C][C]0.7391[/C][/ROW]
[ROW][C]112[/C][C]1.78[/C][C]1.7398[/C][C]0.7073[/C][C]2.7104[/C][C]0.4677[/C][C]0.4357[/C][C]0.3283[/C][C]0.5799[/C][/ROW]
[ROW][C]113[/C][C]1.28[/C][C]1.5768[/C][C]0.4393[/C][C]2.6291[/C][C]0.2902[/C][C]0.3525[/C][C]0.1267[/C][C]0.4532[/C][/ROW]
[ROW][C]114[/C][C]1.29[/C][C]1.6512[/C][C]0.4413[/C][C]2.7688[/C][C]0.2632[/C][C]0.7425[/C][C]0.3506[/C][C]0.5079[/C][/ROW]
[ROW][C]115[/C][C]1.37[/C][C]1.6206[/C][C]0.3249[/C][C]2.8061[/C][C]0.3393[/C][C]0.7077[/C][C]0.5136[/C][C]0.4872[/C][/ROW]
[ROW][C]116[/C][C]1.12[/C][C]1.526[/C][C]0.1277[/C][C]2.7805[/C][C]0.2629[/C][C]0.5963[/C][C]0.4355[/C][C]0.4293[/C][/ROW]
[ROW][C]117[/C][C]1.51[/C][C]1.9328[/C][C]0.5349[/C][C]3.2257[/C][C]0.2608[/C][C]0.8911[/C][C]0.8601[/C][C]0.6714[/C][/ROW]
[ROW][C]118[/C][C]2.24[/C][C]2.098[/C][C]0.6537[/C][C]3.4399[/C][C]0.4179[/C][C]0.8048[/C][C]0.9027[/C][C]0.7483[/C][/ROW]
[ROW][C]119[/C][C]2.94[/C][C]1.96[/C][C]0.4304[/C][C]3.3634[/C][C]0.0856[/C][C]0.3479[/C][C]0.7442[/C][C]0.6725[/C][/ROW]
[ROW][C]120[/C][C]3.09[/C][C]1.8061[/C][C]0.1781[/C][C]3.2709[/C][C]0.0429[/C][C]0.0646[/C][C]0.588[/C][C]0.588[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32067&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32067&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[108])
962.89-------
972.63-------
982.38-------
991.69-------
1001.96-------
1012.19-------
1021.87-------
1031.6-------
1041.63-------
1051.22-------
1061.21-------
1071.49-------
1081.64-------
1091.661.87541.36462.37240.19780.82330.00150.8233
1101.771.78371.00852.52550.48550.62810.05760.648
1111.821.92531.00882.79840.40650.63640.70140.7391
1121.781.73980.70732.71040.46770.43570.32830.5799
1131.281.57680.43932.62910.29020.35250.12670.4532
1141.291.65120.44132.76880.26320.74250.35060.5079
1151.371.62060.32492.80610.33930.70770.51360.4872
1161.121.5260.12772.78050.26290.59630.43550.4293
1171.511.93280.53493.22570.26080.89110.86010.6714
1182.242.0980.65373.43990.41790.80480.90270.7483
1192.941.960.43043.36340.08560.34790.74420.6725
1203.091.80610.17813.27090.04290.06460.5880.588







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.1352-0.11480.00960.04640.00390.0622
1100.2122-0.00776e-042e-0400.004
1110.2314-0.05470.00460.01119e-040.0304
1120.28460.02310.00190.00161e-040.0116
1130.3405-0.18820.01570.08810.00730.0857
1140.3453-0.21880.01820.13050.01090.1043
1150.3732-0.15460.01290.06280.00520.0723
1160.4194-0.26610.02220.16490.01370.1172
1170.3413-0.21880.01820.17880.01490.1221
1180.32630.06770.00560.02020.00170.041
1190.36530.50.04170.96050.080.2829
1200.41380.71080.05921.64830.13740.3706

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
109 & 0.1352 & -0.1148 & 0.0096 & 0.0464 & 0.0039 & 0.0622 \tabularnewline
110 & 0.2122 & -0.0077 & 6e-04 & 2e-04 & 0 & 0.004 \tabularnewline
111 & 0.2314 & -0.0547 & 0.0046 & 0.0111 & 9e-04 & 0.0304 \tabularnewline
112 & 0.2846 & 0.0231 & 0.0019 & 0.0016 & 1e-04 & 0.0116 \tabularnewline
113 & 0.3405 & -0.1882 & 0.0157 & 0.0881 & 0.0073 & 0.0857 \tabularnewline
114 & 0.3453 & -0.2188 & 0.0182 & 0.1305 & 0.0109 & 0.1043 \tabularnewline
115 & 0.3732 & -0.1546 & 0.0129 & 0.0628 & 0.0052 & 0.0723 \tabularnewline
116 & 0.4194 & -0.2661 & 0.0222 & 0.1649 & 0.0137 & 0.1172 \tabularnewline
117 & 0.3413 & -0.2188 & 0.0182 & 0.1788 & 0.0149 & 0.1221 \tabularnewline
118 & 0.3263 & 0.0677 & 0.0056 & 0.0202 & 0.0017 & 0.041 \tabularnewline
119 & 0.3653 & 0.5 & 0.0417 & 0.9605 & 0.08 & 0.2829 \tabularnewline
120 & 0.4138 & 0.7108 & 0.0592 & 1.6483 & 0.1374 & 0.3706 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32067&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]109[/C][C]0.1352[/C][C]-0.1148[/C][C]0.0096[/C][C]0.0464[/C][C]0.0039[/C][C]0.0622[/C][/ROW]
[ROW][C]110[/C][C]0.2122[/C][C]-0.0077[/C][C]6e-04[/C][C]2e-04[/C][C]0[/C][C]0.004[/C][/ROW]
[ROW][C]111[/C][C]0.2314[/C][C]-0.0547[/C][C]0.0046[/C][C]0.0111[/C][C]9e-04[/C][C]0.0304[/C][/ROW]
[ROW][C]112[/C][C]0.2846[/C][C]0.0231[/C][C]0.0019[/C][C]0.0016[/C][C]1e-04[/C][C]0.0116[/C][/ROW]
[ROW][C]113[/C][C]0.3405[/C][C]-0.1882[/C][C]0.0157[/C][C]0.0881[/C][C]0.0073[/C][C]0.0857[/C][/ROW]
[ROW][C]114[/C][C]0.3453[/C][C]-0.2188[/C][C]0.0182[/C][C]0.1305[/C][C]0.0109[/C][C]0.1043[/C][/ROW]
[ROW][C]115[/C][C]0.3732[/C][C]-0.1546[/C][C]0.0129[/C][C]0.0628[/C][C]0.0052[/C][C]0.0723[/C][/ROW]
[ROW][C]116[/C][C]0.4194[/C][C]-0.2661[/C][C]0.0222[/C][C]0.1649[/C][C]0.0137[/C][C]0.1172[/C][/ROW]
[ROW][C]117[/C][C]0.3413[/C][C]-0.2188[/C][C]0.0182[/C][C]0.1788[/C][C]0.0149[/C][C]0.1221[/C][/ROW]
[ROW][C]118[/C][C]0.3263[/C][C]0.0677[/C][C]0.0056[/C][C]0.0202[/C][C]0.0017[/C][C]0.041[/C][/ROW]
[ROW][C]119[/C][C]0.3653[/C][C]0.5[/C][C]0.0417[/C][C]0.9605[/C][C]0.08[/C][C]0.2829[/C][/ROW]
[ROW][C]120[/C][C]0.4138[/C][C]0.7108[/C][C]0.0592[/C][C]1.6483[/C][C]0.1374[/C][C]0.3706[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32067&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32067&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
1090.1352-0.11480.00960.04640.00390.0622
1100.2122-0.00776e-042e-0400.004
1110.2314-0.05470.00460.01119e-040.0304
1120.28460.02310.00190.00161e-040.0116
1130.3405-0.18820.01570.08810.00730.0857
1140.3453-0.21880.01820.13050.01090.1043
1150.3732-0.15460.01290.06280.00520.0723
1160.4194-0.26610.02220.16490.01370.1172
1170.3413-0.21880.01820.17880.01490.1221
1180.32630.06770.00560.02020.00170.041
1190.36530.50.04170.96050.080.2829
1200.41380.71080.05921.64830.13740.3706



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