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, 23 Dec 2011 09:09:56 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/23/t1324649425ou1fgkmpwid3e2s.htm/, Retrieved Mon, 29 Apr 2024 18:30:11 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160424, Retrieved Mon, 29 Apr 2024 18:30:11 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact140
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]
- R         [ARIMA Forecasting] [ws9] [2011-12-06 21:34:47] [8501ca4b76170905b8a207a77f626994]
-   P         [ARIMA Forecasting] [Paper deel 2 ARIM...] [2011-12-22 14:35:08] [8501ca4b76170905b8a207a77f626994]
-   PD            [ARIMA Forecasting] [Paper: ARIMA Fore...] [2011-12-23 14:09:56] [3e64eea457df40fcb7af8f28e1ee6256] [Current]
Feedback Forum

Post a new message
Dataseries X:
24.90
25.06
25.10
24.92
25.46
25.89
25.39
25.38
25.25
24.88
25.00
25.00
24.07
23.60
23.18
23.25
23.04
22.77
22.25
22.41
22.50
22.91
22.88
21.69
21.19
21.56
22.00
22.13
22.27
22.30
21.94
22.40
22.77
22.90
23.03
23.05
22.41
22.26
21.90
22.01
22.62
22.76
23.40
23.63
24.05
23.82
23.71
23.95
23.61
23.98
23.56
23.99
24.33
24.48
24.31
24.38
24.63
25.54
25.75
25.73
25.85
25.78
25.86
26.86
27.36
27.38
26.58
27.65
27.73
27.18
27.32
27.30
26.90
26.70
26.75
26.41
26.29
27.51
27.91
27.70
27.28
28.25
27.62
27.30
25.94
24.99
25.50
24.42
26.58
25.84
26.76
26.74
26.68
25.55
26.40
25.19
23.94
24.20
24.20
23.07
24.07
25.02
24.65
24.68
24.63
24.49
25.05
24.31
23.90
23.68
24.50
25.22
25.48
26.00
26.07
26.06
26.22
26.70
27.20
26.77
26.11
25.43
24.99
25.51
24.00
23.86
22.96
23.41
23.17
24.12
23.87
24.27
24.40
24.16
25.15
25.09
24.60
24.33
24.14
24.36
25.40
26.15
26.77
26.94
26.33
26.24
26.23
25.88
27.00
26.91
27.15
27.78
28.73
28.83
28.68
27.56
27.15
27.41
27.47
28.76
28.47
27.94
27.23
27.01
26.15
26.11
27.20
27.36
27.33
27.43
28.92
29.45
29.01
29.25
29.14
29.64
30.40
30.62
31.25
31.75
31.30
30.70
31.03
31.46
31.28
31.03
30.95
31.17
31.29
31.91
32.10
31.71
31.90
32.02
32.65
33.77
33.51
34.26
34.21
34.13
34.73
34.73
34.57
34.80
33.98
34.40
34.21
34.61
35.25
35.23
35.00
34.52
33.82
34.35
34.81
34.96
36.69
36.42
36.44
37.41
36.40
36.15
35.78
36.95
36.14
36.36
37.31
37.58
38.00
37.23
37.00
37.87
37.70
36.17
36.56
37.70
38.77
39.02
39.88
39.56
38.52
37.20
38.58
39.41
39.08
38.81
38.73
38.70
39.23
39.82
39.97
40.37
39.54
39.21
39.07
39.78
39.40
38.92




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.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 & 1 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160424&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160424&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160424&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 time1 seconds
R Server'Gertrude Mary Cox' @ cox.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[246])
23436.17-------
23536.56-------
23637.7-------
23738.77-------
23839.02-------
23939.88-------
24039.56-------
24138.52-------
24237.2-------
24338.58-------
24439.41-------
24539.08-------
24638.81-------
24738.7338.854237.252240.52510.44210.52070.99640.5207
24838.738.995336.757441.36950.40370.58670.85750.5608
24939.2339.125736.380942.07760.47240.61130.59340.583
25039.8239.155735.994642.59450.35250.48310.53080.5781
25139.9739.257735.726743.13780.35950.38820.37660.5895
25240.3739.2235.369243.490.29880.36530.4380.5746
25339.5439.095534.963543.71570.42520.29440.59640.5482
25439.2138.933134.548743.87390.45630.40490.75410.5195
25539.0739.102734.446944.38780.49520.48410.57690.5432
25639.7839.202234.297144.80880.420.51840.4710.5545
25739.439.162934.038645.05850.46860.41870.5110.5467
25838.9239.130533.79845.30430.47340.46590.54050.5405

