Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 17 Dec 2009 16:00:40 -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/18/t1261090937zuwmjnnifqare7l.htm/, Retrieved Sat, 27 Apr 2024 09:09:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69144, Retrieved Sat, 27 Apr 2024 09:09:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact132
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-17 23:00:40] [e24e91da8d334fb8882bf413603fde71] [Current]
Feedback Forum

Post a new message
Dataseries X:
0.8
1.1
1.3
1.2
1.3
1.1
1.3
1.2
1.6
1.7
1.5
0.9
1.5
1.4
1.6
1.7
1.4
1.8
1.7
1.4
1.2
1
1.7
2.4
2
2.1
2
1.8
2.7
2.3
1.9
2
2.3
2.8
2.4
2.3
2.7
2.7
2.9
3
2.2
2.3
2.8
2.8
2.8
2.2
2.6
2.8
2.5
2.4
2.3
1.9
1.7
2
2.1
1.7
1.8
1.8
1.8
1.3
1.3
1.3
1.2
1.4
2.2
2.9
3.1
3.5
3.6
4.4
4.1
5.1
5.8
5.9
5.4
5.5
4.8
3.2
2.7
2.1
1.9
0.6
0.7
-0.2
-1
-1.7
-0.7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69144&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'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[75])
631.2-------
641.4-------
652.2-------
662.9-------
673.1-------
683.5-------
693.6-------
704.4-------
714.1-------
725.1-------
735.8-------
745.9-------
755.4-------
765.55.38474.785.98940.35430.480210.4802
774.84.84383.98875.6990.460.066310.1012
783.24.20783.16045.25520.02960.13390.99280.0128
792.74.02122.81185.23060.01610.90840.93230.0127
802.13.85362.50145.20570.00550.95280.69590.0125
811.93.74312.26195.22440.00740.98520.57510.0142
820.63.13371.53384.73370.0010.93470.06040.0027
830.73.36231.65195.07260.00110.99920.19890.0098
84-0.22.77180.95774.5867e-040.98740.00590.0023
85-12.23860.32644.15095e-040.99381e-046e-04
86-1.72.16240.15694.1681e-040.9991e-048e-04
87-0.72.57760.48284.67230.001110.00410.0041

