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 computationSat, 12 Dec 2009 02:23:15 -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/12/t1260609839d14zsr7b4o0nje3.htm/, Retrieved Mon, 29 Apr 2024 08:02:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66852, Retrieved Mon, 29 Apr 2024 08:02:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact146
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [WS 10] [2009-12-12 09:23:15] [762da55b2e2304daaed24a7cc507d14d] [Current]
Feedback Forum

Post a new message
Dataseries X:
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
127
112.1
114.2
121.1
131.6
125
120.4
117.7
117.5
120.6
127.5
112.3
124.5
115.2
104.7
130.9
129.2
113.5
125.6
107.6
107
121.6
110.7
106.3
118.6
104.6




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=66852&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=66852&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66852&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])
36112.1-------
37114.2-------
38121.1-------
39131.6-------
40125-------
41120.4-------
42117.7-------
43117.5-------
44120.6-------
45127.5-------
46112.3-------
47124.5-------
48115.2-------
49104.7111.5423101.5403121.54420.090.23680.30120.2368
50130.9121.8307111.8283131.83310.03780.99960.55690.9031
51129.2127.5787117.4674137.690.37670.25980.21780.9918
52113.5122.422111.8993132.94480.04830.10340.31550.9107
53125.6119.3058108.7794129.83210.12060.86020.41930.7777
54107.6115.9676105.4061126.52910.06020.03690.37390.5566
55107116.8097106.2107127.40860.03480.95570.44920.617
56121.6121.7234111.1223132.32450.49090.99680.58230.8861
57110.7125.4457114.8377136.05370.00320.76130.35210.9708
58106.3113.4964102.8844124.10850.09190.69720.58740.3765
59118.6123.3605112.7478133.97330.18960.99920.41670.9341
60104.6110.446499.8326121.06030.14020.06610.190.19

