Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 16 Dec 2008 05:48:14 -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/2008/Dec/16/t1229431769f9xjadtw49b54hr.htm/, Retrieved Wed, 15 May 2024 14:39:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33939, Retrieved Wed, 15 May 2024 14:39:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact191
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-10 08:55:26] [74be16979710d4c4e7c6647856088456]
-   PD    [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 12:48:14] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
101,2
100,5
98
106,6
90,1
96,9
125,9
112
100
123,9
79,8
83,4
113,6
112,9
104
109,9
99
106,3
128,9
111,1
102,9
130
87
87,5
117,6
103,4
110,8
112,6
102,5
112,4
135,6
105,1
127,7
137
91
90,5
122,4
123,3
124,3
120
118,1
119
142,7
123,6
129,6
151,6
110,4
99,2
130,5
136,2
129,7
128
121,6
135,8
143,8
147,5
136,2
156,6
123,3
100,4




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 5 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33939&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33939&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33939&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 time5 seconds
R Server'George Udny Yule' @ 72.249.76.132







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])
3690.5-------
37122.4-------
38123.3-------
39124.3-------
40120-------
41118.1-------
42119-------
43142.7-------
44123.6-------
45129.6-------
46151.6-------
47110.4-------
4899.2-------
49130.5137.7661127.1114148.42070.090710.99761
50136.2129.2346118.5554139.91370.10060.40820.8621
51129.7133.7785123.1039144.45310.2270.32830.95911
52128129.3131118.3398140.28630.40730.47250.95191
53121.6127.2361115.8431138.62910.16610.44770.9421
54135.8128.3487116.8621139.83520.10180.87520.94471
55143.8156.3437144.6076168.07970.01810.99970.98871
56147.5128.3706116.4789140.26228e-040.00550.78421
57136.2141.8822129.7265154.0380.17980.18250.97621
58156.6155.4803143.1979167.76270.42910.9990.73211
59123.3116.8679104.3305129.40530.157300.8440.9971
60100.4107.931595.2643120.59860.12190.00870.91170.9117