\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[246]) \tabularnewline
234 & 36.17 & - & - & - & - & - & - & - \tabularnewline
235 & 36.56 & - & - & - & - & - & - & - \tabularnewline
236 & 37.7 & - & - & - & - & - & - & - \tabularnewline
237 & 38.77 & - & - & - & - & - & - & - \tabularnewline
238 & 39.02 & - & - & - & - & - & - & - \tabularnewline
239 & 39.88 & - & - & - & - & - & - & - \tabularnewline
240 & 39.56 & - & - & - & - & - & - & - \tabularnewline
241 & 38.52 & - & - & - & - & - & - & - \tabularnewline
242 & 37.2 & - & - & - & - & - & - & - \tabularnewline
243 & 38.58 & - & - & - & - & - & - & - \tabularnewline
244 & 39.41 & - & - & - & - & - & - & - \tabularnewline
245 & 39.08 & - & - & - & - & - & - & - \tabularnewline
246 & 38.81 & - & - & - & - & - & - & - \tabularnewline
247 & 38.73 & 38.8542 & 37.2522 & 40.5251 & 0.4421 & 0.5207 & 0.9964 & 0.5207 \tabularnewline
248 & 38.7 & 38.9953 & 36.7574 & 41.3695 & 0.4037 & 0.5867 & 0.8575 & 0.5608 \tabularnewline
249 & 39.23 & 39.1257 & 36.3809 & 42.0776 & 0.4724 & 0.6113 & 0.5934 & 0.583 \tabularnewline
250 & 39.82 & 39.1557 & 35.9946 & 42.5945 & 0.3525 & 0.4831 & 0.5308 & 0.5781 \tabularnewline
251 & 39.97 & 39.2577 & 35.7267 & 43.1378 & 0.3595 & 0.3882 & 0.3766 & 0.5895 \tabularnewline
252 & 40.37 & 39.22 & 35.3692 & 43.49 & 0.2988 & 0.3653 & 0.438 & 0.5746 \tabularnewline
253 & 39.54 & 39.0955 & 34.9635 & 43.7157 & 0.4252 & 0.2944 & 0.5964 & 0.5482 \tabularnewline
254 & 39.21 & 38.9331 & 34.5487 & 43.8739 & 0.4563 & 0.4049 & 0.7541 & 0.5195 \tabularnewline
255 & 39.07 & 39.1027 & 34.4469 & 44.3878 & 0.4952 & 0.4841 & 0.5769 & 0.5432 \tabularnewline
256 & 39.78 & 39.2022 & 34.2971 & 44.8088 & 0.42 & 0.5184 & 0.471 & 0.5545 \tabularnewline
257 & 39.4 & 39.1629 & 34.0386 & 45.0585 & 0.4686 & 0.4187 & 0.511 & 0.5467 \tabularnewline
258 & 38.92 & 39.1305 & 33.798 & 45.3043 & 0.4734 & 0.4659 & 0.5405 & 0.5405 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160424&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[246])[/C][/ROW]
[ROW][C]234[/C][C]36.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]235[/C][C]36.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]236[/C][C]37.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]237[/C][C]38.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]238[/C][C]39.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]239[/C][C]39.88[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]240[/C][C]39.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]241[/C][C]38.52[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]242[/C][C]37.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]243[/C][C]38.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]244[/C][C]39.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]245[/C][C]39.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]246[/C][C]38.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]247[/C][C]38.73[/C][C]38.8542[/C][C]37.2522[/C][C]40.5251[/C][C]0.4421[/C][C]0.5207[/C][C]0.9964[/C][C]0.5207[/C][/ROW]
[ROW][C]248[/C][C]38.7[/C][C]38.9953[/C][C]36.7574[/C][C]41.3695[/C][C]0.4037[/C][C]0.5867[/C][C]0.8575[/C][C]0.5608[/C][/ROW]
[ROW][C]249[/C][C]39.23[/C][C]39.1257[/C][C]36.3809[/C][C]42.0776[/C][C]0.4724[/C][C]0.6113[/C][C]0.5934[/C][C]0.583[/C][/ROW]
[ROW][C]250[/C][C]39.82[/C][C]39.1557[/C][C]35.9946[/C][C]42.5945[/C][C]0.3525[/C][C]0.4831[/C][C]0.5308[/C][C]0.5781[/C][/ROW]
[ROW][C]251[/C][C]39.97[/C][C]39.2577[/C][C]35.7267[/C][C]43.1378[/C][C]0.3595[/C][C]0.3882[/C][C]0.3766[/C][C]0.5895[/C][/ROW]
[ROW][C]252[/C][C]40.37[/C][C]39.22[/C][C]35.3692[/C][C]43.49[/C][C]0.2988[/C][C]0.3653[/C][C]0.438[/C][C]0.5746[/C][/ROW]
[ROW][C]253[/C][C]39.54[/C][C]39.0955[/C][C]34.9635[/C][C]43.7157[/C][C]0.4252[/C][C]0.2944[/C][C]0.5964[/C][C]0.5482[/C][/ROW]
[ROW][C]254[/C][C]39.21[/C][C]38.9331[/C][C]34.5487[/C][C]43.8739[/C][C]0.4563[/C][C]0.4049[/C][C]0.7541[/C][C]0.5195[/C][/ROW]
[ROW][C]255[/C][C]39.07[/C][C]39.1027[/C][C]34.4469[/C][C]44.3878[/C][C]0.4952[/C][C]0.4841[/C][C]0.5769[/C][C]0.5432[/C][/ROW]
[ROW][C]256[/C][C]39.78[/C][C]39.2022[/C][C]34.2971[/C][C]44.8088[/C][C]0.42[/C][C]0.5184[/C][C]0.471[/C][C]0.5545[/C][/ROW]
[ROW][C]257[/C][C]39.4[/C][C]39.1629[/C][C]34.0386[/C][C]45.0585[/C][C]0.4686[/C][C]0.4187[/C][C]0.511[/C][C]0.5467[/C][/ROW]
[ROW][C]258[/C][C]38.92[/C][C]39.1305[/C][C]33.798[/C][C]45.3043[/C][C]0.4734[/C][C]0.4659[/C][C]0.5405[/C][C]0.5405[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160424&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160424&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[246])
23436.17-------
23536.56-------
23637.7-------
23738.77-------
23839.02-------
23939.88-------
24039.56-------
24138.52-------
24237.2-------
24338.58-------
24439.41-------
24539.08-------
24638.81-------
24738.7338.854237.252240.52510.44210.52070.99640.5207
24838.738.995336.757441.36950.40370.58670.85750.5608
24939.2339.125736.380942.07760.47240.61130.59340.583
25039.8239.155735.994642.59450.35250.48310.53080.5781
25139.9739.257735.726743.13780.35950.38820.37660.5895
25240.3739.2235.369243.490.29880.36530.4380.5746
25339.5439.095534.963543.71570.42520.29440.59640.5482
25439.2138.933134.548743.87390.45630.40490.75410.5195
25539.0739.102734.446944.38780.49520.48410.57690.5432
25639.7839.202234.297144.80880.420.51840.4710.5545
25739.439.162934.038645.05850.46860.41870.5110.5467
25838.9239.130533.79845.30430.47340.46590.54050.5405







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
2470.0219-0.003200.015400
2480.0311-0.00760.00540.08720.05130.2265
2490.03850.00270.00450.01090.03780.1945
2500.04480.0170.00760.44130.13870.3724
2510.05040.01810.00970.50730.21240.4609
2520.05550.02930.0131.32250.39740.6304
2530.06030.01140.01270.19760.36890.6074
2540.06470.00710.0120.07670.33240.5765
2550.069-8e-040.01080.00110.29560.5437
2560.0730.01470.01120.33380.29940.5472
2570.07680.00610.01070.05620.27730.5266
2580.0805-0.00540.01030.04430.25790.5078

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
247 & 0.0219 & -0.0032 & 0 & 0.0154 & 0 & 0 \tabularnewline
248 & 0.0311 & -0.0076 & 0.0054 & 0.0872 & 0.0513 & 0.2265 \tabularnewline
249 & 0.0385 & 0.0027 & 0.0045 & 0.0109 & 0.0378 & 0.1945 \tabularnewline
250 & 0.0448 & 0.017 & 0.0076 & 0.4413 & 0.1387 & 0.3724 \tabularnewline
251 & 0.0504 & 0.0181 & 0.0097 & 0.5073 & 0.2124 & 0.4609 \tabularnewline
252 & 0.0555 & 0.0293 & 0.013 & 1.3225 & 0.3974 & 0.6304 \tabularnewline
253 & 0.0603 & 0.0114 & 0.0127 & 0.1976 & 0.3689 & 0.6074 \tabularnewline
254 & 0.0647 & 0.0071 & 0.012 & 0.0767 & 0.3324 & 0.5765 \tabularnewline
255 & 0.069 & -8e-04 & 0.0108 & 0.0011 & 0.2956 & 0.5437 \tabularnewline
256 & 0.073 & 0.0147 & 0.0112 & 0.3338 & 0.2994 & 0.5472 \tabularnewline
257 & 0.0768 & 0.0061 & 0.0107 & 0.0562 & 0.2773 & 0.5266 \tabularnewline
258 & 0.0805 & -0.0054 & 0.0103 & 0.0443 & 0.2579 & 0.5078 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160424&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]247[/C][C]0.0219[/C][C]-0.0032[/C][C]0[/C][C]0.0154[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]248[/C][C]0.0311[/C][C]-0.0076[/C][C]0.0054[/C][C]0.0872[/C][C]0.0513[/C][C]0.2265[/C][/ROW]
[ROW][C]249[/C][C]0.0385[/C][C]0.0027[/C][C]0.0045[/C][C]0.0109[/C][C]0.0378[/C][C]0.1945[/C][/ROW]
[ROW][C]250[/C][C]0.0448[/C][C]0.017[/C][C]0.0076[/C][C]0.4413[/C][C]0.1387[/C][C]0.3724[/C][/ROW]
[ROW][C]251[/C][C]0.0504[/C][C]0.0181[/C][C]0.0097[/C][C]0.5073[/C][C]0.2124[/C][C]0.4609[/C][/ROW]
[ROW][C]252[/C][C]0.0555[/C][C]0.0293[/C][C]0.013[/C][C]1.3225[/C][C]0.3974[/C][C]0.6304[/C][/ROW]
[ROW][C]253[/C][C]0.0603[/C][C]0.0114[/C][C]0.0127[/C][C]0.1976[/C][C]0.3689[/C][C]0.6074[/C][/ROW]
[ROW][C]254[/C][C]0.0647[/C][C]0.0071[/C][C]0.012[/C][C]0.0767[/C][C]0.3324[/C][C]0.5765[/C][/ROW]
[ROW][C]255[/C][C]0.069[/C][C]-8e-04[/C][C]0.0108[/C][C]0.0011[/C][C]0.2956[/C][C]0.5437[/C][/ROW]
[ROW][C]256[/C][C]0.073[/C][C]0.0147[/C][C]0.0112[/C][C]0.3338[/C][C]0.2994[/C][C]0.5472[/C][/ROW]
[ROW][C]257[/C][C]0.0768[/C][C]0.0061[/C][C]0.0107[/C][C]0.0562[/C][C]0.2773[/C][C]0.5266[/C][/ROW]
[ROW][C]258[/C][C]0.0805[/C][C]-0.0054[/C][C]0.0103[/C][C]0.0443[/C][C]0.2579[/C][C]0.5078[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160424&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160424&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
2470.0219-0.003200.015400
2480.0311-0.00760.00540.08720.05130.2265
2490.03850.00270.00450.01090.03780.1945
2500.04480.0170.00760.44130.13870.3724
2510.05040.01810.00970.50730.21240.4609
2520.05550.02930.0131.32250.39740.6304
2530.06030.01140.01270.19760.36890.6074
2540.06470.00710.0120.07670.33240.5765
2550.069-8e-040.01080.00110.29560.5437
2560.0730.01470.01120.33380.29940.5472
2570.07680.00610.01070.05620.27730.5266
2580.0805-0.00540.01030.04430.25790.5078



Parameters (Session):
par1 = Valutakoersen Eur-Dollar ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; 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')