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 computationSun, 20 Dec 2009 05:55:02 -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/20/t1261313754mvuosrxtd7rq1y3.htm/, Retrieved Sat, 27 Apr 2024 08:38:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69866, Retrieved Sat, 27 Apr 2024 08:38:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact131
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] [ARIMA-Forecasting] [2009-12-09 16:48:03] [ee7c2e7343f5b1451e62c5c16ec521f1]
-   PD      [ARIMA Forecasting] [Forecast] [2009-12-20 12:55:02] [e1f26cfd746b288ac2a466939c6f316e] [Current]
Feedback Forum

Post a new message
Dataseries X:
105.7
105.7
111.1
82.4
60
107.3
99.3
113.5
108.9
100.2
103.9
138.7
120.2
100.2
143.2
70.9
85.2
133
136.6
117.9
106.3
122.3
125.5
148.4
126.3
99.6
140.4
80.3
92.6
138.5
110.9
119.6
105
109
129.4
148.6
101.4
134.8
143.7
81.6
90.3
141.5
140.7
140.2
100.2
125.7
119.6
134.7
109
116.3
146.9
97.4
89.4
132.1
139.8
129
112.5
121.9
121.7
123.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69866&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 time2 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[48])
36148.6-------
37101.4-------
38134.8-------
39143.7-------
4081.6-------
4190.3-------
42141.5-------
43140.7-------
44140.2-------
45100.2-------
46125.7-------
47119.6-------
48134.7-------
49109122.351296.7937147.90870.15290.17180.94590.1718
50116.3119.409893.6537145.1660.40650.78590.12080.1223
51146.9143.7155117.7643169.66670.4050.98080.50050.752
5297.487.547361.4046113.690.2300.67222e-04
5389.490.918764.5879117.24950.4550.31470.51846e-04
54132.1138.8963112.3808165.41180.30770.99990.42370.6218
55139.8130.5717103.8748157.26860.2490.45530.22860.3809
56129131.3607104.4856158.23580.43170.26910.25960.4038
57112.5113.099586.0494140.14970.48270.12460.8250.0588
58121.9122.514195.2921149.73610.48240.76460.40930.1901
59121.7127.6006100.2097154.99150.33640.65830.71650.3057
60123.1150.2627122.7059177.81950.02670.97890.86580.8658

