Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 15:25:56 -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/13/t11975838301dnf173n1m6pxro.htm/, Retrieved Sun, 05 May 2024 16:00:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3754, Retrieved Sun, 05 May 2024 16:00:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsARIMA Forecast
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper] [2007-12-13 22:25:56] [8ce1ad2ac57e06e10fb37a1292ae8cb6] [Current]
Feedback Forum

Post a new message
Dataseries X:
98.6
98
106.8
96.6
100.1
107.7
91.5
97.8
107.4
117.5
105.6
97.4
99.5
98
104.3
100.6
101.1
103.9
96.9
95.5
108.4
117
103.8
100.8
110.6
104
112.6
107.3
98.9
109.8
104.9
102.2
123.9
124.9
112.7
121.9
100.6
104.3
120.4
107.5
102.9
125.6
107.5
108.8
128.4
121.1
119.5
128.7
108.7
105.5
119.8
111.3
110.6
120.1
97.5
107.7
127.3
117.2
119.8
116.2
111
112.4
130.6
109.1
118.8
123.9
101.6
112.8
128
129.6
125.8
119.5
115.7
113.6
129.7
112
116.8
126.3
112.9
115.9




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 4 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3754&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3754&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3754&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 time4 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[68])
56107.7-------
57127.3-------
58117.2-------
59119.8-------
60116.2-------
61111-------
62112.4-------
63130.6-------
64109.1-------
65118.8-------
66123.9-------
67101.6-------
68112.8-------
69128134.5354120.3612153.24550.24680.98860.77580.9886
70129.6124.5538112.2584140.46280.26710.33560.81750.9262
71125.8122.97110.8917138.5750.36110.20250.65470.8993
72119.5123.5086109.829141.86760.33430.40340.78240.8735
73115.7109.065898.3592122.89640.17360.06960.3920.2983
74113.6113.1794101.4525128.57760.47870.37420.53950.5193
75129.7131.923115.0765155.78240.42760.93390.54330.9419
76112111.02399.176126.72590.45150.00990.59480.4122
77116.8114.5794101.7873131.79430.40020.61550.31540.5803
78126.3129.1572112.4064153.03650.40730.84480.6670.9103
79112.9107.096995.7422122.11570.22440.00610.76340.2284
80115.9113.9547100.9023131.67930.41480.54640.55080.5508

