Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 05:33:35 -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/07/t1197030030tm7s3ih76ipeitf.htm/, Retrieved Mon, 29 Apr 2024 06:53:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2776, Retrieved Mon, 29 Apr 2024 06:53:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsWorkshop 9 question 1, totale consumptiegoederen
Estimated Impact176
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Workshop 9 questi...] [2007-12-07 12:33:35] [181c187d2008ac66a37ecc12859b08c5] [Current]
Feedback Forum

Post a new message
Dataseries X:
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=2776&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=2776&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2776&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[48])
36107.7-------
37127.3-------
38117.2-------
39119.8-------
40116.2-------
41111-------
42112.4-------
43130.6-------
44109.1-------
45118.8-------
46123.9-------
47101.6-------
48112.8-------
49128134.8912125.0984144.68390.083910.93571
50129.6125.1203115.2131135.02750.18770.28440.94140.9926
51125.8122.7727112.8027132.74270.27590.08980.72050.975
52119.5125.4299113.199137.66070.1710.47640.93040.9785
53115.7108.788396.3563121.22020.13790.04560.36370.2635
54113.6115.5351102.9797128.09050.38130.48970.68770.6653
55129.7133.8508120.1935147.50810.27570.99820.67960.9987
56112112.252198.3635126.14080.48580.00690.67180.4692
57116.8116.0657102.0208130.11060.45920.71480.35140.6757
58126.3132.7259118.0466147.40510.19540.98330.88070.9961
59112.9111.868996.9628126.7750.44610.02890.91150.4513
60115.9117.0575101.9854132.12950.44020.70560.71010.7101

