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 04:37:26 -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/t11975450112txmietnpiil0tw.htm/, Retrieved Sun, 05 May 2024 13:49:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3449, Retrieved Sun, 05 May 2024 13:49:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact207
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [industriële produ...] [2007-12-13 11:37:26] [9474861d1948ba663981b67eaedfade5] [Current]
Feedback Forum

Post a new message
Dataseries X:
106.5
112.3
102.8
96.5
101.0
98.9
105.1
103.0
99.0
104.3
94.6
90.4
108.9
111.4
100.8
102.5
98.2
98.7
113.3
104.6
99.3
111.8
97.3
97.7
115.6
111.9
107.0
107.1
100.6
99.2
108.4
103.0
99.8
115.0
90.8
95.9
114.4
108.2
112.6
109.1
105.0
105.0
118.5
103.7
112.5
116.6
96.6
101.9
116.5
119.3
115.4
108.5
111.5
108.8
121.8
109.6
112.2
119.6
103.4
105.3
113.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3449&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 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[49])
37114.4-------
38108.2-------
39112.6-------
40109.1-------
41105-------
42105-------
43118.5-------
44103.7-------
45112.5-------
46116.6-------
4796.6-------
48101.9-------
49116.5-------
50119.3113.4312106.4927120.36960.04870.1930.93030.193
51115.4113.7245106.7868120.66220.3180.05760.62460.2165
52108.5109.8731102.65117.09610.35470.06680.58310.0361
53111.5106.289498.1552114.42370.10460.29710.6220.0069
54108.8105.648297.4944113.80190.22430.07980.56190.0045
55121.8117.1452108.706125.58430.13980.97370.37650.5596
56109.6106.202297.4854114.9190.22242e-040.71320.0103
57112.2109.6808100.9142118.44740.28660.50720.26420.0637
58119.6117.0553108.1037126.00690.28870.85610.53970.5484
59103.497.238188.1704106.30570.091400.55480
60105.3101.242892.1173110.36840.19180.32160.44395e-04
61113.5117.0988107.8672126.33040.22240.99390.55060.5506