\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[68]) \tabularnewline
56 & 107.7 & - & - & - & - & - & - & - \tabularnewline
57 & 127.3 & - & - & - & - & - & - & - \tabularnewline
58 & 117.2 & - & - & - & - & - & - & - \tabularnewline
59 & 119.8 & - & - & - & - & - & - & - \tabularnewline
60 & 116.2 & - & - & - & - & - & - & - \tabularnewline
61 & 111 & - & - & - & - & - & - & - \tabularnewline
62 & 112.4 & - & - & - & - & - & - & - \tabularnewline
63 & 130.6 & - & - & - & - & - & - & - \tabularnewline
64 & 109.1 & - & - & - & - & - & - & - \tabularnewline
65 & 118.8 & - & - & - & - & - & - & - \tabularnewline
66 & 123.9 & - & - & - & - & - & - & - \tabularnewline
67 & 101.6 & - & - & - & - & - & - & - \tabularnewline
68 & 112.8 & - & - & - & - & - & - & - \tabularnewline
69 & 128 & 134.5354 & 120.3612 & 153.2455 & 0.2468 & 0.9886 & 0.7758 & 0.9886 \tabularnewline
70 & 129.6 & 124.5538 & 112.2584 & 140.4628 & 0.2671 & 0.3356 & 0.8175 & 0.9262 \tabularnewline
71 & 125.8 & 122.97 & 110.8917 & 138.575 & 0.3611 & 0.2025 & 0.6547 & 0.8993 \tabularnewline
72 & 119.5 & 123.5086 & 109.829 & 141.8676 & 0.3343 & 0.4034 & 0.7824 & 0.8735 \tabularnewline
73 & 115.7 & 109.0658 & 98.3592 & 122.8964 & 0.1736 & 0.0696 & 0.392 & 0.2983 \tabularnewline
74 & 113.6 & 113.1794 & 101.4525 & 128.5776 & 0.4787 & 0.3742 & 0.5395 & 0.5193 \tabularnewline
75 & 129.7 & 131.923 & 115.0765 & 155.7824 & 0.4276 & 0.9339 & 0.5433 & 0.9419 \tabularnewline
76 & 112 & 111.023 & 99.176 & 126.7259 & 0.4515 & 0.0099 & 0.5948 & 0.4122 \tabularnewline
77 & 116.8 & 114.5794 & 101.7873 & 131.7943 & 0.4002 & 0.6155 & 0.3154 & 0.5803 \tabularnewline
78 & 126.3 & 129.1572 & 112.4064 & 153.0365 & 0.4073 & 0.8448 & 0.667 & 0.9103 \tabularnewline
79 & 112.9 & 107.0969 & 95.7422 & 122.1157 & 0.2244 & 0.0061 & 0.7634 & 0.2284 \tabularnewline
80 & 115.9 & 113.9547 & 100.9023 & 131.6793 & 0.4148 & 0.5464 & 0.5508 & 0.5508 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3754&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[68])[/C][/ROW]
[ROW][C]56[/C][C]107.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]127.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]119.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]116.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]112.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]130.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]123.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]101.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]128[/C][C]134.5354[/C][C]120.3612[/C][C]153.2455[/C][C]0.2468[/C][C]0.9886[/C][C]0.7758[/C][C]0.9886[/C][/ROW]
[ROW][C]70[/C][C]129.6[/C][C]124.5538[/C][C]112.2584[/C][C]140.4628[/C][C]0.2671[/C][C]0.3356[/C][C]0.8175[/C][C]0.9262[/C][/ROW]
[ROW][C]71[/C][C]125.8[/C][C]122.97[/C][C]110.8917[/C][C]138.575[/C][C]0.3611[/C][C]0.2025[/C][C]0.6547[/C][C]0.8993[/C][/ROW]
[ROW][C]72[/C][C]119.5[/C][C]123.5086[/C][C]109.829[/C][C]141.8676[/C][C]0.3343[/C][C]0.4034[/C][C]0.7824[/C][C]0.8735[/C][/ROW]
[ROW][C]73[/C][C]115.7[/C][C]109.0658[/C][C]98.3592[/C][C]122.8964[/C][C]0.1736[/C][C]0.0696[/C][C]0.392[/C][C]0.2983[/C][/ROW]
[ROW][C]74[/C][C]113.6[/C][C]113.1794[/C][C]101.4525[/C][C]128.5776[/C][C]0.4787[/C][C]0.3742[/C][C]0.5395[/C][C]0.5193[/C][/ROW]
[ROW][C]75[/C][C]129.7[/C][C]131.923[/C][C]115.0765[/C][C]155.7824[/C][C]0.4276[/C][C]0.9339[/C][C]0.5433[/C][C]0.9419[/C][/ROW]
[ROW][C]76[/C][C]112[/C][C]111.023[/C][C]99.176[/C][C]126.7259[/C][C]0.4515[/C][C]0.0099[/C][C]0.5948[/C][C]0.4122[/C][/ROW]
[ROW][C]77[/C][C]116.8[/C][C]114.5794[/C][C]101.7873[/C][C]131.7943[/C][C]0.4002[/C][C]0.6155[/C][C]0.3154[/C][C]0.5803[/C][/ROW]
[ROW][C]78[/C][C]126.3[/C][C]129.1572[/C][C]112.4064[/C][C]153.0365[/C][C]0.4073[/C][C]0.8448[/C][C]0.667[/C][C]0.9103[/C][/ROW]
[ROW][C]79[/C][C]112.9[/C][C]107.0969[/C][C]95.7422[/C][C]122.1157[/C][C]0.2244[/C][C]0.0061[/C][C]0.7634[/C][C]0.2284[/C][/ROW]
[ROW][C]80[/C][C]115.9[/C][C]113.9547[/C][C]100.9023[/C][C]131.6793[/C][C]0.4148[/C][C]0.5464[/C][C]0.5508[/C][C]0.5508[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3754&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3754&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[68])
56107.7-------
57127.3-------
58117.2-------
59119.8-------
60116.2-------
61111-------
62112.4-------
63130.6-------
64109.1-------
65118.8-------
66123.9-------
67101.6-------
68112.8-------
69128134.5354120.3612153.24550.24680.98860.77580.9886
70129.6124.5538112.2584140.46280.26710.33560.81750.9262
71125.8122.97110.8917138.5750.36110.20250.65470.8993
72119.5123.5086109.829141.86760.33430.40340.78240.8735
73115.7109.065898.3592122.89640.17360.06960.3920.2983
74113.6113.1794101.4525128.57760.47870.37420.53950.5193
75129.7131.923115.0765155.78240.42760.93390.54330.9419
76112111.02399.176126.72590.45150.00990.59480.4122
77116.8114.5794101.7873131.79430.40020.61550.31540.5803
78126.3129.1572112.4064153.03650.40730.84480.6670.9103
79112.9107.096995.7422122.11570.22440.00610.76340.2284
80115.9113.9547100.9023131.67930.41480.54640.55080.5508







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.071-0.04860.00442.71133.55931.8866
700.06520.04050.003425.4642.1221.4567
710.06470.0230.00198.0090.66740.817
720.0758-0.03250.002716.06911.33911.1572
730.06470.06080.005144.01273.66771.9151
740.06940.00373e-040.17690.01470.1214
750.0923-0.01690.00144.94170.41180.6417
760.07220.00887e-040.95450.07950.282
770.07670.01940.00164.93120.41090.641
780.0943-0.02210.00188.16360.68030.8248
790.07150.05420.004533.67632.80641.6752
800.07940.01710.00143.7840.31530.5615

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.071 & -0.0486 & 0.004 & 42.7113 & 3.5593 & 1.8866 \tabularnewline
70 & 0.0652 & 0.0405 & 0.0034 & 25.464 & 2.122 & 1.4567 \tabularnewline
71 & 0.0647 & 0.023 & 0.0019 & 8.009 & 0.6674 & 0.817 \tabularnewline
72 & 0.0758 & -0.0325 & 0.0027 & 16.0691 & 1.3391 & 1.1572 \tabularnewline
73 & 0.0647 & 0.0608 & 0.0051 & 44.0127 & 3.6677 & 1.9151 \tabularnewline
74 & 0.0694 & 0.0037 & 3e-04 & 0.1769 & 0.0147 & 0.1214 \tabularnewline
75 & 0.0923 & -0.0169 & 0.0014 & 4.9417 & 0.4118 & 0.6417 \tabularnewline
76 & 0.0722 & 0.0088 & 7e-04 & 0.9545 & 0.0795 & 0.282 \tabularnewline
77 & 0.0767 & 0.0194 & 0.0016 & 4.9312 & 0.4109 & 0.641 \tabularnewline
78 & 0.0943 & -0.0221 & 0.0018 & 8.1636 & 0.6803 & 0.8248 \tabularnewline
79 & 0.0715 & 0.0542 & 0.0045 & 33.6763 & 2.8064 & 1.6752 \tabularnewline
80 & 0.0794 & 0.0171 & 0.0014 & 3.784 & 0.3153 & 0.5615 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3754&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]69[/C][C]0.071[/C][C]-0.0486[/C][C]0.004[/C][C]42.7113[/C][C]3.5593[/C][C]1.8866[/C][/ROW]
[ROW][C]70[/C][C]0.0652[/C][C]0.0405[/C][C]0.0034[/C][C]25.464[/C][C]2.122[/C][C]1.4567[/C][/ROW]
[ROW][C]71[/C][C]0.0647[/C][C]0.023[/C][C]0.0019[/C][C]8.009[/C][C]0.6674[/C][C]0.817[/C][/ROW]
[ROW][C]72[/C][C]0.0758[/C][C]-0.0325[/C][C]0.0027[/C][C]16.0691[/C][C]1.3391[/C][C]1.1572[/C][/ROW]
[ROW][C]73[/C][C]0.0647[/C][C]0.0608[/C][C]0.0051[/C][C]44.0127[/C][C]3.6677[/C][C]1.9151[/C][/ROW]
[ROW][C]74[/C][C]0.0694[/C][C]0.0037[/C][C]3e-04[/C][C]0.1769[/C][C]0.0147[/C][C]0.1214[/C][/ROW]
[ROW][C]75[/C][C]0.0923[/C][C]-0.0169[/C][C]0.0014[/C][C]4.9417[/C][C]0.4118[/C][C]0.6417[/C][/ROW]
[ROW][C]76[/C][C]0.0722[/C][C]0.0088[/C][C]7e-04[/C][C]0.9545[/C][C]0.0795[/C][C]0.282[/C][/ROW]
[ROW][C]77[/C][C]0.0767[/C][C]0.0194[/C][C]0.0016[/C][C]4.9312[/C][C]0.4109[/C][C]0.641[/C][/ROW]
[ROW][C]78[/C][C]0.0943[/C][C]-0.0221[/C][C]0.0018[/C][C]8.1636[/C][C]0.6803[/C][C]0.8248[/C][/ROW]
[ROW][C]79[/C][C]0.0715[/C][C]0.0542[/C][C]0.0045[/C][C]33.6763[/C][C]2.8064[/C][C]1.6752[/C][/ROW]
[ROW][C]80[/C][C]0.0794[/C][C]0.0171[/C][C]0.0014[/C][C]3.784[/C][C]0.3153[/C][C]0.5615[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3754&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3754&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
690.071-0.04860.00442.71133.55931.8866
700.06520.04050.003425.4642.1221.4567
710.06470.0230.00198.0090.66740.817
720.0758-0.03250.002716.06911.33911.1572
730.06470.06080.005144.01273.66771.9151
740.06940.00373e-040.17690.01470.1214
750.0923-0.01690.00144.94170.41180.6417
760.07220.00887e-040.95450.07950.282
770.07670.01940.00164.93120.41090.641
780.0943-0.02210.00188.16360.68030.8248
790.07150.05420.004533.67632.80641.6752
800.07940.01710.00143.7840.31530.5615



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