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, 03 Dec 2010 11:50:31 +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/2010/Dec/03/t1291376953hcgr9kafmikfyfs.htm/, Retrieved Tue, 07 May 2024 20:33:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=104658, Retrieved Tue, 07 May 2024 20:33:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact227
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
F   PD        [ARIMA Forecasting] [Forecast Arima cu...] [2010-12-03 11:50:31] [e665313c9926a9f4bdf6ad1ee5aefad6] [Current]
- R PD          [ARIMA Forecasting] [] [2010-12-15 04:30:25] [1f5baf2b24e732d76900bb8178fc04e7]
- RMPD          [ARIMA Backward Selection] [] [2010-12-17 09:15:12] [7789b9488494790f41ddb7f073cada1b]
-   P             [ARIMA Backward Selection] [] [2010-12-21 10:25:05] [504b6ff240ec7a3fcbc007044ae7a0bb]
-   PD          [ARIMA Forecasting] [] [2010-12-17 09:23:01] [7789b9488494790f41ddb7f073cada1b]
-   P             [ARIMA Forecasting] [] [2010-12-21 11:13:36] [504b6ff240ec7a3fcbc007044ae7a0bb]
-   PD          [ARIMA Forecasting] [Forecasting ARIMA...] [2010-12-17 09:25:43] [74deae64b71f9d77c839af86f7c687b5]
- R PD          [ARIMA Forecasting] [] [2011-12-06 19:09:10] [46d7ccc24e5d35a2decd922dfb3b3a39]
Feedback Forum
2010-12-12 19:17:54 [00c625c7d009d84797af914265b614f9] [reply
Omdat Arima Backward Selection niet uitgevoerd kon worden, zijn de ingevoerde paramaters voor het voorspellen van de tijdreeks hoogstwaarschijnlijk niet correct. We kunnen dus zeggen da dit geen correcte voorspelling is.
2010-12-13 11:50:09 [Stefanie Van Esbroeck] [reply
2010-12-13 11:56:46 [Stefanie Van Esbroeck] [reply
Je maakt hier eigenlijk een berekening die nergens op verderbouwd. Je kan enkel een forecast doen voor deze tijdreeks als je ook een arima backward selection maakt. Door een foutmelding lukte dit niet dus had je eigenlijk na de arima backward selection moeten stoppen met je tutorial. Het is mij wel opgevallen dat waar je normaal gezien bij de arima backward selection je de maximale waarden in moet geven je deze hier wel hebt aangepast dus je intentie om enkel die parameters te gebruiken die correct zijn te gebruiken, zit alvast goed. Omdat ik ze niet kan vergelijken met het resultaat van de vorige berekening kan ik niet met zekerheid zeggen of de gemaakte berekening correct is uitgevoerd.

Wat je interpretatie betreft lijkt mij deze correct maar ze is wel wat aan de korte kant bovendien blijkt uit je interpretatie dat je enkel kijkt naar de grafiek en dat je geen uitleg geeft bij de tabel dit had je wel nog kunnen toevoegen.

Post a new message
Dataseries X:
101,76
102,37
102,38
102,86
102,87
102,92
102,95
103,02
104,08
104,16
104,24
104,33
104,73
104,86
105,03
105,62
105,63
105,63
105,94
106,61
107,69
107,78
107,93
108,48
108,14
108,48
108,48
108,89
108,93
109,21
109,47
109,80
111,73
111,85
112,12
112,15
112,17
112,67
112,80
113,44
113,53
114,53
114,51
115,05
116,67
117,07
116,92
117,00
117,02
117,35
117,36
117,82
117,88
118,24
118,50
118,80
119,76
120,09




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104658&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[46])
34111.85-------
35112.12-------
36112.15-------
37112.17-------
38112.67-------
39112.8-------
40113.44-------
41113.53-------
42114.53-------
43114.51-------
44115.05-------
45116.67-------
46117.07-------
47116.92117.3144116.7345117.89580.09180.79510.795
48117117.6364116.9059118.36910.04440.972310.9351
49117.02117.7119116.825118.6020.06380.941510.9212
50117.35118.2516117.2244119.28340.04340.990410.9876
51117.36118.4533117.2925119.61980.03310.968110.9899
52117.82119.1398117.8484120.43830.02320.996410.9991
53117.88119.3073117.8913120.73170.02480.979610.999
54118.24119.9842118.4432121.53520.01380.996110.9999
55118.5120.211118.5497121.8840.02250.989510.9999
56118.8120.7926119.0098122.58860.01480.993811
57119.76122.5227120.6104124.45010.00250.999911
58120.09122.8854120.8545124.93320.00370.998611

\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[46]) \tabularnewline
34 & 111.85 & - & - & - & - & - & - & - \tabularnewline
35 & 112.12 & - & - & - & - & - & - & - \tabularnewline
36 & 112.15 & - & - & - & - & - & - & - \tabularnewline
37 & 112.17 & - & - & - & - & - & - & - \tabularnewline
38 & 112.67 & - & - & - & - & - & - & - \tabularnewline
39 & 112.8 & - & - & - & - & - & - & - \tabularnewline
40 & 113.44 & - & - & - & - & - & - & - \tabularnewline
41 & 113.53 & - & - & - & - & - & - & - \tabularnewline
42 & 114.53 & - & - & - & - & - & - & - \tabularnewline
43 & 114.51 & - & - & - & - & - & - & - \tabularnewline
44 & 115.05 & - & - & - & - & - & - & - \tabularnewline
45 & 116.67 & - & - & - & - & - & - & - \tabularnewline
46 & 117.07 & - & - & - & - & - & - & - \tabularnewline
47 & 116.92 & 117.3144 & 116.7345 & 117.8958 & 0.0918 & 0.795 & 1 & 0.795 \tabularnewline
48 & 117 & 117.6364 & 116.9059 & 118.3691 & 0.0444 & 0.9723 & 1 & 0.9351 \tabularnewline
49 & 117.02 & 117.7119 & 116.825 & 118.602 & 0.0638 & 0.9415 & 1 & 0.9212 \tabularnewline
50 & 117.35 & 118.2516 & 117.2244 & 119.2834 & 0.0434 & 0.9904 & 1 & 0.9876 \tabularnewline
51 & 117.36 & 118.4533 & 117.2925 & 119.6198 & 0.0331 & 0.9681 & 1 & 0.9899 \tabularnewline
52 & 117.82 & 119.1398 & 117.8484 & 120.4383 & 0.0232 & 0.9964 & 1 & 0.9991 \tabularnewline
53 & 117.88 & 119.3073 & 117.8913 & 120.7317 & 0.0248 & 0.9796 & 1 & 0.999 \tabularnewline
54 & 118.24 & 119.9842 & 118.4432 & 121.5352 & 0.0138 & 0.9961 & 1 & 0.9999 \tabularnewline
55 & 118.5 & 120.211 & 118.5497 & 121.884 & 0.0225 & 0.9895 & 1 & 0.9999 \tabularnewline
56 & 118.8 & 120.7926 & 119.0098 & 122.5886 & 0.0148 & 0.9938 & 1 & 1 \tabularnewline
57 & 119.76 & 122.5227 & 120.6104 & 124.4501 & 0.0025 & 0.9999 & 1 & 1 \tabularnewline
58 & 120.09 & 122.8854 & 120.8545 & 124.9332 & 0.0037 & 0.9986 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=104658&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[46])[/C][/ROW]
[ROW][C]34[/C][C]111.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]112.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]112.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]112.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]112.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]113.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]113.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]114.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]114.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]115.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]117.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]116.92[/C][C]117.3144[/C][C]116.7345[/C][C]117.8958[/C][C]0.0918[/C][C]0.795[/C][C]1[/C][C]0.795[/C][/ROW]
[ROW][C]48[/C][C]117[/C][C]117.6364[/C][C]116.9059[/C][C]118.3691[/C][C]0.0444[/C][C]0.9723[/C][C]1[/C][C]0.9351[/C][/ROW]
[ROW][C]49[/C][C]117.02[/C][C]117.7119[/C][C]116.825[/C][C]118.602[/C][C]0.0638[/C][C]0.9415[/C][C]1[/C][C]0.9212[/C][/ROW]
[ROW][C]50[/C][C]117.35[/C][C]118.2516[/C][C]117.2244[/C][C]119.2834[/C][C]0.0434[/C][C]0.9904[/C][C]1[/C][C]0.9876[/C][/ROW]
[ROW][C]51[/C][C]117.36[/C][C]118.4533[/C][C]117.2925[/C][C]119.6198[/C][C]0.0331[/C][C]0.9681[/C][C]1[/C][C]0.9899[/C][/ROW]
[ROW][C]52[/C][C]117.82[/C][C]119.1398[/C][C]117.8484[/C][C]120.4383[/C][C]0.0232[/C][C]0.9964[/C][C]1[/C][C]0.9991[/C][/ROW]
[ROW][C]53[/C][C]117.88[/C][C]119.3073[/C][C]117.8913[/C][C]120.7317[/C][C]0.0248[/C][C]0.9796[/C][C]1[/C][C]0.999[/C][/ROW]
[ROW][C]54[/C][C]118.24[/C][C]119.9842[/C][C]118.4432[/C][C]121.5352[/C][C]0.0138[/C][C]0.9961[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]55[/C][C]118.5[/C][C]120.211[/C][C]118.5497[/C][C]121.884[/C][C]0.0225[/C][C]0.9895[/C][C]1[/C][C]0.9999[/C][/ROW]
[ROW][C]56[/C][C]118.8[/C][C]120.7926[/C][C]119.0098[/C][C]122.5886[/C][C]0.0148[/C][C]0.9938[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]119.76[/C][C]122.5227[/C][C]120.6104[/C][C]124.4501[/C][C]0.0025[/C][C]0.9999[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]120.09[/C][C]122.8854[/C][C]120.8545[/C][C]124.9332[/C][C]0.0037[/C][C]0.9986[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=104658&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104658&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[46])
34111.85-------
35112.12-------
36112.15-------
37112.17-------
38112.67-------
39112.8-------
40113.44-------
41113.53-------
42114.53-------
43114.51-------
44115.05-------
45116.67-------
46117.07-------
47116.92117.3144116.7345117.89580.09180.79510.795
48117117.6364116.9059118.36910.04440.972310.9351
49117.02117.7119116.825118.6020.06380.941510.9212
50117.35118.2516117.2244119.28340.04340.990410.9876
51117.36118.4533117.2925119.61980.03310.968110.9899
52117.82119.1398117.8484120.43830.02320.996410.9991
53117.88119.3073117.8913120.73170.02480.979610.999
54118.24119.9842118.4432121.53520.01380.996110.9999
55118.5120.211118.5497121.8840.02250.989510.9999
56118.8120.7926119.0098122.58860.01480.993811
57119.76122.5227120.6104124.45010.00250.999911
58120.09122.8854120.8545124.93320.00370.998611







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
470.0025-0.003400.155600
480.0032-0.00540.00440.4050.28030.5294
490.0039-0.00590.00490.47870.34640.5886
500.0045-0.00760.00560.8130.4630.6805
510.005-0.00920.00631.19530.60950.7807
520.0056-0.01110.00711.74190.79820.8934
530.0061-0.0120.00782.03720.97520.9875
540.0066-0.01450.00863.04221.23361.1107
550.0071-0.01420.00932.92761.42181.1924
560.0076-0.01650.013.97031.67671.2949
570.008-0.02250.01117.63272.21811.4893
580.0085-0.02270.01217.81422.68451.6384

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
47 & 0.0025 & -0.0034 & 0 & 0.1556 & 0 & 0 \tabularnewline
48 & 0.0032 & -0.0054 & 0.0044 & 0.405 & 0.2803 & 0.5294 \tabularnewline
49 & 0.0039 & -0.0059 & 0.0049 & 0.4787 & 0.3464 & 0.5886 \tabularnewline
50 & 0.0045 & -0.0076 & 0.0056 & 0.813 & 0.463 & 0.6805 \tabularnewline
51 & 0.005 & -0.0092 & 0.0063 & 1.1953 & 0.6095 & 0.7807 \tabularnewline
52 & 0.0056 & -0.0111 & 0.0071 & 1.7419 & 0.7982 & 0.8934 \tabularnewline
53 & 0.0061 & -0.012 & 0.0078 & 2.0372 & 0.9752 & 0.9875 \tabularnewline
54 & 0.0066 & -0.0145 & 0.0086 & 3.0422 & 1.2336 & 1.1107 \tabularnewline
55 & 0.0071 & -0.0142 & 0.0093 & 2.9276 & 1.4218 & 1.1924 \tabularnewline
56 & 0.0076 & -0.0165 & 0.01 & 3.9703 & 1.6767 & 1.2949 \tabularnewline
57 & 0.008 & -0.0225 & 0.0111 & 7.6327 & 2.2181 & 1.4893 \tabularnewline
58 & 0.0085 & -0.0227 & 0.0121 & 7.8142 & 2.6845 & 1.6384 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=104658&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]47[/C][C]0.0025[/C][C]-0.0034[/C][C]0[/C][C]0.1556[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]48[/C][C]0.0032[/C][C]-0.0054[/C][C]0.0044[/C][C]0.405[/C][C]0.2803[/C][C]0.5294[/C][/ROW]
[ROW][C]49[/C][C]0.0039[/C][C]-0.0059[/C][C]0.0049[/C][C]0.4787[/C][C]0.3464[/C][C]0.5886[/C][/ROW]
[ROW][C]50[/C][C]0.0045[/C][C]-0.0076[/C][C]0.0056[/C][C]0.813[/C][C]0.463[/C][C]0.6805[/C][/ROW]
[ROW][C]51[/C][C]0.005[/C][C]-0.0092[/C][C]0.0063[/C][C]1.1953[/C][C]0.6095[/C][C]0.7807[/C][/ROW]
[ROW][C]52[/C][C]0.0056[/C][C]-0.0111[/C][C]0.0071[/C][C]1.7419[/C][C]0.7982[/C][C]0.8934[/C][/ROW]
[ROW][C]53[/C][C]0.0061[/C][C]-0.012[/C][C]0.0078[/C][C]2.0372[/C][C]0.9752[/C][C]0.9875[/C][/ROW]
[ROW][C]54[/C][C]0.0066[/C][C]-0.0145[/C][C]0.0086[/C][C]3.0422[/C][C]1.2336[/C][C]1.1107[/C][/ROW]
[ROW][C]55[/C][C]0.0071[/C][C]-0.0142[/C][C]0.0093[/C][C]2.9276[/C][C]1.4218[/C][C]1.1924[/C][/ROW]
[ROW][C]56[/C][C]0.0076[/C][C]-0.0165[/C][C]0.01[/C][C]3.9703[/C][C]1.6767[/C][C]1.2949[/C][/ROW]
[ROW][C]57[/C][C]0.008[/C][C]-0.0225[/C][C]0.0111[/C][C]7.6327[/C][C]2.2181[/C][C]1.4893[/C][/ROW]
[ROW][C]58[/C][C]0.0085[/C][C]-0.0227[/C][C]0.0121[/C][C]7.8142[/C][C]2.6845[/C][C]1.6384[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=104658&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=104658&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
470.0025-0.003400.155600
480.0032-0.00540.00440.4050.28030.5294
490.0039-0.00590.00490.47870.34640.5886
500.0045-0.00760.00560.8130.4630.6805
510.005-0.00920.00631.19530.60950.7807
520.0056-0.01110.00711.74190.79820.8934
530.0061-0.0120.00782.03720.97520.9875
540.0066-0.01450.00863.04221.23361.1107
550.0071-0.01420.00932.92761.42181.1924
560.0076-0.01650.013.97031.67671.2949
570.008-0.02250.01117.63272.21811.4893
580.0085-0.02270.01217.81422.68451.6384



Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 0.5 ; par3 = 1 ; par4 = 1 ; 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,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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
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.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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',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.mape1[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.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')