\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[48]) \tabularnewline
36 & 148.6 & - & - & - & - & - & - & - \tabularnewline
37 & 101.4 & - & - & - & - & - & - & - \tabularnewline
38 & 134.8 & - & - & - & - & - & - & - \tabularnewline
39 & 143.7 & - & - & - & - & - & - & - \tabularnewline
40 & 81.6 & - & - & - & - & - & - & - \tabularnewline
41 & 90.3 & - & - & - & - & - & - & - \tabularnewline
42 & 141.5 & - & - & - & - & - & - & - \tabularnewline
43 & 140.7 & - & - & - & - & - & - & - \tabularnewline
44 & 140.2 & - & - & - & - & - & - & - \tabularnewline
45 & 100.2 & - & - & - & - & - & - & - \tabularnewline
46 & 125.7 & - & - & - & - & - & - & - \tabularnewline
47 & 119.6 & - & - & - & - & - & - & - \tabularnewline
48 & 134.7 & - & - & - & - & - & - & - \tabularnewline
49 & 109 & 122.3512 & 96.7937 & 147.9087 & 0.1529 & 0.1718 & 0.9459 & 0.1718 \tabularnewline
50 & 116.3 & 119.4098 & 93.6537 & 145.166 & 0.4065 & 0.7859 & 0.1208 & 0.1223 \tabularnewline
51 & 146.9 & 143.7155 & 117.7643 & 169.6667 & 0.405 & 0.9808 & 0.5005 & 0.752 \tabularnewline
52 & 97.4 & 87.5473 & 61.4046 & 113.69 & 0.23 & 0 & 0.6722 & 2e-04 \tabularnewline
53 & 89.4 & 90.9187 & 64.5879 & 117.2495 & 0.455 & 0.3147 & 0.5184 & 6e-04 \tabularnewline
54 & 132.1 & 138.8963 & 112.3808 & 165.4118 & 0.3077 & 0.9999 & 0.4237 & 0.6218 \tabularnewline
55 & 139.8 & 130.5717 & 103.8748 & 157.2686 & 0.249 & 0.4553 & 0.2286 & 0.3809 \tabularnewline
56 & 129 & 131.3607 & 104.4856 & 158.2358 & 0.4317 & 0.2691 & 0.2596 & 0.4038 \tabularnewline
57 & 112.5 & 113.0995 & 86.0494 & 140.1497 & 0.4827 & 0.1246 & 0.825 & 0.0588 \tabularnewline
58 & 121.9 & 122.5141 & 95.2921 & 149.7361 & 0.4824 & 0.7646 & 0.4093 & 0.1901 \tabularnewline
59 & 121.7 & 127.6006 & 100.2097 & 154.9915 & 0.3364 & 0.6583 & 0.7165 & 0.3057 \tabularnewline
60 & 123.1 & 150.2627 & 122.7059 & 177.8195 & 0.0267 & 0.9789 & 0.8658 & 0.8658 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69866&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[48])[/C][/ROW]
[ROW][C]36[/C][C]148.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]101.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]134.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]143.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]81.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]90.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]141.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]140.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]140.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]100.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]125.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]119.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]134.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]109[/C][C]122.3512[/C][C]96.7937[/C][C]147.9087[/C][C]0.1529[/C][C]0.1718[/C][C]0.9459[/C][C]0.1718[/C][/ROW]
[ROW][C]50[/C][C]116.3[/C][C]119.4098[/C][C]93.6537[/C][C]145.166[/C][C]0.4065[/C][C]0.7859[/C][C]0.1208[/C][C]0.1223[/C][/ROW]
[ROW][C]51[/C][C]146.9[/C][C]143.7155[/C][C]117.7643[/C][C]169.6667[/C][C]0.405[/C][C]0.9808[/C][C]0.5005[/C][C]0.752[/C][/ROW]
[ROW][C]52[/C][C]97.4[/C][C]87.5473[/C][C]61.4046[/C][C]113.69[/C][C]0.23[/C][C]0[/C][C]0.6722[/C][C]2e-04[/C][/ROW]
[ROW][C]53[/C][C]89.4[/C][C]90.9187[/C][C]64.5879[/C][C]117.2495[/C][C]0.455[/C][C]0.3147[/C][C]0.5184[/C][C]6e-04[/C][/ROW]
[ROW][C]54[/C][C]132.1[/C][C]138.8963[/C][C]112.3808[/C][C]165.4118[/C][C]0.3077[/C][C]0.9999[/C][C]0.4237[/C][C]0.6218[/C][/ROW]
[ROW][C]55[/C][C]139.8[/C][C]130.5717[/C][C]103.8748[/C][C]157.2686[/C][C]0.249[/C][C]0.4553[/C][C]0.2286[/C][C]0.3809[/C][/ROW]
[ROW][C]56[/C][C]129[/C][C]131.3607[/C][C]104.4856[/C][C]158.2358[/C][C]0.4317[/C][C]0.2691[/C][C]0.2596[/C][C]0.4038[/C][/ROW]
[ROW][C]57[/C][C]112.5[/C][C]113.0995[/C][C]86.0494[/C][C]140.1497[/C][C]0.4827[/C][C]0.1246[/C][C]0.825[/C][C]0.0588[/C][/ROW]
[ROW][C]58[/C][C]121.9[/C][C]122.5141[/C][C]95.2921[/C][C]149.7361[/C][C]0.4824[/C][C]0.7646[/C][C]0.4093[/C][C]0.1901[/C][/ROW]
[ROW][C]59[/C][C]121.7[/C][C]127.6006[/C][C]100.2097[/C][C]154.9915[/C][C]0.3364[/C][C]0.6583[/C][C]0.7165[/C][C]0.3057[/C][/ROW]
[ROW][C]60[/C][C]123.1[/C][C]150.2627[/C][C]122.7059[/C][C]177.8195[/C][C]0.0267[/C][C]0.9789[/C][C]0.8658[/C][C]0.8658[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69866&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69866&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[48])
36148.6-------
37101.4-------
38134.8-------
39143.7-------
4081.6-------
4190.3-------
42141.5-------
43140.7-------
44140.2-------
45100.2-------
46125.7-------
47119.6-------
48134.7-------
49109122.351296.7937147.90870.15290.17180.94590.1718
50116.3119.409893.6537145.1660.40650.78590.12080.1223
51146.9143.7155117.7643169.66670.4050.98080.50050.752
5297.487.547361.4046113.690.2300.67222e-04
5389.490.918764.5879117.24950.4550.31470.51846e-04
54132.1138.8963112.3808165.41180.30770.99990.42370.6218
55139.8130.5717103.8748157.26860.2490.45530.22860.3809
56129131.3607104.4856158.23580.43170.26910.25960.4038
57112.5113.099586.0494140.14970.48270.12460.8250.0588
58121.9122.514195.2921149.73610.48240.76460.40930.1901
59121.7127.6006100.2097154.99150.33640.65830.71650.3057
60123.1150.2627122.7059177.81950.02670.97890.86580.8658







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1066-0.10910178.254400
500.11-0.0260.06769.67193.96279.6934
510.09210.02220.052410.141166.02228.1254
520.15240.11250.067597.075373.78558.5898
530.1478-0.01670.05732.306559.48977.713
540.0974-0.04890.055946.189657.2737.5679
550.10430.07070.05885.160861.2577.8267
560.1044-0.0180.0535.572954.29657.3686
570.122-0.00530.04770.359548.30356.9501
580.1134-0.0050.04340.377143.51086.5963
590.1095-0.04620.043734.817142.72056.5361
600.0936-0.18080.0551737.8116100.644710.0322

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1066 & -0.1091 & 0 & 178.2544 & 0 & 0 \tabularnewline
50 & 0.11 & -0.026 & 0.0676 & 9.671 & 93.9627 & 9.6934 \tabularnewline
51 & 0.0921 & 0.0222 & 0.0524 & 10.1411 & 66.0222 & 8.1254 \tabularnewline
52 & 0.1524 & 0.1125 & 0.0675 & 97.0753 & 73.7855 & 8.5898 \tabularnewline
53 & 0.1478 & -0.0167 & 0.0573 & 2.3065 & 59.4897 & 7.713 \tabularnewline
54 & 0.0974 & -0.0489 & 0.0559 & 46.1896 & 57.273 & 7.5679 \tabularnewline
55 & 0.1043 & 0.0707 & 0.058 & 85.1608 & 61.257 & 7.8267 \tabularnewline
56 & 0.1044 & -0.018 & 0.053 & 5.5729 & 54.2965 & 7.3686 \tabularnewline
57 & 0.122 & -0.0053 & 0.0477 & 0.3595 & 48.3035 & 6.9501 \tabularnewline
58 & 0.1134 & -0.005 & 0.0434 & 0.3771 & 43.5108 & 6.5963 \tabularnewline
59 & 0.1095 & -0.0462 & 0.0437 & 34.8171 & 42.7205 & 6.5361 \tabularnewline
60 & 0.0936 & -0.1808 & 0.0551 & 737.8116 & 100.6447 & 10.0322 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69866&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]49[/C][C]0.1066[/C][C]-0.1091[/C][C]0[/C][C]178.2544[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.11[/C][C]-0.026[/C][C]0.0676[/C][C]9.671[/C][C]93.9627[/C][C]9.6934[/C][/ROW]
[ROW][C]51[/C][C]0.0921[/C][C]0.0222[/C][C]0.0524[/C][C]10.1411[/C][C]66.0222[/C][C]8.1254[/C][/ROW]
[ROW][C]52[/C][C]0.1524[/C][C]0.1125[/C][C]0.0675[/C][C]97.0753[/C][C]73.7855[/C][C]8.5898[/C][/ROW]
[ROW][C]53[/C][C]0.1478[/C][C]-0.0167[/C][C]0.0573[/C][C]2.3065[/C][C]59.4897[/C][C]7.713[/C][/ROW]
[ROW][C]54[/C][C]0.0974[/C][C]-0.0489[/C][C]0.0559[/C][C]46.1896[/C][C]57.273[/C][C]7.5679[/C][/ROW]
[ROW][C]55[/C][C]0.1043[/C][C]0.0707[/C][C]0.058[/C][C]85.1608[/C][C]61.257[/C][C]7.8267[/C][/ROW]
[ROW][C]56[/C][C]0.1044[/C][C]-0.018[/C][C]0.053[/C][C]5.5729[/C][C]54.2965[/C][C]7.3686[/C][/ROW]
[ROW][C]57[/C][C]0.122[/C][C]-0.0053[/C][C]0.0477[/C][C]0.3595[/C][C]48.3035[/C][C]6.9501[/C][/ROW]
[ROW][C]58[/C][C]0.1134[/C][C]-0.005[/C][C]0.0434[/C][C]0.3771[/C][C]43.5108[/C][C]6.5963[/C][/ROW]
[ROW][C]59[/C][C]0.1095[/C][C]-0.0462[/C][C]0.0437[/C][C]34.8171[/C][C]42.7205[/C][C]6.5361[/C][/ROW]
[ROW][C]60[/C][C]0.0936[/C][C]-0.1808[/C][C]0.0551[/C][C]737.8116[/C][C]100.6447[/C][C]10.0322[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69866&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69866&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
490.1066-0.10910178.254400
500.11-0.0260.06769.67193.96279.6934
510.09210.02220.052410.141166.02228.1254
520.15240.11250.067597.075373.78558.5898
530.1478-0.01670.05732.306559.48977.713
540.0974-0.04890.055946.189657.2737.5679
550.10430.07070.05885.160861.2577.8267
560.1044-0.0180.0535.572954.29657.3686
570.122-0.00530.04770.359548.30356.9501
580.1134-0.0050.04340.377143.51086.5963
590.1095-0.04620.043734.817142.72056.5361
600.0936-0.18080.0551737.8116100.644710.0322



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