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 computationWed, 21 Dec 2011 06:37:56 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/21/t132446749495fdn78crjhalak.htm/, Retrieved Tue, 07 May 2024 06:03:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158523, Retrieved Tue, 07 May 2024 06:03:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact78
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [(Partial) Autocorrelation Function] [Unemployment] [2010-11-29 09:05:21] [b98453cac15ba1066b407e146608df68]
- R  D    [(Partial) Autocorrelation Function] [autocorrelatie ] [2011-12-07 13:35:25] [141ef847e2c5f8e947fe4eabcb0cf143]
-   PD      [(Partial) Autocorrelation Function] [autocorrelatie D=1] [2011-12-07 13:50:51] [141ef847e2c5f8e947fe4eabcb0cf143]
- RMP         [Standard Deviation-Mean Plot] [ST-MP] [2011-12-07 14:22:28] [141ef847e2c5f8e947fe4eabcb0cf143]
- RMP           [ARIMA Backward Selection] [ARIMA backward ] [2011-12-08 13:48:01] [141ef847e2c5f8e947fe4eabcb0cf143]
- RM              [ARIMA Forecasting] [ARIMA forecasting...] [2011-12-08 14:14:36] [141ef847e2c5f8e947fe4eabcb0cf143]
- R P                 [ARIMA Forecasting] [Arima forecasting...] [2011-12-21 11:37:56] [1a4698f17d8e7f554418314cf0e4bd67] [Current]
Feedback Forum

Post a new message
Dataseries X:
114.7
108
101.3
108.4
105.6
120.4
107.6
111.4
122.1
104.8
103.2
112.3
123.1
115.5
106.3
119.9
119.5
120.9
127.5
116.6
126.7
110.6
100.4
125.2
125
105.2
102.7
94.2
97
111.1
102
97.3
109.8
98.9
93.2
115.2
115
107
104.1
106
110.8
127.8
116.9
113.8
131.6
106.1
107.2
127.4
123
121.8
117.6
118.4
121.8
141.9
122.1
132.2
131.6
108.8
120.4
134.7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 1 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158523&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158523&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158523&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 time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







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])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123121.8441107.9514135.73670.43520.21660.83290.2166
50121.8119.2896103.5705135.00870.37710.32180.93730.1559
51117.6112.900493.8323131.96850.31450.18020.81720.0681
52118.4114.243989.9362138.55170.36880.39330.74690.1444
53121.8121.594695.1975147.99170.49390.59380.78860.3332
54141.9135.8549105.9004165.80930.34620.82110.70090.7099
55122.1126.067692.9667159.16850.40710.17430.70640.4686
56132.2123.487288.2335158.74080.3140.53070.70490.4139
57131.6139.8743101.664178.08470.33560.65310.66440.7389
58108.8115.539175.0379156.04030.37220.21850.67610.283
59120.4116.281173.6651158.89710.42490.63460.66190.3045
60134.7136.062691.0655181.05970.47630.75250.6470.647