\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[75]) \tabularnewline
63 & 1.2 & - & - & - & - & - & - & - \tabularnewline
64 & 1.4 & - & - & - & - & - & - & - \tabularnewline
65 & 2.2 & - & - & - & - & - & - & - \tabularnewline
66 & 2.9 & - & - & - & - & - & - & - \tabularnewline
67 & 3.1 & - & - & - & - & - & - & - \tabularnewline
68 & 3.5 & - & - & - & - & - & - & - \tabularnewline
69 & 3.6 & - & - & - & - & - & - & - \tabularnewline
70 & 4.4 & - & - & - & - & - & - & - \tabularnewline
71 & 4.1 & - & - & - & - & - & - & - \tabularnewline
72 & 5.1 & - & - & - & - & - & - & - \tabularnewline
73 & 5.8 & - & - & - & - & - & - & - \tabularnewline
74 & 5.9 & - & - & - & - & - & - & - \tabularnewline
75 & 5.4 & - & - & - & - & - & - & - \tabularnewline
76 & 5.5 & 5.3847 & 4.78 & 5.9894 & 0.3543 & 0.4802 & 1 & 0.4802 \tabularnewline
77 & 4.8 & 4.8438 & 3.9887 & 5.699 & 0.46 & 0.0663 & 1 & 0.1012 \tabularnewline
78 & 3.2 & 4.2078 & 3.1604 & 5.2552 & 0.0296 & 0.1339 & 0.9928 & 0.0128 \tabularnewline
79 & 2.7 & 4.0212 & 2.8118 & 5.2306 & 0.0161 & 0.9084 & 0.9323 & 0.0127 \tabularnewline
80 & 2.1 & 3.8536 & 2.5014 & 5.2057 & 0.0055 & 0.9528 & 0.6959 & 0.0125 \tabularnewline
81 & 1.9 & 3.7431 & 2.2619 & 5.2244 & 0.0074 & 0.9852 & 0.5751 & 0.0142 \tabularnewline
82 & 0.6 & 3.1337 & 1.5338 & 4.7337 & 0.001 & 0.9347 & 0.0604 & 0.0027 \tabularnewline
83 & 0.7 & 3.3623 & 1.6519 & 5.0726 & 0.0011 & 0.9992 & 0.1989 & 0.0098 \tabularnewline
84 & -0.2 & 2.7718 & 0.9577 & 4.586 & 7e-04 & 0.9874 & 0.0059 & 0.0023 \tabularnewline
85 & -1 & 2.2386 & 0.3264 & 4.1509 & 5e-04 & 0.9938 & 1e-04 & 6e-04 \tabularnewline
86 & -1.7 & 2.1624 & 0.1569 & 4.168 & 1e-04 & 0.999 & 1e-04 & 8e-04 \tabularnewline
87 & -0.7 & 2.5776 & 0.4828 & 4.6723 & 0.0011 & 1 & 0.0041 & 0.0041 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69144&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[75])[/C][/ROW]
[ROW][C]63[/C][C]1.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]1.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]2.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]3.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]4.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]4.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]5.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]5.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]5.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]5.5[/C][C]5.3847[/C][C]4.78[/C][C]5.9894[/C][C]0.3543[/C][C]0.4802[/C][C]1[/C][C]0.4802[/C][/ROW]
[ROW][C]77[/C][C]4.8[/C][C]4.8438[/C][C]3.9887[/C][C]5.699[/C][C]0.46[/C][C]0.0663[/C][C]1[/C][C]0.1012[/C][/ROW]
[ROW][C]78[/C][C]3.2[/C][C]4.2078[/C][C]3.1604[/C][C]5.2552[/C][C]0.0296[/C][C]0.1339[/C][C]0.9928[/C][C]0.0128[/C][/ROW]
[ROW][C]79[/C][C]2.7[/C][C]4.0212[/C][C]2.8118[/C][C]5.2306[/C][C]0.0161[/C][C]0.9084[/C][C]0.9323[/C][C]0.0127[/C][/ROW]
[ROW][C]80[/C][C]2.1[/C][C]3.8536[/C][C]2.5014[/C][C]5.2057[/C][C]0.0055[/C][C]0.9528[/C][C]0.6959[/C][C]0.0125[/C][/ROW]
[ROW][C]81[/C][C]1.9[/C][C]3.7431[/C][C]2.2619[/C][C]5.2244[/C][C]0.0074[/C][C]0.9852[/C][C]0.5751[/C][C]0.0142[/C][/ROW]
[ROW][C]82[/C][C]0.6[/C][C]3.1337[/C][C]1.5338[/C][C]4.7337[/C][C]0.001[/C][C]0.9347[/C][C]0.0604[/C][C]0.0027[/C][/ROW]
[ROW][C]83[/C][C]0.7[/C][C]3.3623[/C][C]1.6519[/C][C]5.0726[/C][C]0.0011[/C][C]0.9992[/C][C]0.1989[/C][C]0.0098[/C][/ROW]
[ROW][C]84[/C][C]-0.2[/C][C]2.7718[/C][C]0.9577[/C][C]4.586[/C][C]7e-04[/C][C]0.9874[/C][C]0.0059[/C][C]0.0023[/C][/ROW]
[ROW][C]85[/C][C]-1[/C][C]2.2386[/C][C]0.3264[/C][C]4.1509[/C][C]5e-04[/C][C]0.9938[/C][C]1e-04[/C][C]6e-04[/C][/ROW]
[ROW][C]86[/C][C]-1.7[/C][C]2.1624[/C][C]0.1569[/C][C]4.168[/C][C]1e-04[/C][C]0.999[/C][C]1e-04[/C][C]8e-04[/C][/ROW]
[ROW][C]87[/C][C]-0.7[/C][C]2.5776[/C][C]0.4828[/C][C]4.6723[/C][C]0.0011[/C][C]1[/C][C]0.0041[/C][C]0.0041[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69144&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69144&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[75])
631.2-------
641.4-------
652.2-------
662.9-------
673.1-------
683.5-------
693.6-------
704.4-------
714.1-------
725.1-------
735.8-------
745.9-------
755.4-------
765.55.38474.785.98940.35430.480210.4802
774.84.84383.98875.6990.460.066310.1012
783.24.20783.16045.25520.02960.13390.99280.0128
792.74.02122.81185.23060.01610.90840.93230.0127
802.13.85362.50145.20570.00550.95280.69590.0125
811.93.74312.26195.22440.00740.98520.57510.0142
820.63.13371.53384.73370.0010.93470.06040.0027
830.73.36231.65195.07260.00110.99920.19890.0098
84-0.22.77180.95774.5867e-040.98740.00590.0023
85-12.23860.32644.15095e-040.99381e-046e-04
86-1.72.16240.15694.1681e-040.9991e-048e-04
87-0.72.57760.48284.67230.001110.00410.0041







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
760.05730.021400.013300
770.0901-0.0090.01520.00190.00760.0872
780.127-0.23950.091.01570.34360.5862
790.1534-0.32860.14961.74560.69410.8332
800.179-0.45510.21073.0751.17031.0818
810.2019-0.49240.25773.39721.54151.2416
820.2605-0.80850.33646.41992.23841.4961
830.2595-0.79180.39337.08772.84451.6866
840.3339-1.07220.46878.83183.50981.8734
850.4358-1.44670.566510.48874.20772.0513
860.4732-1.78610.677414.91855.18142.2763
870.4146-1.27160.726910.74255.64482.3759

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
76 & 0.0573 & 0.0214 & 0 & 0.0133 & 0 & 0 \tabularnewline
77 & 0.0901 & -0.009 & 0.0152 & 0.0019 & 0.0076 & 0.0872 \tabularnewline
78 & 0.127 & -0.2395 & 0.09 & 1.0157 & 0.3436 & 0.5862 \tabularnewline
79 & 0.1534 & -0.3286 & 0.1496 & 1.7456 & 0.6941 & 0.8332 \tabularnewline
80 & 0.179 & -0.4551 & 0.2107 & 3.075 & 1.1703 & 1.0818 \tabularnewline
81 & 0.2019 & -0.4924 & 0.2577 & 3.3972 & 1.5415 & 1.2416 \tabularnewline
82 & 0.2605 & -0.8085 & 0.3364 & 6.4199 & 2.2384 & 1.4961 \tabularnewline
83 & 0.2595 & -0.7918 & 0.3933 & 7.0877 & 2.8445 & 1.6866 \tabularnewline
84 & 0.3339 & -1.0722 & 0.4687 & 8.8318 & 3.5098 & 1.8734 \tabularnewline
85 & 0.4358 & -1.4467 & 0.5665 & 10.4887 & 4.2077 & 2.0513 \tabularnewline
86 & 0.4732 & -1.7861 & 0.6774 & 14.9185 & 5.1814 & 2.2763 \tabularnewline
87 & 0.4146 & -1.2716 & 0.7269 & 10.7425 & 5.6448 & 2.3759 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69144&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]76[/C][C]0.0573[/C][C]0.0214[/C][C]0[/C][C]0.0133[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]77[/C][C]0.0901[/C][C]-0.009[/C][C]0.0152[/C][C]0.0019[/C][C]0.0076[/C][C]0.0872[/C][/ROW]
[ROW][C]78[/C][C]0.127[/C][C]-0.2395[/C][C]0.09[/C][C]1.0157[/C][C]0.3436[/C][C]0.5862[/C][/ROW]
[ROW][C]79[/C][C]0.1534[/C][C]-0.3286[/C][C]0.1496[/C][C]1.7456[/C][C]0.6941[/C][C]0.8332[/C][/ROW]
[ROW][C]80[/C][C]0.179[/C][C]-0.4551[/C][C]0.2107[/C][C]3.075[/C][C]1.1703[/C][C]1.0818[/C][/ROW]
[ROW][C]81[/C][C]0.2019[/C][C]-0.4924[/C][C]0.2577[/C][C]3.3972[/C][C]1.5415[/C][C]1.2416[/C][/ROW]
[ROW][C]82[/C][C]0.2605[/C][C]-0.8085[/C][C]0.3364[/C][C]6.4199[/C][C]2.2384[/C][C]1.4961[/C][/ROW]
[ROW][C]83[/C][C]0.2595[/C][C]-0.7918[/C][C]0.3933[/C][C]7.0877[/C][C]2.8445[/C][C]1.6866[/C][/ROW]
[ROW][C]84[/C][C]0.3339[/C][C]-1.0722[/C][C]0.4687[/C][C]8.8318[/C][C]3.5098[/C][C]1.8734[/C][/ROW]
[ROW][C]85[/C][C]0.4358[/C][C]-1.4467[/C][C]0.5665[/C][C]10.4887[/C][C]4.2077[/C][C]2.0513[/C][/ROW]
[ROW][C]86[/C][C]0.4732[/C][C]-1.7861[/C][C]0.6774[/C][C]14.9185[/C][C]5.1814[/C][C]2.2763[/C][/ROW]
[ROW][C]87[/C][C]0.4146[/C][C]-1.2716[/C][C]0.7269[/C][C]10.7425[/C][C]5.6448[/C][C]2.3759[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69144&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69144&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
760.05730.021400.013300
770.0901-0.0090.01520.00190.00760.0872
780.127-0.23950.091.01570.34360.5862
790.1534-0.32860.14961.74560.69410.8332
800.179-0.45510.21073.0751.17031.0818
810.2019-0.49240.25773.39721.54151.2416
820.2605-0.80850.33646.41992.23841.4961
830.2595-0.79180.39337.08772.84451.6866
840.3339-1.07220.46878.83183.50981.8734
850.4358-1.44670.566510.48874.20772.0513
860.4732-1.78610.677414.91855.18142.2763
870.4146-1.27160.726910.74255.64482.3759



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