\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 & 90.5 & - & - & - & - & - & - & - \tabularnewline
37 & 122.4 & - & - & - & - & - & - & - \tabularnewline
38 & 123.3 & - & - & - & - & - & - & - \tabularnewline
39 & 124.3 & - & - & - & - & - & - & - \tabularnewline
40 & 120 & - & - & - & - & - & - & - \tabularnewline
41 & 118.1 & - & - & - & - & - & - & - \tabularnewline
42 & 119 & - & - & - & - & - & - & - \tabularnewline
43 & 142.7 & - & - & - & - & - & - & - \tabularnewline
44 & 123.6 & - & - & - & - & - & - & - \tabularnewline
45 & 129.6 & - & - & - & - & - & - & - \tabularnewline
46 & 151.6 & - & - & - & - & - & - & - \tabularnewline
47 & 110.4 & - & - & - & - & - & - & - \tabularnewline
48 & 99.2 & - & - & - & - & - & - & - \tabularnewline
49 & 130.5 & 137.7661 & 127.1114 & 148.4207 & 0.0907 & 1 & 0.9976 & 1 \tabularnewline
50 & 136.2 & 129.2346 & 118.5554 & 139.9137 & 0.1006 & 0.4082 & 0.862 & 1 \tabularnewline
51 & 129.7 & 133.7785 & 123.1039 & 144.4531 & 0.227 & 0.3283 & 0.9591 & 1 \tabularnewline
52 & 128 & 129.3131 & 118.3398 & 140.2863 & 0.4073 & 0.4725 & 0.9519 & 1 \tabularnewline
53 & 121.6 & 127.2361 & 115.8431 & 138.6291 & 0.1661 & 0.4477 & 0.942 & 1 \tabularnewline
54 & 135.8 & 128.3487 & 116.8621 & 139.8352 & 0.1018 & 0.8752 & 0.9447 & 1 \tabularnewline
55 & 143.8 & 156.3437 & 144.6076 & 168.0797 & 0.0181 & 0.9997 & 0.9887 & 1 \tabularnewline
56 & 147.5 & 128.3706 & 116.4789 & 140.2622 & 8e-04 & 0.0055 & 0.7842 & 1 \tabularnewline
57 & 136.2 & 141.8822 & 129.7265 & 154.038 & 0.1798 & 0.1825 & 0.9762 & 1 \tabularnewline
58 & 156.6 & 155.4803 & 143.1979 & 167.7627 & 0.4291 & 0.999 & 0.7321 & 1 \tabularnewline
59 & 123.3 & 116.8679 & 104.3305 & 129.4053 & 0.1573 & 0 & 0.844 & 0.9971 \tabularnewline
60 & 100.4 & 107.9315 & 95.2643 & 120.5986 & 0.1219 & 0.0087 & 0.9117 & 0.9117 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33939&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]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]122.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]123.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]124.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]118.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]119[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]142.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]123.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]151.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]110.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]99.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]130.5[/C][C]137.7661[/C][C]127.1114[/C][C]148.4207[/C][C]0.0907[/C][C]1[/C][C]0.9976[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]136.2[/C][C]129.2346[/C][C]118.5554[/C][C]139.9137[/C][C]0.1006[/C][C]0.4082[/C][C]0.862[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]129.7[/C][C]133.7785[/C][C]123.1039[/C][C]144.4531[/C][C]0.227[/C][C]0.3283[/C][C]0.9591[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]128[/C][C]129.3131[/C][C]118.3398[/C][C]140.2863[/C][C]0.4073[/C][C]0.4725[/C][C]0.9519[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]121.6[/C][C]127.2361[/C][C]115.8431[/C][C]138.6291[/C][C]0.1661[/C][C]0.4477[/C][C]0.942[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]135.8[/C][C]128.3487[/C][C]116.8621[/C][C]139.8352[/C][C]0.1018[/C][C]0.8752[/C][C]0.9447[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]143.8[/C][C]156.3437[/C][C]144.6076[/C][C]168.0797[/C][C]0.0181[/C][C]0.9997[/C][C]0.9887[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]147.5[/C][C]128.3706[/C][C]116.4789[/C][C]140.2622[/C][C]8e-04[/C][C]0.0055[/C][C]0.7842[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]136.2[/C][C]141.8822[/C][C]129.7265[/C][C]154.038[/C][C]0.1798[/C][C]0.1825[/C][C]0.9762[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]156.6[/C][C]155.4803[/C][C]143.1979[/C][C]167.7627[/C][C]0.4291[/C][C]0.999[/C][C]0.7321[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]123.3[/C][C]116.8679[/C][C]104.3305[/C][C]129.4053[/C][C]0.1573[/C][C]0[/C][C]0.844[/C][C]0.9971[/C][/ROW]
[ROW][C]60[/C][C]100.4[/C][C]107.9315[/C][C]95.2643[/C][C]120.5986[/C][C]0.1219[/C][C]0.0087[/C][C]0.9117[/C][C]0.9117[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33939&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33939&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])
3690.5-------
37122.4-------
38123.3-------
39124.3-------
40120-------
41118.1-------
42119-------
43142.7-------
44123.6-------
45129.6-------
46151.6-------
47110.4-------
4899.2-------
49130.5137.7661127.1114148.42070.090710.99761
50136.2129.2346118.5554139.91370.10060.40820.8621
51129.7133.7785123.1039144.45310.2270.32830.95911
52128129.3131118.3398140.28630.40730.47250.95191
53121.6127.2361115.8431138.62910.16610.44770.9421
54135.8128.3487116.8621139.83520.10180.87520.94471
55143.8156.3437144.6076168.07970.01810.99970.98871
56147.5128.3706116.4789140.26228e-040.00550.78421
57136.2141.8822129.7265154.0380.17980.18250.97621
58156.6155.4803143.1979167.76270.42910.9990.73211
59123.3116.8679104.3305129.40530.157300.8440.9971
60100.4107.931595.2643120.59860.12190.00870.91170.9117







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0395-0.05270.004452.79564.39962.0975
500.04220.05390.004548.51724.04312.0107
510.0407-0.03050.002516.63391.38621.1774
520.0433-0.01028e-041.72420.14370.3791
530.0457-0.04430.003731.76582.64711.627
540.04570.05810.004855.52224.62692.151
550.0383-0.08020.0067157.344113.1123.6211
560.04730.1490.0124365.935130.49465.5222
570.0437-0.040.003332.28762.69061.6403
580.04030.00726e-041.25380.10450.3232
590.05470.0550.004641.37173.44761.8568
600.0599-0.06980.005856.72294.72692.1741

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0395 & -0.0527 & 0.0044 & 52.7956 & 4.3996 & 2.0975 \tabularnewline
50 & 0.0422 & 0.0539 & 0.0045 & 48.5172 & 4.0431 & 2.0107 \tabularnewline
51 & 0.0407 & -0.0305 & 0.0025 & 16.6339 & 1.3862 & 1.1774 \tabularnewline
52 & 0.0433 & -0.0102 & 8e-04 & 1.7242 & 0.1437 & 0.3791 \tabularnewline
53 & 0.0457 & -0.0443 & 0.0037 & 31.7658 & 2.6471 & 1.627 \tabularnewline
54 & 0.0457 & 0.0581 & 0.0048 & 55.5222 & 4.6269 & 2.151 \tabularnewline
55 & 0.0383 & -0.0802 & 0.0067 & 157.3441 & 13.112 & 3.6211 \tabularnewline
56 & 0.0473 & 0.149 & 0.0124 & 365.9351 & 30.4946 & 5.5222 \tabularnewline
57 & 0.0437 & -0.04 & 0.0033 & 32.2876 & 2.6906 & 1.6403 \tabularnewline
58 & 0.0403 & 0.0072 & 6e-04 & 1.2538 & 0.1045 & 0.3232 \tabularnewline
59 & 0.0547 & 0.055 & 0.0046 & 41.3717 & 3.4476 & 1.8568 \tabularnewline
60 & 0.0599 & -0.0698 & 0.0058 & 56.7229 & 4.7269 & 2.1741 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33939&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.0395[/C][C]-0.0527[/C][C]0.0044[/C][C]52.7956[/C][C]4.3996[/C][C]2.0975[/C][/ROW]
[ROW][C]50[/C][C]0.0422[/C][C]0.0539[/C][C]0.0045[/C][C]48.5172[/C][C]4.0431[/C][C]2.0107[/C][/ROW]
[ROW][C]51[/C][C]0.0407[/C][C]-0.0305[/C][C]0.0025[/C][C]16.6339[/C][C]1.3862[/C][C]1.1774[/C][/ROW]
[ROW][C]52[/C][C]0.0433[/C][C]-0.0102[/C][C]8e-04[/C][C]1.7242[/C][C]0.1437[/C][C]0.3791[/C][/ROW]
[ROW][C]53[/C][C]0.0457[/C][C]-0.0443[/C][C]0.0037[/C][C]31.7658[/C][C]2.6471[/C][C]1.627[/C][/ROW]
[ROW][C]54[/C][C]0.0457[/C][C]0.0581[/C][C]0.0048[/C][C]55.5222[/C][C]4.6269[/C][C]2.151[/C][/ROW]
[ROW][C]55[/C][C]0.0383[/C][C]-0.0802[/C][C]0.0067[/C][C]157.3441[/C][C]13.112[/C][C]3.6211[/C][/ROW]
[ROW][C]56[/C][C]0.0473[/C][C]0.149[/C][C]0.0124[/C][C]365.9351[/C][C]30.4946[/C][C]5.5222[/C][/ROW]
[ROW][C]57[/C][C]0.0437[/C][C]-0.04[/C][C]0.0033[/C][C]32.2876[/C][C]2.6906[/C][C]1.6403[/C][/ROW]
[ROW][C]58[/C][C]0.0403[/C][C]0.0072[/C][C]6e-04[/C][C]1.2538[/C][C]0.1045[/C][C]0.3232[/C][/ROW]
[ROW][C]59[/C][C]0.0547[/C][C]0.055[/C][C]0.0046[/C][C]41.3717[/C][C]3.4476[/C][C]1.8568[/C][/ROW]
[ROW][C]60[/C][C]0.0599[/C][C]-0.0698[/C][C]0.0058[/C][C]56.7229[/C][C]4.7269[/C][C]2.1741[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33939&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33939&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.0395-0.05270.004452.79564.39962.0975
500.04220.05390.004548.51724.04312.0107
510.0407-0.03050.002516.63391.38621.1774
520.0433-0.01028e-041.72420.14370.3791
530.0457-0.04430.003731.76582.64711.627
540.04570.05810.004855.52224.62692.151
550.0383-0.08020.0067157.344113.1123.6211
560.04730.1490.0124365.935130.49465.5222
570.0437-0.040.003332.28762.69061.6403
580.04030.00726e-041.25380.10450.3232
590.05470.0550.004641.37173.44761.8568
600.0599-0.06980.005856.72294.72692.1741



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