\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 & 112.1 & - & - & - & - & - & - & - \tabularnewline
37 & 114.2 & - & - & - & - & - & - & - \tabularnewline
38 & 121.1 & - & - & - & - & - & - & - \tabularnewline
39 & 131.6 & - & - & - & - & - & - & - \tabularnewline
40 & 125 & - & - & - & - & - & - & - \tabularnewline
41 & 120.4 & - & - & - & - & - & - & - \tabularnewline
42 & 117.7 & - & - & - & - & - & - & - \tabularnewline
43 & 117.5 & - & - & - & - & - & - & - \tabularnewline
44 & 120.6 & - & - & - & - & - & - & - \tabularnewline
45 & 127.5 & - & - & - & - & - & - & - \tabularnewline
46 & 112.3 & - & - & - & - & - & - & - \tabularnewline
47 & 124.5 & - & - & - & - & - & - & - \tabularnewline
48 & 115.2 & - & - & - & - & - & - & - \tabularnewline
49 & 104.7 & 111.5423 & 101.5403 & 121.5442 & 0.09 & 0.2368 & 0.3012 & 0.2368 \tabularnewline
50 & 130.9 & 121.8307 & 111.8283 & 131.8331 & 0.0378 & 0.9996 & 0.5569 & 0.9031 \tabularnewline
51 & 129.2 & 127.5787 & 117.4674 & 137.69 & 0.3767 & 0.2598 & 0.2178 & 0.9918 \tabularnewline
52 & 113.5 & 122.422 & 111.8993 & 132.9448 & 0.0483 & 0.1034 & 0.3155 & 0.9107 \tabularnewline
53 & 125.6 & 119.3058 & 108.7794 & 129.8321 & 0.1206 & 0.8602 & 0.4193 & 0.7777 \tabularnewline
54 & 107.6 & 115.9676 & 105.4061 & 126.5291 & 0.0602 & 0.0369 & 0.3739 & 0.5566 \tabularnewline
55 & 107 & 116.8097 & 106.2107 & 127.4086 & 0.0348 & 0.9557 & 0.4492 & 0.617 \tabularnewline
56 & 121.6 & 121.7234 & 111.1223 & 132.3245 & 0.4909 & 0.9968 & 0.5823 & 0.8861 \tabularnewline
57 & 110.7 & 125.4457 & 114.8377 & 136.0537 & 0.0032 & 0.7613 & 0.3521 & 0.9708 \tabularnewline
58 & 106.3 & 113.4964 & 102.8844 & 124.1085 & 0.0919 & 0.6972 & 0.5874 & 0.3765 \tabularnewline
59 & 118.6 & 123.3605 & 112.7478 & 133.9733 & 0.1896 & 0.9992 & 0.4167 & 0.9341 \tabularnewline
60 & 104.6 & 110.4464 & 99.8326 & 121.0603 & 0.1402 & 0.0661 & 0.19 & 0.19 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66852&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]112.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]121.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]125[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]120.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]117.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]117.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]120.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]127.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]124.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]115.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]104.7[/C][C]111.5423[/C][C]101.5403[/C][C]121.5442[/C][C]0.09[/C][C]0.2368[/C][C]0.3012[/C][C]0.2368[/C][/ROW]
[ROW][C]50[/C][C]130.9[/C][C]121.8307[/C][C]111.8283[/C][C]131.8331[/C][C]0.0378[/C][C]0.9996[/C][C]0.5569[/C][C]0.9031[/C][/ROW]
[ROW][C]51[/C][C]129.2[/C][C]127.5787[/C][C]117.4674[/C][C]137.69[/C][C]0.3767[/C][C]0.2598[/C][C]0.2178[/C][C]0.9918[/C][/ROW]
[ROW][C]52[/C][C]113.5[/C][C]122.422[/C][C]111.8993[/C][C]132.9448[/C][C]0.0483[/C][C]0.1034[/C][C]0.3155[/C][C]0.9107[/C][/ROW]
[ROW][C]53[/C][C]125.6[/C][C]119.3058[/C][C]108.7794[/C][C]129.8321[/C][C]0.1206[/C][C]0.8602[/C][C]0.4193[/C][C]0.7777[/C][/ROW]
[ROW][C]54[/C][C]107.6[/C][C]115.9676[/C][C]105.4061[/C][C]126.5291[/C][C]0.0602[/C][C]0.0369[/C][C]0.3739[/C][C]0.5566[/C][/ROW]
[ROW][C]55[/C][C]107[/C][C]116.8097[/C][C]106.2107[/C][C]127.4086[/C][C]0.0348[/C][C]0.9557[/C][C]0.4492[/C][C]0.617[/C][/ROW]
[ROW][C]56[/C][C]121.6[/C][C]121.7234[/C][C]111.1223[/C][C]132.3245[/C][C]0.4909[/C][C]0.9968[/C][C]0.5823[/C][C]0.8861[/C][/ROW]
[ROW][C]57[/C][C]110.7[/C][C]125.4457[/C][C]114.8377[/C][C]136.0537[/C][C]0.0032[/C][C]0.7613[/C][C]0.3521[/C][C]0.9708[/C][/ROW]
[ROW][C]58[/C][C]106.3[/C][C]113.4964[/C][C]102.8844[/C][C]124.1085[/C][C]0.0919[/C][C]0.6972[/C][C]0.5874[/C][C]0.3765[/C][/ROW]
[ROW][C]59[/C][C]118.6[/C][C]123.3605[/C][C]112.7478[/C][C]133.9733[/C][C]0.1896[/C][C]0.9992[/C][C]0.4167[/C][C]0.9341[/C][/ROW]
[ROW][C]60[/C][C]104.6[/C][C]110.4464[/C][C]99.8326[/C][C]121.0603[/C][C]0.1402[/C][C]0.0661[/C][C]0.19[/C][C]0.19[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66852&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66852&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])
36112.1-------
37114.2-------
38121.1-------
39131.6-------
40125-------
41120.4-------
42117.7-------
43117.5-------
44120.6-------
45127.5-------
46112.3-------
47124.5-------
48115.2-------
49104.7111.5423101.5403121.54420.090.23680.30120.2368
50130.9121.8307111.8283131.83310.03780.99960.55690.9031
51129.2127.5787117.4674137.690.37670.25980.21780.9918
52113.5122.422111.8993132.94480.04830.10340.31550.9107
53125.6119.3058108.7794129.83210.12060.86020.41930.7777
54107.6115.9676105.4061126.52910.06020.03690.37390.5566
55107116.8097106.2107127.40860.03480.95570.44920.617
56121.6121.7234111.1223132.32450.49090.99680.58230.8861
57110.7125.4457114.8377136.05370.00320.76130.35210.9708
58106.3113.4964102.8844124.10850.09190.69720.58740.3765
59118.6123.3605112.7478133.97330.18960.99920.41670.9341
60104.6110.446499.8326121.06030.14020.06610.190.19







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0457-0.0613046.816600
500.04190.07440.067982.252264.53448.0333
510.04040.01270.04952.628743.89926.6256
520.0439-0.07290.055379.602652.8257.2681
530.0450.05280.054839.617350.18357.084
540.0465-0.07220.057770.016753.4897.3136
550.0463-0.0840.061596.229359.59487.7198
560.0444-0.0010.05390.015252.14737.2213
570.0431-0.11750.061217.435870.51278.3972
580.0477-0.06340.061251.788568.64038.2849
590.0439-0.03860.059222.662764.46058.0287
600.049-0.05290.058634.180761.93727.87

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0457 & -0.0613 & 0 & 46.8166 & 0 & 0 \tabularnewline
50 & 0.0419 & 0.0744 & 0.0679 & 82.2522 & 64.5344 & 8.0333 \tabularnewline
51 & 0.0404 & 0.0127 & 0.0495 & 2.6287 & 43.8992 & 6.6256 \tabularnewline
52 & 0.0439 & -0.0729 & 0.0553 & 79.6026 & 52.825 & 7.2681 \tabularnewline
53 & 0.045 & 0.0528 & 0.0548 & 39.6173 & 50.1835 & 7.084 \tabularnewline
54 & 0.0465 & -0.0722 & 0.0577 & 70.0167 & 53.489 & 7.3136 \tabularnewline
55 & 0.0463 & -0.084 & 0.0615 & 96.2293 & 59.5948 & 7.7198 \tabularnewline
56 & 0.0444 & -0.001 & 0.0539 & 0.0152 & 52.1473 & 7.2213 \tabularnewline
57 & 0.0431 & -0.1175 & 0.061 & 217.4358 & 70.5127 & 8.3972 \tabularnewline
58 & 0.0477 & -0.0634 & 0.0612 & 51.7885 & 68.6403 & 8.2849 \tabularnewline
59 & 0.0439 & -0.0386 & 0.0592 & 22.6627 & 64.4605 & 8.0287 \tabularnewline
60 & 0.049 & -0.0529 & 0.0586 & 34.1807 & 61.9372 & 7.87 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66852&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.0457[/C][C]-0.0613[/C][C]0[/C][C]46.8166[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0419[/C][C]0.0744[/C][C]0.0679[/C][C]82.2522[/C][C]64.5344[/C][C]8.0333[/C][/ROW]
[ROW][C]51[/C][C]0.0404[/C][C]0.0127[/C][C]0.0495[/C][C]2.6287[/C][C]43.8992[/C][C]6.6256[/C][/ROW]
[ROW][C]52[/C][C]0.0439[/C][C]-0.0729[/C][C]0.0553[/C][C]79.6026[/C][C]52.825[/C][C]7.2681[/C][/ROW]
[ROW][C]53[/C][C]0.045[/C][C]0.0528[/C][C]0.0548[/C][C]39.6173[/C][C]50.1835[/C][C]7.084[/C][/ROW]
[ROW][C]54[/C][C]0.0465[/C][C]-0.0722[/C][C]0.0577[/C][C]70.0167[/C][C]53.489[/C][C]7.3136[/C][/ROW]
[ROW][C]55[/C][C]0.0463[/C][C]-0.084[/C][C]0.0615[/C][C]96.2293[/C][C]59.5948[/C][C]7.7198[/C][/ROW]
[ROW][C]56[/C][C]0.0444[/C][C]-0.001[/C][C]0.0539[/C][C]0.0152[/C][C]52.1473[/C][C]7.2213[/C][/ROW]
[ROW][C]57[/C][C]0.0431[/C][C]-0.1175[/C][C]0.061[/C][C]217.4358[/C][C]70.5127[/C][C]8.3972[/C][/ROW]
[ROW][C]58[/C][C]0.0477[/C][C]-0.0634[/C][C]0.0612[/C][C]51.7885[/C][C]68.6403[/C][C]8.2849[/C][/ROW]
[ROW][C]59[/C][C]0.0439[/C][C]-0.0386[/C][C]0.0592[/C][C]22.6627[/C][C]64.4605[/C][C]8.0287[/C][/ROW]
[ROW][C]60[/C][C]0.049[/C][C]-0.0529[/C][C]0.0586[/C][C]34.1807[/C][C]61.9372[/C][C]7.87[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66852&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66852&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.0457-0.0613046.816600
500.04190.07440.067982.252264.53448.0333
510.04040.01270.04952.628743.89926.6256
520.0439-0.07290.055379.602652.8257.2681
530.0450.05280.054839.617350.18357.084
540.0465-0.07220.057770.016753.4897.3136
550.0463-0.0840.061596.229359.59487.7198
560.0444-0.0010.05390.015252.14737.2213
570.0431-0.11750.061217.435870.51278.3972
580.0477-0.06340.061251.788568.64038.2849
590.0439-0.03860.059222.662764.46058.0287
600.049-0.05290.058634.180761.93727.87



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