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 computationThu, 17 Dec 2009 10:33:58 -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/2009/Dec/17/t1261074241orenneyyo811can.htm/, Retrieved Tue, 30 Apr 2024 03:09:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69034, Retrieved Tue, 30 Apr 2024 03:09:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact170
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [] [2009-12-09 12:59:17] [e2ae2d788de9b949efa455f763351347]
-   P     [ARIMA Forecasting] [] [2009-12-17 08:51:10] [e2ae2d788de9b949efa455f763351347]
- R           [ARIMA Forecasting] [] [2009-12-17 17:33:58] [4057bfb3a128b4e91b455d276991f7f0] [Current]
Feedback Forum

Post a new message
Dataseries X:
8.3
8.2
8
7.9
7.6
7.6
8.3
8.4
8.4
8.4
8.4
8.6
8.9
8.8
8.3
7.5
7.2
7.4
8.8
9.3
9.3
8.7
8.2
8.3
8.5
8.6
8.5
8.2
8.1
7.9
8.6
8.7
8.7
8.5
8.4
8.5
8.7
8.7
8.6
8.5
8.3
8
8.2
8.1
8.1
8
7.9
7.9
8
8
7.9
8
7.7
7.2
7.5
7.3
7
7
7
7.2
7.3
7.1
6.8
6.4
6.1
6.5
7.7
7.9
7.5
6.9
6.6
6.9




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69034&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]4 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=69034&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69034&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 time4 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[60])
487.9-------
498-------
508-------
517.9-------
528-------
537.7-------
547.2-------
557.5-------
567.3-------
577-------
587-------
597-------
607.2-------
617.37.3036.97977.62630.49270.733900.7339
627.17.13196.58527.67850.45450.27339e-040.4035
636.86.73056.06447.39660.4190.13853e-040.0836
646.46.46185.76927.15450.43050.169300.0184
656.16.06265.36976.75540.45780.169906e-04
666.55.7385.04496.43110.01560.15300
677.76.24535.55066.939900.23612e-040.0035
687.96.21695.50066.9332000.00150.0036
697.56.00245.22146.78351e-0400.00610.0013
706.95.8284.96176.69430.00761e-040.0040.001
716.65.62024.67826.56220.02070.00390.0025e-04
726.95.65264.6616.64430.00680.03060.00110.0011