\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[49]) \tabularnewline
37 & 114.4 & - & - & - & - & - & - & - \tabularnewline
38 & 108.2 & - & - & - & - & - & - & - \tabularnewline
39 & 112.6 & - & - & - & - & - & - & - \tabularnewline
40 & 109.1 & - & - & - & - & - & - & - \tabularnewline
41 & 105 & - & - & - & - & - & - & - \tabularnewline
42 & 105 & - & - & - & - & - & - & - \tabularnewline
43 & 118.5 & - & - & - & - & - & - & - \tabularnewline
44 & 103.7 & - & - & - & - & - & - & - \tabularnewline
45 & 112.5 & - & - & - & - & - & - & - \tabularnewline
46 & 116.6 & - & - & - & - & - & - & - \tabularnewline
47 & 96.6 & - & - & - & - & - & - & - \tabularnewline
48 & 101.9 & - & - & - & - & - & - & - \tabularnewline
49 & 116.5 & - & - & - & - & - & - & - \tabularnewline
50 & 119.3 & 113.4312 & 106.4927 & 120.3696 & 0.0487 & 0.193 & 0.9303 & 0.193 \tabularnewline
51 & 115.4 & 113.7245 & 106.7868 & 120.6622 & 0.318 & 0.0576 & 0.6246 & 0.2165 \tabularnewline
52 & 108.5 & 109.8731 & 102.65 & 117.0961 & 0.3547 & 0.0668 & 0.5831 & 0.0361 \tabularnewline
53 & 111.5 & 106.2894 & 98.1552 & 114.4237 & 0.1046 & 0.2971 & 0.622 & 0.0069 \tabularnewline
54 & 108.8 & 105.6482 & 97.4944 & 113.8019 & 0.2243 & 0.0798 & 0.5619 & 0.0045 \tabularnewline
55 & 121.8 & 117.1452 & 108.706 & 125.5843 & 0.1398 & 0.9737 & 0.3765 & 0.5596 \tabularnewline
56 & 109.6 & 106.2022 & 97.4854 & 114.919 & 0.2224 & 2e-04 & 0.7132 & 0.0103 \tabularnewline
57 & 112.2 & 109.6808 & 100.9142 & 118.4474 & 0.2866 & 0.5072 & 0.2642 & 0.0637 \tabularnewline
58 & 119.6 & 117.0553 & 108.1037 & 126.0069 & 0.2887 & 0.8561 & 0.5397 & 0.5484 \tabularnewline
59 & 103.4 & 97.2381 & 88.1704 & 106.3057 & 0.0914 & 0 & 0.5548 & 0 \tabularnewline
60 & 105.3 & 101.2428 & 92.1173 & 110.3684 & 0.1918 & 0.3216 & 0.4439 & 5e-04 \tabularnewline
61 & 113.5 & 117.0988 & 107.8672 & 126.3304 & 0.2224 & 0.9939 & 0.5506 & 0.5506 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3449&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[49])[/C][/ROW]
[ROW][C]37[/C][C]114.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]108.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]112.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]105[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]118.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]103.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]116.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]96.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]116.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]119.3[/C][C]113.4312[/C][C]106.4927[/C][C]120.3696[/C][C]0.0487[/C][C]0.193[/C][C]0.9303[/C][C]0.193[/C][/ROW]
[ROW][C]51[/C][C]115.4[/C][C]113.7245[/C][C]106.7868[/C][C]120.6622[/C][C]0.318[/C][C]0.0576[/C][C]0.6246[/C][C]0.2165[/C][/ROW]
[ROW][C]52[/C][C]108.5[/C][C]109.8731[/C][C]102.65[/C][C]117.0961[/C][C]0.3547[/C][C]0.0668[/C][C]0.5831[/C][C]0.0361[/C][/ROW]
[ROW][C]53[/C][C]111.5[/C][C]106.2894[/C][C]98.1552[/C][C]114.4237[/C][C]0.1046[/C][C]0.2971[/C][C]0.622[/C][C]0.0069[/C][/ROW]
[ROW][C]54[/C][C]108.8[/C][C]105.6482[/C][C]97.4944[/C][C]113.8019[/C][C]0.2243[/C][C]0.0798[/C][C]0.5619[/C][C]0.0045[/C][/ROW]
[ROW][C]55[/C][C]121.8[/C][C]117.1452[/C][C]108.706[/C][C]125.5843[/C][C]0.1398[/C][C]0.9737[/C][C]0.3765[/C][C]0.5596[/C][/ROW]
[ROW][C]56[/C][C]109.6[/C][C]106.2022[/C][C]97.4854[/C][C]114.919[/C][C]0.2224[/C][C]2e-04[/C][C]0.7132[/C][C]0.0103[/C][/ROW]
[ROW][C]57[/C][C]112.2[/C][C]109.6808[/C][C]100.9142[/C][C]118.4474[/C][C]0.2866[/C][C]0.5072[/C][C]0.2642[/C][C]0.0637[/C][/ROW]
[ROW][C]58[/C][C]119.6[/C][C]117.0553[/C][C]108.1037[/C][C]126.0069[/C][C]0.2887[/C][C]0.8561[/C][C]0.5397[/C][C]0.5484[/C][/ROW]
[ROW][C]59[/C][C]103.4[/C][C]97.2381[/C][C]88.1704[/C][C]106.3057[/C][C]0.0914[/C][C]0[/C][C]0.5548[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]105.3[/C][C]101.2428[/C][C]92.1173[/C][C]110.3684[/C][C]0.1918[/C][C]0.3216[/C][C]0.4439[/C][C]5e-04[/C][/ROW]
[ROW][C]61[/C][C]113.5[/C][C]117.0988[/C][C]107.8672[/C][C]126.3304[/C][C]0.2224[/C][C]0.9939[/C][C]0.5506[/C][C]0.5506[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3449&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3449&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[49])
37114.4-------
38108.2-------
39112.6-------
40109.1-------
41105-------
42105-------
43118.5-------
44103.7-------
45112.5-------
46116.6-------
4796.6-------
48101.9-------
49116.5-------
50119.3113.4312106.4927120.36960.04870.1930.93030.193
51115.4113.7245106.7868120.66220.3180.05760.62460.2165
52108.5109.8731102.65117.09610.35470.06680.58310.0361
53111.5106.289498.1552114.42370.10460.29710.6220.0069
54108.8105.648297.4944113.80190.22430.07980.56190.0045
55121.8117.1452108.706125.58430.13980.97370.37650.5596
56109.6106.202297.4854114.9190.22242e-040.71320.0103
57112.2109.6808100.9142118.44740.28660.50720.26420.0637
58119.6117.0553108.1037126.00690.28870.85610.53970.5484
59103.497.238188.1704106.30570.091400.55480
60105.3101.242892.1173110.36840.19180.32160.44395e-04
61113.5117.0988107.8672126.33040.22240.99390.55060.5506







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.03120.05170.004334.4432.87031.6942
510.03110.01470.00122.80730.23390.4837
520.0335-0.01250.0011.88530.15710.3964
530.0390.0490.004127.15022.26251.5042
540.03940.02980.00259.93410.82780.9099
550.03680.03970.003321.66741.80561.3437
560.04190.0320.002711.54490.96210.9809
570.04080.0230.00196.34640.52890.7272
580.0390.02170.00186.47550.53960.7346
590.04760.06340.005337.96933.16411.7788
600.0460.04010.003316.46061.37171.1712
610.0402-0.03070.002612.95151.07931.0389

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0312 & 0.0517 & 0.0043 & 34.443 & 2.8703 & 1.6942 \tabularnewline
51 & 0.0311 & 0.0147 & 0.0012 & 2.8073 & 0.2339 & 0.4837 \tabularnewline
52 & 0.0335 & -0.0125 & 0.001 & 1.8853 & 0.1571 & 0.3964 \tabularnewline
53 & 0.039 & 0.049 & 0.0041 & 27.1502 & 2.2625 & 1.5042 \tabularnewline
54 & 0.0394 & 0.0298 & 0.0025 & 9.9341 & 0.8278 & 0.9099 \tabularnewline
55 & 0.0368 & 0.0397 & 0.0033 & 21.6674 & 1.8056 & 1.3437 \tabularnewline
56 & 0.0419 & 0.032 & 0.0027 & 11.5449 & 0.9621 & 0.9809 \tabularnewline
57 & 0.0408 & 0.023 & 0.0019 & 6.3464 & 0.5289 & 0.7272 \tabularnewline
58 & 0.039 & 0.0217 & 0.0018 & 6.4755 & 0.5396 & 0.7346 \tabularnewline
59 & 0.0476 & 0.0634 & 0.0053 & 37.9693 & 3.1641 & 1.7788 \tabularnewline
60 & 0.046 & 0.0401 & 0.0033 & 16.4606 & 1.3717 & 1.1712 \tabularnewline
61 & 0.0402 & -0.0307 & 0.0026 & 12.9515 & 1.0793 & 1.0389 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3449&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]50[/C][C]0.0312[/C][C]0.0517[/C][C]0.0043[/C][C]34.443[/C][C]2.8703[/C][C]1.6942[/C][/ROW]
[ROW][C]51[/C][C]0.0311[/C][C]0.0147[/C][C]0.0012[/C][C]2.8073[/C][C]0.2339[/C][C]0.4837[/C][/ROW]
[ROW][C]52[/C][C]0.0335[/C][C]-0.0125[/C][C]0.001[/C][C]1.8853[/C][C]0.1571[/C][C]0.3964[/C][/ROW]
[ROW][C]53[/C][C]0.039[/C][C]0.049[/C][C]0.0041[/C][C]27.1502[/C][C]2.2625[/C][C]1.5042[/C][/ROW]
[ROW][C]54[/C][C]0.0394[/C][C]0.0298[/C][C]0.0025[/C][C]9.9341[/C][C]0.8278[/C][C]0.9099[/C][/ROW]
[ROW][C]55[/C][C]0.0368[/C][C]0.0397[/C][C]0.0033[/C][C]21.6674[/C][C]1.8056[/C][C]1.3437[/C][/ROW]
[ROW][C]56[/C][C]0.0419[/C][C]0.032[/C][C]0.0027[/C][C]11.5449[/C][C]0.9621[/C][C]0.9809[/C][/ROW]
[ROW][C]57[/C][C]0.0408[/C][C]0.023[/C][C]0.0019[/C][C]6.3464[/C][C]0.5289[/C][C]0.7272[/C][/ROW]
[ROW][C]58[/C][C]0.039[/C][C]0.0217[/C][C]0.0018[/C][C]6.4755[/C][C]0.5396[/C][C]0.7346[/C][/ROW]
[ROW][C]59[/C][C]0.0476[/C][C]0.0634[/C][C]0.0053[/C][C]37.9693[/C][C]3.1641[/C][C]1.7788[/C][/ROW]
[ROW][C]60[/C][C]0.046[/C][C]0.0401[/C][C]0.0033[/C][C]16.4606[/C][C]1.3717[/C][C]1.1712[/C][/ROW]
[ROW][C]61[/C][C]0.0402[/C][C]-0.0307[/C][C]0.0026[/C][C]12.9515[/C][C]1.0793[/C][C]1.0389[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3449&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3449&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
500.03120.05170.004334.4432.87031.6942
510.03110.01470.00122.80730.23390.4837
520.0335-0.01250.0011.88530.15710.3964
530.0390.0490.004127.15022.26251.5042
540.03940.02980.00259.93410.82780.9099
550.03680.03970.003321.66741.80561.3437
560.04190.0320.002711.54490.96210.9809
570.04080.0230.00196.34640.52890.7272
580.0390.02170.00186.47550.53960.7346
590.04760.06340.005337.96933.16411.7788
600.0460.04010.003316.46061.37171.1712
610.0402-0.03070.002612.95151.07931.0389



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