Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 24 Jan 2008 06:21:18 -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/2008/Jan/24/t1201180639ba110kmsga062js.htm/, Retrieved Mon, 13 May 2024 21:03:39 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=8061, Retrieved Mon, 13 May 2024 21:03:39 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact298
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper4] [2008-01-24 13:21:18] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
-12.7
-2.4
7.1
-3.9
9.5
5
-16.1
-10.8
7
13.6
8.1
-8.1
4.9
-0.8
4.3
4
1.5
5.4
-11.3
-16.4
-2
8.9
-7.2
-18
1.3
6.3
-6
2.8
2
5.1
-7.6
-18.6
5.8
20.3
0.7
-11.2
-5.7
-0.1
3.4
3.3
-1.2
4.2
-8.8
-25.3
8.5
14.5
-3.1
-10.4
-2.9
0.3
22.6
15.4
9
29.1
2.8
-3.8
27.7
28.9
26.5
19.8
13.2
14.1
34.1
30
21.8
32.1
5.3
3
17.1
26.3
38.1
19.5
38
35.5
78.6
62.2
76.9
104.9
32.2
42.5
64.3
74.9
75.4
43
58.7
55.4
76.6
63.3
78.9
82.7




Summary of compuational 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 compuational 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=8061&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]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=8061&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8061&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 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[78])
6632.1-------
675.3-------
683-------
6917.1-------
7026.3-------
7138.1-------
7219.5-------
7338-------
7435.5-------
7578.6-------
7662.2-------
7776.9-------
78104.9-------
7932.271.424454.502188.346801e-0411e-04
8042.580.592361.677399.50740110.0059
8164.3105.602483.2843127.92051e-04110.5246
8274.9113.08984.7864141.39170.00410.999610.7147
8375.4127.728495.6855159.77137e-040.999410.9187
8443115.858979.2798152.43800.984910.7215
8558.7129.276387.7331170.81954e-04110.8749
8655.4131.767385.8889177.64576e-040.999110.8745
8776.6170.424119.9342220.91391e-0410.99980.9945
8863.3159.7369104.6427214.83113e-040.99840.99970.9745
8978.9170.2287110.7462229.71120.00130.99980.99890.9843
9082.7194.7839130.8686258.69923e-040.99980.99710.9971