\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 & 115.2 & - & - & - & - & - & - & - \tabularnewline
37 & 115 & - & - & - & - & - & - & - \tabularnewline
38 & 107 & - & - & - & - & - & - & - \tabularnewline
39 & 104.1 & - & - & - & - & - & - & - \tabularnewline
40 & 106 & - & - & - & - & - & - & - \tabularnewline
41 & 110.8 & - & - & - & - & - & - & - \tabularnewline
42 & 127.8 & - & - & - & - & - & - & - \tabularnewline
43 & 116.9 & - & - & - & - & - & - & - \tabularnewline
44 & 113.8 & - & - & - & - & - & - & - \tabularnewline
45 & 131.6 & - & - & - & - & - & - & - \tabularnewline
46 & 106.1 & - & - & - & - & - & - & - \tabularnewline
47 & 107.2 & - & - & - & - & - & - & - \tabularnewline
48 & 127.4 & - & - & - & - & - & - & - \tabularnewline
49 & 123 & 121.8441 & 107.9514 & 135.7367 & 0.4352 & 0.2166 & 0.8329 & 0.2166 \tabularnewline
50 & 121.8 & 119.2896 & 103.5705 & 135.0087 & 0.3771 & 0.3218 & 0.9373 & 0.1559 \tabularnewline
51 & 117.6 & 112.9004 & 93.8323 & 131.9685 & 0.3145 & 0.1802 & 0.8172 & 0.0681 \tabularnewline
52 & 118.4 & 114.2439 & 89.9362 & 138.5517 & 0.3688 & 0.3933 & 0.7469 & 0.1444 \tabularnewline
53 & 121.8 & 121.5946 & 95.1975 & 147.9917 & 0.4939 & 0.5938 & 0.7886 & 0.3332 \tabularnewline
54 & 141.9 & 135.8549 & 105.9004 & 165.8093 & 0.3462 & 0.8211 & 0.7009 & 0.7099 \tabularnewline
55 & 122.1 & 126.0676 & 92.9667 & 159.1685 & 0.4071 & 0.1743 & 0.7064 & 0.4686 \tabularnewline
56 & 132.2 & 123.4872 & 88.2335 & 158.7408 & 0.314 & 0.5307 & 0.7049 & 0.4139 \tabularnewline
57 & 131.6 & 139.8743 & 101.664 & 178.0847 & 0.3356 & 0.6531 & 0.6644 & 0.7389 \tabularnewline
58 & 108.8 & 115.5391 & 75.0379 & 156.0403 & 0.3722 & 0.2185 & 0.6761 & 0.283 \tabularnewline
59 & 120.4 & 116.2811 & 73.6651 & 158.8971 & 0.4249 & 0.6346 & 0.6619 & 0.3045 \tabularnewline
60 & 134.7 & 136.0626 & 91.0655 & 181.0597 & 0.4763 & 0.7525 & 0.647 & 0.647 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158523&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]115.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]107[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]104.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]116.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]106.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]123[/C][C]121.8441[/C][C]107.9514[/C][C]135.7367[/C][C]0.4352[/C][C]0.2166[/C][C]0.8329[/C][C]0.2166[/C][/ROW]
[ROW][C]50[/C][C]121.8[/C][C]119.2896[/C][C]103.5705[/C][C]135.0087[/C][C]0.3771[/C][C]0.3218[/C][C]0.9373[/C][C]0.1559[/C][/ROW]
[ROW][C]51[/C][C]117.6[/C][C]112.9004[/C][C]93.8323[/C][C]131.9685[/C][C]0.3145[/C][C]0.1802[/C][C]0.8172[/C][C]0.0681[/C][/ROW]
[ROW][C]52[/C][C]118.4[/C][C]114.2439[/C][C]89.9362[/C][C]138.5517[/C][C]0.3688[/C][C]0.3933[/C][C]0.7469[/C][C]0.1444[/C][/ROW]
[ROW][C]53[/C][C]121.8[/C][C]121.5946[/C][C]95.1975[/C][C]147.9917[/C][C]0.4939[/C][C]0.5938[/C][C]0.7886[/C][C]0.3332[/C][/ROW]
[ROW][C]54[/C][C]141.9[/C][C]135.8549[/C][C]105.9004[/C][C]165.8093[/C][C]0.3462[/C][C]0.8211[/C][C]0.7009[/C][C]0.7099[/C][/ROW]
[ROW][C]55[/C][C]122.1[/C][C]126.0676[/C][C]92.9667[/C][C]159.1685[/C][C]0.4071[/C][C]0.1743[/C][C]0.7064[/C][C]0.4686[/C][/ROW]
[ROW][C]56[/C][C]132.2[/C][C]123.4872[/C][C]88.2335[/C][C]158.7408[/C][C]0.314[/C][C]0.5307[/C][C]0.7049[/C][C]0.4139[/C][/ROW]
[ROW][C]57[/C][C]131.6[/C][C]139.8743[/C][C]101.664[/C][C]178.0847[/C][C]0.3356[/C][C]0.6531[/C][C]0.6644[/C][C]0.7389[/C][/ROW]
[ROW][C]58[/C][C]108.8[/C][C]115.5391[/C][C]75.0379[/C][C]156.0403[/C][C]0.3722[/C][C]0.2185[/C][C]0.6761[/C][C]0.283[/C][/ROW]
[ROW][C]59[/C][C]120.4[/C][C]116.2811[/C][C]73.6651[/C][C]158.8971[/C][C]0.4249[/C][C]0.6346[/C][C]0.6619[/C][C]0.3045[/C][/ROW]
[ROW][C]60[/C][C]134.7[/C][C]136.0626[/C][C]91.0655[/C][C]181.0597[/C][C]0.4763[/C][C]0.7525[/C][C]0.647[/C][C]0.647[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158523&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158523&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])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123121.8441107.9514135.73670.43520.21660.83290.2166
50121.8119.2896103.5705135.00870.37710.32180.93730.1559
51117.6112.900493.8323131.96850.31450.18020.81720.0681
52118.4114.243989.9362138.55170.36880.39330.74690.1444
53121.8121.594695.1975147.99170.49390.59380.78860.3332
54141.9135.8549105.9004165.80930.34620.82110.70090.7099
55122.1126.067692.9667159.16850.40710.17430.70640.4686
56132.2123.487288.2335158.74080.3140.53070.70490.4139
57131.6139.8743101.664178.08470.33560.65310.66440.7389
58108.8115.539175.0379156.04030.37220.21850.67610.283
59120.4116.281173.6651158.89710.42490.63460.66190.3045
60134.7136.062691.0655181.05970.47630.75250.6470.647







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.05820.009501.336200
500.06720.0210.01536.30233.81921.9543
510.08620.04160.024122.0869.90813.1477
520.10860.03640.027117.272911.74933.4277
530.11080.00170.0220.04229.40793.0672
540.11250.04450.025836.543713.93053.7324
550.134-0.03150.026615.74214.18933.7669
560.14570.07060.032175.913621.90494.6803
570.1394-0.05920.035168.464727.07825.2037
580.1788-0.05830.037445.415528.91195.377
590.1870.03540.037216.965127.82585.275
600.1687-0.010.0351.856625.66175.0657

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0582 & 0.0095 & 0 & 1.3362 & 0 & 0 \tabularnewline
50 & 0.0672 & 0.021 & 0.0153 & 6.3023 & 3.8192 & 1.9543 \tabularnewline
51 & 0.0862 & 0.0416 & 0.0241 & 22.086 & 9.9081 & 3.1477 \tabularnewline
52 & 0.1086 & 0.0364 & 0.0271 & 17.2729 & 11.7493 & 3.4277 \tabularnewline
53 & 0.1108 & 0.0017 & 0.022 & 0.0422 & 9.4079 & 3.0672 \tabularnewline
54 & 0.1125 & 0.0445 & 0.0258 & 36.5437 & 13.9305 & 3.7324 \tabularnewline
55 & 0.134 & -0.0315 & 0.0266 & 15.742 & 14.1893 & 3.7669 \tabularnewline
56 & 0.1457 & 0.0706 & 0.0321 & 75.9136 & 21.9049 & 4.6803 \tabularnewline
57 & 0.1394 & -0.0592 & 0.0351 & 68.4647 & 27.0782 & 5.2037 \tabularnewline
58 & 0.1788 & -0.0583 & 0.0374 & 45.4155 & 28.9119 & 5.377 \tabularnewline
59 & 0.187 & 0.0354 & 0.0372 & 16.9651 & 27.8258 & 5.275 \tabularnewline
60 & 0.1687 & -0.01 & 0.035 & 1.8566 & 25.6617 & 5.0657 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158523&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.0582[/C][C]0.0095[/C][C]0[/C][C]1.3362[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0672[/C][C]0.021[/C][C]0.0153[/C][C]6.3023[/C][C]3.8192[/C][C]1.9543[/C][/ROW]
[ROW][C]51[/C][C]0.0862[/C][C]0.0416[/C][C]0.0241[/C][C]22.086[/C][C]9.9081[/C][C]3.1477[/C][/ROW]
[ROW][C]52[/C][C]0.1086[/C][C]0.0364[/C][C]0.0271[/C][C]17.2729[/C][C]11.7493[/C][C]3.4277[/C][/ROW]
[ROW][C]53[/C][C]0.1108[/C][C]0.0017[/C][C]0.022[/C][C]0.0422[/C][C]9.4079[/C][C]3.0672[/C][/ROW]
[ROW][C]54[/C][C]0.1125[/C][C]0.0445[/C][C]0.0258[/C][C]36.5437[/C][C]13.9305[/C][C]3.7324[/C][/ROW]
[ROW][C]55[/C][C]0.134[/C][C]-0.0315[/C][C]0.0266[/C][C]15.742[/C][C]14.1893[/C][C]3.7669[/C][/ROW]
[ROW][C]56[/C][C]0.1457[/C][C]0.0706[/C][C]0.0321[/C][C]75.9136[/C][C]21.9049[/C][C]4.6803[/C][/ROW]
[ROW][C]57[/C][C]0.1394[/C][C]-0.0592[/C][C]0.0351[/C][C]68.4647[/C][C]27.0782[/C][C]5.2037[/C][/ROW]
[ROW][C]58[/C][C]0.1788[/C][C]-0.0583[/C][C]0.0374[/C][C]45.4155[/C][C]28.9119[/C][C]5.377[/C][/ROW]
[ROW][C]59[/C][C]0.187[/C][C]0.0354[/C][C]0.0372[/C][C]16.9651[/C][C]27.8258[/C][C]5.275[/C][/ROW]
[ROW][C]60[/C][C]0.1687[/C][C]-0.01[/C][C]0.035[/C][C]1.8566[/C][C]25.6617[/C][C]5.0657[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158523&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158523&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.05820.009501.336200
500.06720.0210.01536.30233.81921.9543
510.08620.04160.024122.0869.90813.1477
520.10860.03640.027117.272911.74933.4277
530.11080.00170.0220.04229.40793.0672
540.11250.04450.025836.543713.93053.7324
550.134-0.03150.026615.74214.18933.7669
560.14570.07060.032175.913621.90494.6803
570.1394-0.05920.035168.464727.07825.2037
580.1788-0.05830.037445.415528.91195.377
590.1870.03540.037216.965127.82585.275
600.1687-0.010.0351.856625.66175.0657



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