Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 06 Dec 2007 13:21:13 -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/2007/Dec/06/t1196971685z5o5shz6tffixug.htm/, Retrieved Fri, 03 May 2024 04:46:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2711, Retrieved Fri, 03 May 2024 04:46:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact184
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Q1] [2007-12-06 20:21:13] [2127dfc39c0d0690439ab654f5655d7e] [Current]
Feedback Forum

Post a new message
Dataseries X:
7.4
7.2
7
6.6
6.4
6.4
6.8
7.3
7
7
6.7
6.7
6.3
6.2
6
6.3
6.2
6.1
6.2
6.6
6.6
7.8
7.4
7.4
7.5
7.4
7.4
7
6.9
6.9
7.6
7.7
7.6
8.2
8
8.1
8.3
8.2
8.1
7.7
7.6
7.7
8.2
8.4
8.4
8.6
8.4
8.5
8.7
8.7
8.6
7.4
7.3
7.4
9
9.2
9.2
8.5
8.3
8.3
8.6
8.6
8.5
8.1
8.1
8
8.6
8.7
8.7
8.6
8.4
8.4
8.7
8.7
8.5
8.3
8.3
8.3
8.1
8.2
8.1
8.1
7.9
7.7
8.1
8
7.7
7.8
7.6
7.4
7.7
7.9
7.6




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

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 5 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2711&T=0

[TABLE]
[ROW][C]Summary of compuational 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]5 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=2711&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2711&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 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[81])
698.7-------
708.6-------
718.4-------
728.4-------
738.7-------
748.7-------
758.5-------
768.3-------
778.3-------
788.3-------
798.1-------
808.2-------
818.1-------
828.18.15227.61038.73280.430.570.06530.57
837.98.05767.30468.88820.3550.46020.20960.4602
847.78.08097.1599.12140.23660.63330.27390.4856
858.18.04517.0769.14690.46110.73030.1220.4611
8688.03797.02779.19340.47430.45810.13070.4581
877.77.90916.87789.0950.36490.44030.16440.3762
887.88.07576.96149.36830.3380.71550.36690.4853
897.68.10496.92459.48670.23690.66730.3910.5028
907.48.08196.84499.54240.18010.74110.38490.4903
917.77.78526.54849.25550.45480.69620.33740.3374
927.97.84046.55359.380.46980.57090.32350.3705
937.67.83136.5079.42510.3880.46630.37050.3705