\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[78]) \tabularnewline
66 & 32.1 & - & - & - & - & - & - & - \tabularnewline
67 & 5.3 & - & - & - & - & - & - & - \tabularnewline
68 & 3 & - & - & - & - & - & - & - \tabularnewline
69 & 17.1 & - & - & - & - & - & - & - \tabularnewline
70 & 26.3 & - & - & - & - & - & - & - \tabularnewline
71 & 38.1 & - & - & - & - & - & - & - \tabularnewline
72 & 19.5 & - & - & - & - & - & - & - \tabularnewline
73 & 38 & - & - & - & - & - & - & - \tabularnewline
74 & 35.5 & - & - & - & - & - & - & - \tabularnewline
75 & 78.6 & - & - & - & - & - & - & - \tabularnewline
76 & 62.2 & - & - & - & - & - & - & - \tabularnewline
77 & 76.9 & - & - & - & - & - & - & - \tabularnewline
78 & 104.9 & - & - & - & - & - & - & - \tabularnewline
79 & 32.2 & 71.4244 & 54.5021 & 88.3468 & 0 & 1e-04 & 1 & 1e-04 \tabularnewline
80 & 42.5 & 80.5923 & 61.6773 & 99.5074 & 0 & 1 & 1 & 0.0059 \tabularnewline
81 & 64.3 & 105.6024 & 83.2843 & 127.9205 & 1e-04 & 1 & 1 & 0.5246 \tabularnewline
82 & 74.9 & 113.089 & 84.7864 & 141.3917 & 0.0041 & 0.9996 & 1 & 0.7147 \tabularnewline
83 & 75.4 & 127.7284 & 95.6855 & 159.7713 & 7e-04 & 0.9994 & 1 & 0.9187 \tabularnewline
84 & 43 & 115.8589 & 79.2798 & 152.438 & 0 & 0.9849 & 1 & 0.7215 \tabularnewline
85 & 58.7 & 129.2763 & 87.7331 & 170.8195 & 4e-04 & 1 & 1 & 0.8749 \tabularnewline
86 & 55.4 & 131.7673 & 85.8889 & 177.6457 & 6e-04 & 0.9991 & 1 & 0.8745 \tabularnewline
87 & 76.6 & 170.424 & 119.9342 & 220.9139 & 1e-04 & 1 & 0.9998 & 0.9945 \tabularnewline
88 & 63.3 & 159.7369 & 104.6427 & 214.8311 & 3e-04 & 0.9984 & 0.9997 & 0.9745 \tabularnewline
89 & 78.9 & 170.2287 & 110.7462 & 229.7112 & 0.0013 & 0.9998 & 0.9989 & 0.9843 \tabularnewline
90 & 82.7 & 194.7839 & 130.8686 & 258.6992 & 3e-04 & 0.9998 & 0.9971 & 0.9971 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=8061&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[78])[/C][/ROW]
[ROW][C]66[/C][C]32.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]5.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]26.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]38.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]19.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]38[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]35.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]78.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]62.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]76.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]104.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]32.2[/C][C]71.4244[/C][C]54.5021[/C][C]88.3468[/C][C]0[/C][C]1e-04[/C][C]1[/C][C]1e-04[/C][/ROW]
[ROW][C]80[/C][C]42.5[/C][C]80.5923[/C][C]61.6773[/C][C]99.5074[/C][C]0[/C][C]1[/C][C]1[/C][C]0.0059[/C][/ROW]
[ROW][C]81[/C][C]64.3[/C][C]105.6024[/C][C]83.2843[/C][C]127.9205[/C][C]1e-04[/C][C]1[/C][C]1[/C][C]0.5246[/C][/ROW]
[ROW][C]82[/C][C]74.9[/C][C]113.089[/C][C]84.7864[/C][C]141.3917[/C][C]0.0041[/C][C]0.9996[/C][C]1[/C][C]0.7147[/C][/ROW]
[ROW][C]83[/C][C]75.4[/C][C]127.7284[/C][C]95.6855[/C][C]159.7713[/C][C]7e-04[/C][C]0.9994[/C][C]1[/C][C]0.9187[/C][/ROW]
[ROW][C]84[/C][C]43[/C][C]115.8589[/C][C]79.2798[/C][C]152.438[/C][C]0[/C][C]0.9849[/C][C]1[/C][C]0.7215[/C][/ROW]
[ROW][C]85[/C][C]58.7[/C][C]129.2763[/C][C]87.7331[/C][C]170.8195[/C][C]4e-04[/C][C]1[/C][C]1[/C][C]0.8749[/C][/ROW]
[ROW][C]86[/C][C]55.4[/C][C]131.7673[/C][C]85.8889[/C][C]177.6457[/C][C]6e-04[/C][C]0.9991[/C][C]1[/C][C]0.8745[/C][/ROW]
[ROW][C]87[/C][C]76.6[/C][C]170.424[/C][C]119.9342[/C][C]220.9139[/C][C]1e-04[/C][C]1[/C][C]0.9998[/C][C]0.9945[/C][/ROW]
[ROW][C]88[/C][C]63.3[/C][C]159.7369[/C][C]104.6427[/C][C]214.8311[/C][C]3e-04[/C][C]0.9984[/C][C]0.9997[/C][C]0.9745[/C][/ROW]
[ROW][C]89[/C][C]78.9[/C][C]170.2287[/C][C]110.7462[/C][C]229.7112[/C][C]0.0013[/C][C]0.9998[/C][C]0.9989[/C][C]0.9843[/C][/ROW]
[ROW][C]90[/C][C]82.7[/C][C]194.7839[/C][C]130.8686[/C][C]258.6992[/C][C]3e-04[/C][C]0.9998[/C][C]0.9971[/C][C]0.9971[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=8061&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8061&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[78])
6632.1-------
675.3-------
683-------
6917.1-------
7026.3-------
7138.1-------
7219.5-------
7338-------
7435.5-------
7578.6-------
7662.2-------
7776.9-------
78104.9-------
7932.271.424454.502188.346801e-0411e-04
8042.580.592361.677399.50740110.0059
8164.3105.602483.2843127.92051e-04110.5246
8274.9113.08984.7864141.39170.00410.999610.7147
8375.4127.728495.6855159.77137e-040.999410.9187
8443115.858979.2798152.43800.984910.7215
8558.7129.276387.7331170.81954e-04110.8749
8655.4131.767385.8889177.64576e-040.999110.8745
8776.6170.424119.9342220.91391e-0410.99980.9945
8863.3159.7369104.6427214.83113e-040.99840.99970.9745
8978.9170.2287110.7462229.71120.00130.99980.99890.9843
9082.7194.7839130.8686258.69923e-040.99980.99710.9971







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
790.1209-0.54920.04581538.5572128.213111.3231
800.1197-0.47270.03941451.0271120.918910.9963
810.1078-0.39110.03261705.891142.157611.923
820.1277-0.33770.02811458.4029121.533611.0242
830.128-0.40970.03412738.2612228.188415.1059
840.1611-0.62890.05245308.4172442.368121.0325
850.164-0.54590.04554981.0166415.084720.3736
860.1776-0.57960.04835831.9635485.99722.0453
870.1512-0.55050.04598802.9508733.579227.0847
880.176-0.60370.05039300.0778775.006527.8389
890.1783-0.53650.04478340.9263695.077226.3643
900.1674-0.57540.04812562.80131046.900132.3558

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
79 & 0.1209 & -0.5492 & 0.0458 & 1538.5572 & 128.2131 & 11.3231 \tabularnewline
80 & 0.1197 & -0.4727 & 0.0394 & 1451.0271 & 120.9189 & 10.9963 \tabularnewline
81 & 0.1078 & -0.3911 & 0.0326 & 1705.891 & 142.1576 & 11.923 \tabularnewline
82 & 0.1277 & -0.3377 & 0.0281 & 1458.4029 & 121.5336 & 11.0242 \tabularnewline
83 & 0.128 & -0.4097 & 0.0341 & 2738.2612 & 228.1884 & 15.1059 \tabularnewline
84 & 0.1611 & -0.6289 & 0.0524 & 5308.4172 & 442.3681 & 21.0325 \tabularnewline
85 & 0.164 & -0.5459 & 0.0455 & 4981.0166 & 415.0847 & 20.3736 \tabularnewline
86 & 0.1776 & -0.5796 & 0.0483 & 5831.9635 & 485.997 & 22.0453 \tabularnewline
87 & 0.1512 & -0.5505 & 0.0459 & 8802.9508 & 733.5792 & 27.0847 \tabularnewline
88 & 0.176 & -0.6037 & 0.0503 & 9300.0778 & 775.0065 & 27.8389 \tabularnewline
89 & 0.1783 & -0.5365 & 0.0447 & 8340.9263 & 695.0772 & 26.3643 \tabularnewline
90 & 0.1674 & -0.5754 & 0.048 & 12562.8013 & 1046.9001 & 32.3558 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=8061&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]79[/C][C]0.1209[/C][C]-0.5492[/C][C]0.0458[/C][C]1538.5572[/C][C]128.2131[/C][C]11.3231[/C][/ROW]
[ROW][C]80[/C][C]0.1197[/C][C]-0.4727[/C][C]0.0394[/C][C]1451.0271[/C][C]120.9189[/C][C]10.9963[/C][/ROW]
[ROW][C]81[/C][C]0.1078[/C][C]-0.3911[/C][C]0.0326[/C][C]1705.891[/C][C]142.1576[/C][C]11.923[/C][/ROW]
[ROW][C]82[/C][C]0.1277[/C][C]-0.3377[/C][C]0.0281[/C][C]1458.4029[/C][C]121.5336[/C][C]11.0242[/C][/ROW]
[ROW][C]83[/C][C]0.128[/C][C]-0.4097[/C][C]0.0341[/C][C]2738.2612[/C][C]228.1884[/C][C]15.1059[/C][/ROW]
[ROW][C]84[/C][C]0.1611[/C][C]-0.6289[/C][C]0.0524[/C][C]5308.4172[/C][C]442.3681[/C][C]21.0325[/C][/ROW]
[ROW][C]85[/C][C]0.164[/C][C]-0.5459[/C][C]0.0455[/C][C]4981.0166[/C][C]415.0847[/C][C]20.3736[/C][/ROW]
[ROW][C]86[/C][C]0.1776[/C][C]-0.5796[/C][C]0.0483[/C][C]5831.9635[/C][C]485.997[/C][C]22.0453[/C][/ROW]
[ROW][C]87[/C][C]0.1512[/C][C]-0.5505[/C][C]0.0459[/C][C]8802.9508[/C][C]733.5792[/C][C]27.0847[/C][/ROW]
[ROW][C]88[/C][C]0.176[/C][C]-0.6037[/C][C]0.0503[/C][C]9300.0778[/C][C]775.0065[/C][C]27.8389[/C][/ROW]
[ROW][C]89[/C][C]0.1783[/C][C]-0.5365[/C][C]0.0447[/C][C]8340.9263[/C][C]695.0772[/C][C]26.3643[/C][/ROW]
[ROW][C]90[/C][C]0.1674[/C][C]-0.5754[/C][C]0.048[/C][C]12562.8013[/C][C]1046.9001[/C][C]32.3558[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=8061&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8061&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
790.1209-0.54920.04581538.5572128.213111.3231
800.1197-0.47270.03941451.0271120.918910.9963
810.1078-0.39110.03261705.891142.157611.923
820.1277-0.33770.02811458.4029121.533611.0242
830.128-0.40970.03412738.2612228.188415.1059
840.1611-0.62890.05245308.4172442.368121.0325
850.164-0.54590.04554981.0166415.084720.3736
860.1776-0.57960.04835831.9635485.99722.0453
870.1512-0.55050.04598802.9508733.579227.0847
880.176-0.60370.05039300.0778775.006527.8389
890.1783-0.53650.04478340.9263695.077226.3643
900.1674-0.57540.04812562.80131046.900132.3558



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