\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 & 107.7 & - & - & - & - & - & - & - \tabularnewline
37 & 127.3 & - & - & - & - & - & - & - \tabularnewline
38 & 117.2 & - & - & - & - & - & - & - \tabularnewline
39 & 119.8 & - & - & - & - & - & - & - \tabularnewline
40 & 116.2 & - & - & - & - & - & - & - \tabularnewline
41 & 111 & - & - & - & - & - & - & - \tabularnewline
42 & 112.4 & - & - & - & - & - & - & - \tabularnewline
43 & 130.6 & - & - & - & - & - & - & - \tabularnewline
44 & 109.1 & - & - & - & - & - & - & - \tabularnewline
45 & 118.8 & - & - & - & - & - & - & - \tabularnewline
46 & 123.9 & - & - & - & - & - & - & - \tabularnewline
47 & 101.6 & - & - & - & - & - & - & - \tabularnewline
48 & 112.8 & - & - & - & - & - & - & - \tabularnewline
49 & 128 & 134.8912 & 125.0984 & 144.6839 & 0.0839 & 1 & 0.9357 & 1 \tabularnewline
50 & 129.6 & 125.1203 & 115.2131 & 135.0275 & 0.1877 & 0.2844 & 0.9414 & 0.9926 \tabularnewline
51 & 125.8 & 122.7727 & 112.8027 & 132.7427 & 0.2759 & 0.0898 & 0.7205 & 0.975 \tabularnewline
52 & 119.5 & 125.4299 & 113.199 & 137.6607 & 0.171 & 0.4764 & 0.9304 & 0.9785 \tabularnewline
53 & 115.7 & 108.7883 & 96.3563 & 121.2202 & 0.1379 & 0.0456 & 0.3637 & 0.2635 \tabularnewline
54 & 113.6 & 115.5351 & 102.9797 & 128.0905 & 0.3813 & 0.4897 & 0.6877 & 0.6653 \tabularnewline
55 & 129.7 & 133.8508 & 120.1935 & 147.5081 & 0.2757 & 0.9982 & 0.6796 & 0.9987 \tabularnewline
56 & 112 & 112.2521 & 98.3635 & 126.1408 & 0.4858 & 0.0069 & 0.6718 & 0.4692 \tabularnewline
57 & 116.8 & 116.0657 & 102.0208 & 130.1106 & 0.4592 & 0.7148 & 0.3514 & 0.6757 \tabularnewline
58 & 126.3 & 132.7259 & 118.0466 & 147.4051 & 0.1954 & 0.9833 & 0.8807 & 0.9961 \tabularnewline
59 & 112.9 & 111.8689 & 96.9628 & 126.775 & 0.4461 & 0.0289 & 0.9115 & 0.4513 \tabularnewline
60 & 115.9 & 117.0575 & 101.9854 & 132.1295 & 0.4402 & 0.7056 & 0.7101 & 0.7101 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2776&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]107.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]127.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]119.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]116.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]112.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]130.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]123.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]101.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]128[/C][C]134.8912[/C][C]125.0984[/C][C]144.6839[/C][C]0.0839[/C][C]1[/C][C]0.9357[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]129.6[/C][C]125.1203[/C][C]115.2131[/C][C]135.0275[/C][C]0.1877[/C][C]0.2844[/C][C]0.9414[/C][C]0.9926[/C][/ROW]
[ROW][C]51[/C][C]125.8[/C][C]122.7727[/C][C]112.8027[/C][C]132.7427[/C][C]0.2759[/C][C]0.0898[/C][C]0.7205[/C][C]0.975[/C][/ROW]
[ROW][C]52[/C][C]119.5[/C][C]125.4299[/C][C]113.199[/C][C]137.6607[/C][C]0.171[/C][C]0.4764[/C][C]0.9304[/C][C]0.9785[/C][/ROW]
[ROW][C]53[/C][C]115.7[/C][C]108.7883[/C][C]96.3563[/C][C]121.2202[/C][C]0.1379[/C][C]0.0456[/C][C]0.3637[/C][C]0.2635[/C][/ROW]
[ROW][C]54[/C][C]113.6[/C][C]115.5351[/C][C]102.9797[/C][C]128.0905[/C][C]0.3813[/C][C]0.4897[/C][C]0.6877[/C][C]0.6653[/C][/ROW]
[ROW][C]55[/C][C]129.7[/C][C]133.8508[/C][C]120.1935[/C][C]147.5081[/C][C]0.2757[/C][C]0.9982[/C][C]0.6796[/C][C]0.9987[/C][/ROW]
[ROW][C]56[/C][C]112[/C][C]112.2521[/C][C]98.3635[/C][C]126.1408[/C][C]0.4858[/C][C]0.0069[/C][C]0.6718[/C][C]0.4692[/C][/ROW]
[ROW][C]57[/C][C]116.8[/C][C]116.0657[/C][C]102.0208[/C][C]130.1106[/C][C]0.4592[/C][C]0.7148[/C][C]0.3514[/C][C]0.6757[/C][/ROW]
[ROW][C]58[/C][C]126.3[/C][C]132.7259[/C][C]118.0466[/C][C]147.4051[/C][C]0.1954[/C][C]0.9833[/C][C]0.8807[/C][C]0.9961[/C][/ROW]
[ROW][C]59[/C][C]112.9[/C][C]111.8689[/C][C]96.9628[/C][C]126.775[/C][C]0.4461[/C][C]0.0289[/C][C]0.9115[/C][C]0.4513[/C][/ROW]
[ROW][C]60[/C][C]115.9[/C][C]117.0575[/C][C]101.9854[/C][C]132.1295[/C][C]0.4402[/C][C]0.7056[/C][C]0.7101[/C][C]0.7101[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2776&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2776&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])
36107.7-------
37127.3-------
38117.2-------
39119.8-------
40116.2-------
41111-------
42112.4-------
43130.6-------
44109.1-------
45118.8-------
46123.9-------
47101.6-------
48112.8-------
49128134.8912125.0984144.68390.083910.93571
50129.6125.1203115.2131135.02750.18770.28440.94140.9926
51125.8122.7727112.8027132.74270.27590.08980.72050.975
52119.5125.4299113.199137.66070.1710.47640.93040.9785
53115.7108.788396.3563121.22020.13790.04560.36370.2635
54113.6115.5351102.9797128.09050.38130.48970.68770.6653
55129.7133.8508120.1935147.50810.27570.99820.67960.9987
56112112.252198.3635126.14080.48580.00690.67180.4692
57116.8116.0657102.0208130.11060.45920.71480.35140.6757
58126.3132.7259118.0466147.40510.19540.98330.88070.9961
59112.9111.868996.9628126.7750.44610.02890.91150.4513
60115.9117.0575101.9854132.12950.44020.70560.71010.7101







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.037-0.05110.004347.4883.95731.9893
500.04040.03580.00320.06751.67231.2932
510.04140.02470.00219.16470.76370.8739
520.0498-0.04730.003935.16342.93031.7118
530.05830.06350.005347.77193.9811.9952
540.0554-0.01670.00143.74470.31210.5586
550.0521-0.0310.002617.22921.43581.1982
560.0631-0.00222e-040.06360.00530.0728
570.06170.00635e-040.53920.04490.212
580.0564-0.04840.00441.29173.4411.855
590.0680.00928e-041.06320.08860.2977
600.0657-0.00998e-041.33970.11160.3341

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.037 & -0.0511 & 0.0043 & 47.488 & 3.9573 & 1.9893 \tabularnewline
50 & 0.0404 & 0.0358 & 0.003 & 20.0675 & 1.6723 & 1.2932 \tabularnewline
51 & 0.0414 & 0.0247 & 0.0021 & 9.1647 & 0.7637 & 0.8739 \tabularnewline
52 & 0.0498 & -0.0473 & 0.0039 & 35.1634 & 2.9303 & 1.7118 \tabularnewline
53 & 0.0583 & 0.0635 & 0.0053 & 47.7719 & 3.981 & 1.9952 \tabularnewline
54 & 0.0554 & -0.0167 & 0.0014 & 3.7447 & 0.3121 & 0.5586 \tabularnewline
55 & 0.0521 & -0.031 & 0.0026 & 17.2292 & 1.4358 & 1.1982 \tabularnewline
56 & 0.0631 & -0.0022 & 2e-04 & 0.0636 & 0.0053 & 0.0728 \tabularnewline
57 & 0.0617 & 0.0063 & 5e-04 & 0.5392 & 0.0449 & 0.212 \tabularnewline
58 & 0.0564 & -0.0484 & 0.004 & 41.2917 & 3.441 & 1.855 \tabularnewline
59 & 0.068 & 0.0092 & 8e-04 & 1.0632 & 0.0886 & 0.2977 \tabularnewline
60 & 0.0657 & -0.0099 & 8e-04 & 1.3397 & 0.1116 & 0.3341 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2776&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.037[/C][C]-0.0511[/C][C]0.0043[/C][C]47.488[/C][C]3.9573[/C][C]1.9893[/C][/ROW]
[ROW][C]50[/C][C]0.0404[/C][C]0.0358[/C][C]0.003[/C][C]20.0675[/C][C]1.6723[/C][C]1.2932[/C][/ROW]
[ROW][C]51[/C][C]0.0414[/C][C]0.0247[/C][C]0.0021[/C][C]9.1647[/C][C]0.7637[/C][C]0.8739[/C][/ROW]
[ROW][C]52[/C][C]0.0498[/C][C]-0.0473[/C][C]0.0039[/C][C]35.1634[/C][C]2.9303[/C][C]1.7118[/C][/ROW]
[ROW][C]53[/C][C]0.0583[/C][C]0.0635[/C][C]0.0053[/C][C]47.7719[/C][C]3.981[/C][C]1.9952[/C][/ROW]
[ROW][C]54[/C][C]0.0554[/C][C]-0.0167[/C][C]0.0014[/C][C]3.7447[/C][C]0.3121[/C][C]0.5586[/C][/ROW]
[ROW][C]55[/C][C]0.0521[/C][C]-0.031[/C][C]0.0026[/C][C]17.2292[/C][C]1.4358[/C][C]1.1982[/C][/ROW]
[ROW][C]56[/C][C]0.0631[/C][C]-0.0022[/C][C]2e-04[/C][C]0.0636[/C][C]0.0053[/C][C]0.0728[/C][/ROW]
[ROW][C]57[/C][C]0.0617[/C][C]0.0063[/C][C]5e-04[/C][C]0.5392[/C][C]0.0449[/C][C]0.212[/C][/ROW]
[ROW][C]58[/C][C]0.0564[/C][C]-0.0484[/C][C]0.004[/C][C]41.2917[/C][C]3.441[/C][C]1.855[/C][/ROW]
[ROW][C]59[/C][C]0.068[/C][C]0.0092[/C][C]8e-04[/C][C]1.0632[/C][C]0.0886[/C][C]0.2977[/C][/ROW]
[ROW][C]60[/C][C]0.0657[/C][C]-0.0099[/C][C]8e-04[/C][C]1.3397[/C][C]0.1116[/C][C]0.3341[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2776&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2776&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.037-0.05110.004347.4883.95731.9893
500.04040.03580.00320.06751.67231.2932
510.04140.02470.00219.16470.76370.8739
520.0498-0.04730.003935.16342.93031.7118
530.05830.06350.005347.77193.9811.9952
540.0554-0.01670.00143.74470.31210.5586
550.0521-0.0310.002617.22921.43581.1982
560.0631-0.00222e-040.06360.00530.0728
570.06170.00635e-040.53920.04490.212
580.0564-0.04840.00441.29173.4411.855
590.0680.00928e-041.06320.08860.2977
600.0657-0.00998e-041.33970.11160.3341



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