\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[81]) \tabularnewline
69 & 8.7 & - & - & - & - & - & - & - \tabularnewline
70 & 8.6 & - & - & - & - & - & - & - \tabularnewline
71 & 8.4 & - & - & - & - & - & - & - \tabularnewline
72 & 8.4 & - & - & - & - & - & - & - \tabularnewline
73 & 8.7 & - & - & - & - & - & - & - \tabularnewline
74 & 8.7 & - & - & - & - & - & - & - \tabularnewline
75 & 8.5 & - & - & - & - & - & - & - \tabularnewline
76 & 8.3 & - & - & - & - & - & - & - \tabularnewline
77 & 8.3 & - & - & - & - & - & - & - \tabularnewline
78 & 8.3 & - & - & - & - & - & - & - \tabularnewline
79 & 8.1 & - & - & - & - & - & - & - \tabularnewline
80 & 8.2 & - & - & - & - & - & - & - \tabularnewline
81 & 8.1 & - & - & - & - & - & - & - \tabularnewline
82 & 8.1 & 8.1522 & 7.6103 & 8.7328 & 0.43 & 0.57 & 0.0653 & 0.57 \tabularnewline
83 & 7.9 & 8.0576 & 7.3046 & 8.8882 & 0.355 & 0.4602 & 0.2096 & 0.4602 \tabularnewline
84 & 7.7 & 8.0809 & 7.159 & 9.1214 & 0.2366 & 0.6333 & 0.2739 & 0.4856 \tabularnewline
85 & 8.1 & 8.0451 & 7.076 & 9.1469 & 0.4611 & 0.7303 & 0.122 & 0.4611 \tabularnewline
86 & 8 & 8.0379 & 7.0277 & 9.1934 & 0.4743 & 0.4581 & 0.1307 & 0.4581 \tabularnewline
87 & 7.7 & 7.9091 & 6.8778 & 9.095 & 0.3649 & 0.4403 & 0.1644 & 0.3762 \tabularnewline
88 & 7.8 & 8.0757 & 6.9614 & 9.3683 & 0.338 & 0.7155 & 0.3669 & 0.4853 \tabularnewline
89 & 7.6 & 8.1049 & 6.9245 & 9.4867 & 0.2369 & 0.6673 & 0.391 & 0.5028 \tabularnewline
90 & 7.4 & 8.0819 & 6.8449 & 9.5424 & 0.1801 & 0.7411 & 0.3849 & 0.4903 \tabularnewline
91 & 7.7 & 7.7852 & 6.5484 & 9.2555 & 0.4548 & 0.6962 & 0.3374 & 0.3374 \tabularnewline
92 & 7.9 & 7.8404 & 6.5535 & 9.38 & 0.4698 & 0.5709 & 0.3235 & 0.3705 \tabularnewline
93 & 7.6 & 7.8313 & 6.507 & 9.4251 & 0.388 & 0.4663 & 0.3705 & 0.3705 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2711&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[81])[/C][/ROW]
[ROW][C]69[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]8.1[/C][C]8.1522[/C][C]7.6103[/C][C]8.7328[/C][C]0.43[/C][C]0.57[/C][C]0.0653[/C][C]0.57[/C][/ROW]
[ROW][C]83[/C][C]7.9[/C][C]8.0576[/C][C]7.3046[/C][C]8.8882[/C][C]0.355[/C][C]0.4602[/C][C]0.2096[/C][C]0.4602[/C][/ROW]
[ROW][C]84[/C][C]7.7[/C][C]8.0809[/C][C]7.159[/C][C]9.1214[/C][C]0.2366[/C][C]0.6333[/C][C]0.2739[/C][C]0.4856[/C][/ROW]
[ROW][C]85[/C][C]8.1[/C][C]8.0451[/C][C]7.076[/C][C]9.1469[/C][C]0.4611[/C][C]0.7303[/C][C]0.122[/C][C]0.4611[/C][/ROW]
[ROW][C]86[/C][C]8[/C][C]8.0379[/C][C]7.0277[/C][C]9.1934[/C][C]0.4743[/C][C]0.4581[/C][C]0.1307[/C][C]0.4581[/C][/ROW]
[ROW][C]87[/C][C]7.7[/C][C]7.9091[/C][C]6.8778[/C][C]9.095[/C][C]0.3649[/C][C]0.4403[/C][C]0.1644[/C][C]0.3762[/C][/ROW]
[ROW][C]88[/C][C]7.8[/C][C]8.0757[/C][C]6.9614[/C][C]9.3683[/C][C]0.338[/C][C]0.7155[/C][C]0.3669[/C][C]0.4853[/C][/ROW]
[ROW][C]89[/C][C]7.6[/C][C]8.1049[/C][C]6.9245[/C][C]9.4867[/C][C]0.2369[/C][C]0.6673[/C][C]0.391[/C][C]0.5028[/C][/ROW]
[ROW][C]90[/C][C]7.4[/C][C]8.0819[/C][C]6.8449[/C][C]9.5424[/C][C]0.1801[/C][C]0.7411[/C][C]0.3849[/C][C]0.4903[/C][/ROW]
[ROW][C]91[/C][C]7.7[/C][C]7.7852[/C][C]6.5484[/C][C]9.2555[/C][C]0.4548[/C][C]0.6962[/C][C]0.3374[/C][C]0.3374[/C][/ROW]
[ROW][C]92[/C][C]7.9[/C][C]7.8404[/C][C]6.5535[/C][C]9.38[/C][C]0.4698[/C][C]0.5709[/C][C]0.3235[/C][C]0.3705[/C][/ROW]
[ROW][C]93[/C][C]7.6[/C][C]7.8313[/C][C]6.507[/C][C]9.4251[/C][C]0.388[/C][C]0.4663[/C][C]0.3705[/C][C]0.3705[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2711&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2711&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[81])
698.7-------
708.6-------
718.4-------
728.4-------
738.7-------
748.7-------
758.5-------
768.3-------
778.3-------
788.3-------
798.1-------
808.2-------
818.1-------
828.18.15227.61038.73280.430.570.06530.57
837.98.05767.30468.88820.3550.46020.20960.4602
847.78.08097.1599.12140.23660.63330.27390.4856
858.18.04517.0769.14690.46110.73030.1220.4611
8688.03797.02779.19340.47430.45810.13070.4581
877.77.90916.87789.0950.36490.44030.16440.3762
887.88.07576.96149.36830.3380.71550.36690.4853
897.68.10496.92459.48670.23690.66730.3910.5028
907.48.08196.84499.54240.18010.74110.38490.4903
917.77.78526.54849.25550.45480.69620.33740.3374
927.97.84046.55359.380.46980.57090.32350.3705
937.67.83136.5079.42510.3880.46630.37050.3705







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
820.0363-0.00645e-040.00272e-040.0151
830.0526-0.01960.00160.02480.00210.0455
840.0657-0.04710.00390.1450.01210.1099
850.06990.00686e-040.0033e-040.0159
860.0733-0.00474e-040.00141e-040.0109
870.0765-0.02640.00220.04370.00360.0604
880.0817-0.03410.00280.0760.00630.0796
890.087-0.06230.00520.2550.02120.1458
900.0922-0.08440.0070.46490.03870.1968
910.0964-0.01099e-040.00736e-040.0246
920.10020.00766e-040.00363e-040.0172
930.1038-0.02950.00250.05350.00450.0668

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
82 & 0.0363 & -0.0064 & 5e-04 & 0.0027 & 2e-04 & 0.0151 \tabularnewline
83 & 0.0526 & -0.0196 & 0.0016 & 0.0248 & 0.0021 & 0.0455 \tabularnewline
84 & 0.0657 & -0.0471 & 0.0039 & 0.145 & 0.0121 & 0.1099 \tabularnewline
85 & 0.0699 & 0.0068 & 6e-04 & 0.003 & 3e-04 & 0.0159 \tabularnewline
86 & 0.0733 & -0.0047 & 4e-04 & 0.0014 & 1e-04 & 0.0109 \tabularnewline
87 & 0.0765 & -0.0264 & 0.0022 & 0.0437 & 0.0036 & 0.0604 \tabularnewline
88 & 0.0817 & -0.0341 & 0.0028 & 0.076 & 0.0063 & 0.0796 \tabularnewline
89 & 0.087 & -0.0623 & 0.0052 & 0.255 & 0.0212 & 0.1458 \tabularnewline
90 & 0.0922 & -0.0844 & 0.007 & 0.4649 & 0.0387 & 0.1968 \tabularnewline
91 & 0.0964 & -0.0109 & 9e-04 & 0.0073 & 6e-04 & 0.0246 \tabularnewline
92 & 0.1002 & 0.0076 & 6e-04 & 0.0036 & 3e-04 & 0.0172 \tabularnewline
93 & 0.1038 & -0.0295 & 0.0025 & 0.0535 & 0.0045 & 0.0668 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2711&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]82[/C][C]0.0363[/C][C]-0.0064[/C][C]5e-04[/C][C]0.0027[/C][C]2e-04[/C][C]0.0151[/C][/ROW]
[ROW][C]83[/C][C]0.0526[/C][C]-0.0196[/C][C]0.0016[/C][C]0.0248[/C][C]0.0021[/C][C]0.0455[/C][/ROW]
[ROW][C]84[/C][C]0.0657[/C][C]-0.0471[/C][C]0.0039[/C][C]0.145[/C][C]0.0121[/C][C]0.1099[/C][/ROW]
[ROW][C]85[/C][C]0.0699[/C][C]0.0068[/C][C]6e-04[/C][C]0.003[/C][C]3e-04[/C][C]0.0159[/C][/ROW]
[ROW][C]86[/C][C]0.0733[/C][C]-0.0047[/C][C]4e-04[/C][C]0.0014[/C][C]1e-04[/C][C]0.0109[/C][/ROW]
[ROW][C]87[/C][C]0.0765[/C][C]-0.0264[/C][C]0.0022[/C][C]0.0437[/C][C]0.0036[/C][C]0.0604[/C][/ROW]
[ROW][C]88[/C][C]0.0817[/C][C]-0.0341[/C][C]0.0028[/C][C]0.076[/C][C]0.0063[/C][C]0.0796[/C][/ROW]
[ROW][C]89[/C][C]0.087[/C][C]-0.0623[/C][C]0.0052[/C][C]0.255[/C][C]0.0212[/C][C]0.1458[/C][/ROW]
[ROW][C]90[/C][C]0.0922[/C][C]-0.0844[/C][C]0.007[/C][C]0.4649[/C][C]0.0387[/C][C]0.1968[/C][/ROW]
[ROW][C]91[/C][C]0.0964[/C][C]-0.0109[/C][C]9e-04[/C][C]0.0073[/C][C]6e-04[/C][C]0.0246[/C][/ROW]
[ROW][C]92[/C][C]0.1002[/C][C]0.0076[/C][C]6e-04[/C][C]0.0036[/C][C]3e-04[/C][C]0.0172[/C][/ROW]
[ROW][C]93[/C][C]0.1038[/C][C]-0.0295[/C][C]0.0025[/C][C]0.0535[/C][C]0.0045[/C][C]0.0668[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2711&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2711&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
820.0363-0.00645e-040.00272e-040.0151
830.0526-0.01960.00160.02480.00210.0455
840.0657-0.04710.00390.1450.01210.1099
850.06990.00686e-040.0033e-040.0159
860.0733-0.00474e-040.00141e-040.0109
870.0765-0.02640.00220.04370.00360.0604
880.0817-0.03410.00280.0760.00630.0796
890.087-0.06230.00520.2550.02120.1458
900.0922-0.08440.0070.46490.03870.1968
910.0964-0.01099e-040.00736e-040.0246
920.10020.00766e-040.00363e-040.0172
930.1038-0.02950.00250.05350.00450.0668



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