\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[60]) \tabularnewline
48 & 7.9 & - & - & - & - & - & - & - \tabularnewline
49 & 8 & - & - & - & - & - & - & - \tabularnewline
50 & 8 & - & - & - & - & - & - & - \tabularnewline
51 & 7.9 & - & - & - & - & - & - & - \tabularnewline
52 & 8 & - & - & - & - & - & - & - \tabularnewline
53 & 7.7 & - & - & - & - & - & - & - \tabularnewline
54 & 7.2 & - & - & - & - & - & - & - \tabularnewline
55 & 7.5 & - & - & - & - & - & - & - \tabularnewline
56 & 7.3 & - & - & - & - & - & - & - \tabularnewline
57 & 7 & - & - & - & - & - & - & - \tabularnewline
58 & 7 & - & - & - & - & - & - & - \tabularnewline
59 & 7 & - & - & - & - & - & - & - \tabularnewline
60 & 7.2 & - & - & - & - & - & - & - \tabularnewline
61 & 7.3 & 7.303 & 6.9797 & 7.6263 & 0.4927 & 0.7339 & 0 & 0.7339 \tabularnewline
62 & 7.1 & 7.1319 & 6.5852 & 7.6785 & 0.4545 & 0.2733 & 9e-04 & 0.4035 \tabularnewline
63 & 6.8 & 6.7305 & 6.0644 & 7.3966 & 0.419 & 0.1385 & 3e-04 & 0.0836 \tabularnewline
64 & 6.4 & 6.4618 & 5.7692 & 7.1545 & 0.4305 & 0.1693 & 0 & 0.0184 \tabularnewline
65 & 6.1 & 6.0626 & 5.3697 & 6.7554 & 0.4578 & 0.1699 & 0 & 6e-04 \tabularnewline
66 & 6.5 & 5.738 & 5.0449 & 6.4311 & 0.0156 & 0.153 & 0 & 0 \tabularnewline
67 & 7.7 & 6.2453 & 5.5506 & 6.9399 & 0 & 0.2361 & 2e-04 & 0.0035 \tabularnewline
68 & 7.9 & 6.2169 & 5.5006 & 6.9332 & 0 & 0 & 0.0015 & 0.0036 \tabularnewline
69 & 7.5 & 6.0024 & 5.2214 & 6.7835 & 1e-04 & 0 & 0.0061 & 0.0013 \tabularnewline
70 & 6.9 & 5.828 & 4.9617 & 6.6943 & 0.0076 & 1e-04 & 0.004 & 0.001 \tabularnewline
71 & 6.6 & 5.6202 & 4.6782 & 6.5622 & 0.0207 & 0.0039 & 0.002 & 5e-04 \tabularnewline
72 & 6.9 & 5.6526 & 4.661 & 6.6443 & 0.0068 & 0.0306 & 0.0011 & 0.0011 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69034&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[60])[/C][/ROW]
[ROW][C]48[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]7.3[/C][C]7.303[/C][C]6.9797[/C][C]7.6263[/C][C]0.4927[/C][C]0.7339[/C][C]0[/C][C]0.7339[/C][/ROW]
[ROW][C]62[/C][C]7.1[/C][C]7.1319[/C][C]6.5852[/C][C]7.6785[/C][C]0.4545[/C][C]0.2733[/C][C]9e-04[/C][C]0.4035[/C][/ROW]
[ROW][C]63[/C][C]6.8[/C][C]6.7305[/C][C]6.0644[/C][C]7.3966[/C][C]0.419[/C][C]0.1385[/C][C]3e-04[/C][C]0.0836[/C][/ROW]
[ROW][C]64[/C][C]6.4[/C][C]6.4618[/C][C]5.7692[/C][C]7.1545[/C][C]0.4305[/C][C]0.1693[/C][C]0[/C][C]0.0184[/C][/ROW]
[ROW][C]65[/C][C]6.1[/C][C]6.0626[/C][C]5.3697[/C][C]6.7554[/C][C]0.4578[/C][C]0.1699[/C][C]0[/C][C]6e-04[/C][/ROW]
[ROW][C]66[/C][C]6.5[/C][C]5.738[/C][C]5.0449[/C][C]6.4311[/C][C]0.0156[/C][C]0.153[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]67[/C][C]7.7[/C][C]6.2453[/C][C]5.5506[/C][C]6.9399[/C][C]0[/C][C]0.2361[/C][C]2e-04[/C][C]0.0035[/C][/ROW]
[ROW][C]68[/C][C]7.9[/C][C]6.2169[/C][C]5.5006[/C][C]6.9332[/C][C]0[/C][C]0[/C][C]0.0015[/C][C]0.0036[/C][/ROW]
[ROW][C]69[/C][C]7.5[/C][C]6.0024[/C][C]5.2214[/C][C]6.7835[/C][C]1e-04[/C][C]0[/C][C]0.0061[/C][C]0.0013[/C][/ROW]
[ROW][C]70[/C][C]6.9[/C][C]5.828[/C][C]4.9617[/C][C]6.6943[/C][C]0.0076[/C][C]1e-04[/C][C]0.004[/C][C]0.001[/C][/ROW]
[ROW][C]71[/C][C]6.6[/C][C]5.6202[/C][C]4.6782[/C][C]6.5622[/C][C]0.0207[/C][C]0.0039[/C][C]0.002[/C][C]5e-04[/C][/ROW]
[ROW][C]72[/C][C]6.9[/C][C]5.6526[/C][C]4.661[/C][C]6.6443[/C][C]0.0068[/C][C]0.0306[/C][C]0.0011[/C][C]0.0011[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69034&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69034&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[60])
487.9-------
498-------
508-------
517.9-------
528-------
537.7-------
547.2-------
557.5-------
567.3-------
577-------
587-------
597-------
607.2-------
617.37.3036.97977.62630.49270.733900.7339
627.17.13196.58527.67850.45450.27339e-040.4035
636.86.73056.06447.39660.4190.13853e-040.0836
646.46.46185.76927.15450.43050.169300.0184
656.16.06265.36976.75540.45780.169906e-04
666.55.7385.04496.43110.01560.15300
677.76.24535.55066.939900.23612e-040.0035
687.96.21695.50066.9332000.00150.0036
697.56.00245.22146.78351e-0400.00610.0013
706.95.8284.96176.69430.00761e-040.0040.001
716.65.62024.67826.56220.02070.00390.0025e-04
726.95.65264.6616.64430.00680.03060.00110.0011







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0226-4e-040000
620.0391-0.00450.00240.0015e-040.0226
630.05050.01030.00510.00480.0020.0442
640.0547-0.00960.00620.00380.00240.0492
650.05830.00620.00620.00140.00220.0471
660.06160.13280.02730.58060.09860.314
670.05670.23290.05672.11630.38690.622
680.05880.27070.08342.83290.69260.8322
690.06640.24950.10192.24270.86480.93
700.07580.18390.11011.14920.89330.9451
710.08550.17430.11590.96010.89930.9483
720.08950.22070.12471.55590.95410.9768

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0226 & -4e-04 & 0 & 0 & 0 & 0 \tabularnewline
62 & 0.0391 & -0.0045 & 0.0024 & 0.001 & 5e-04 & 0.0226 \tabularnewline
63 & 0.0505 & 0.0103 & 0.0051 & 0.0048 & 0.002 & 0.0442 \tabularnewline
64 & 0.0547 & -0.0096 & 0.0062 & 0.0038 & 0.0024 & 0.0492 \tabularnewline
65 & 0.0583 & 0.0062 & 0.0062 & 0.0014 & 0.0022 & 0.0471 \tabularnewline
66 & 0.0616 & 0.1328 & 0.0273 & 0.5806 & 0.0986 & 0.314 \tabularnewline
67 & 0.0567 & 0.2329 & 0.0567 & 2.1163 & 0.3869 & 0.622 \tabularnewline
68 & 0.0588 & 0.2707 & 0.0834 & 2.8329 & 0.6926 & 0.8322 \tabularnewline
69 & 0.0664 & 0.2495 & 0.1019 & 2.2427 & 0.8648 & 0.93 \tabularnewline
70 & 0.0758 & 0.1839 & 0.1101 & 1.1492 & 0.8933 & 0.9451 \tabularnewline
71 & 0.0855 & 0.1743 & 0.1159 & 0.9601 & 0.8993 & 0.9483 \tabularnewline
72 & 0.0895 & 0.2207 & 0.1247 & 1.5559 & 0.9541 & 0.9768 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69034&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]61[/C][C]0.0226[/C][C]-4e-04[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0391[/C][C]-0.0045[/C][C]0.0024[/C][C]0.001[/C][C]5e-04[/C][C]0.0226[/C][/ROW]
[ROW][C]63[/C][C]0.0505[/C][C]0.0103[/C][C]0.0051[/C][C]0.0048[/C][C]0.002[/C][C]0.0442[/C][/ROW]
[ROW][C]64[/C][C]0.0547[/C][C]-0.0096[/C][C]0.0062[/C][C]0.0038[/C][C]0.0024[/C][C]0.0492[/C][/ROW]
[ROW][C]65[/C][C]0.0583[/C][C]0.0062[/C][C]0.0062[/C][C]0.0014[/C][C]0.0022[/C][C]0.0471[/C][/ROW]
[ROW][C]66[/C][C]0.0616[/C][C]0.1328[/C][C]0.0273[/C][C]0.5806[/C][C]0.0986[/C][C]0.314[/C][/ROW]
[ROW][C]67[/C][C]0.0567[/C][C]0.2329[/C][C]0.0567[/C][C]2.1163[/C][C]0.3869[/C][C]0.622[/C][/ROW]
[ROW][C]68[/C][C]0.0588[/C][C]0.2707[/C][C]0.0834[/C][C]2.8329[/C][C]0.6926[/C][C]0.8322[/C][/ROW]
[ROW][C]69[/C][C]0.0664[/C][C]0.2495[/C][C]0.1019[/C][C]2.2427[/C][C]0.8648[/C][C]0.93[/C][/ROW]
[ROW][C]70[/C][C]0.0758[/C][C]0.1839[/C][C]0.1101[/C][C]1.1492[/C][C]0.8933[/C][C]0.9451[/C][/ROW]
[ROW][C]71[/C][C]0.0855[/C][C]0.1743[/C][C]0.1159[/C][C]0.9601[/C][C]0.8993[/C][C]0.9483[/C][/ROW]
[ROW][C]72[/C][C]0.0895[/C][C]0.2207[/C][C]0.1247[/C][C]1.5559[/C][C]0.9541[/C][C]0.9768[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69034&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69034&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
610.0226-4e-040000
620.0391-0.00450.00240.0015e-040.0226
630.05050.01030.00510.00480.0020.0442
640.0547-0.00960.00620.00380.00240.0492
650.05830.00620.00620.00140.00220.0471
660.06160.13280.02730.58060.09860.314
670.05670.23290.05672.11630.38690.622
680.05880.27070.08342.83290.69260.8322
690.06640.24950.10192.24270.86480.93
700.07580.18390.11011.14920.89330.9451
710.08550.17430.11590.96010.89930.9483
720.08950.22070.12471.55590.95410.9768



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; 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
par6 <- 3
par7 <- as.numeric(par7) #q
par7 <- 3
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')