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 computationSun, 20 Dec 2009 10:05: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/20/t1261328751ad3nr1buxprg4mo.htm/, Retrieved Sat, 27 Apr 2024 15:10:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69953, Retrieved Sat, 27 Apr 2024 15:10:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact137
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   [ARIMA Backward Selection] [] [2009-11-27 14:53:14] [b98453cac15ba1066b407e146608df68]
-    D    [ARIMA Backward Selection] [] [2009-12-03 12:27:58] [875a981b2b01315c1c471abd4dd66675]
- RMP       [ARIMA Forecasting] [] [2009-12-11 17:38:45] [875a981b2b01315c1c471abd4dd66675]
-   PD          [ARIMA Forecasting] [] [2009-12-20 17:05:15] [8551abdd6804649d94d88b1829ac2b1a] [Current]
Feedback Forum

Post a new message
Dataseries X:
128.7
136.9
156.9
109.1
122.3
123.9
90.9
77.9
120.3
118.9
125.5
98.9
102.9
105.9
117.6
113.6
115.9
118.9
77.6
81.2
123.1
136.6
112.1
95.1
96.3
105.7
115.8
105.7
105.7
111.1
82.4
60
107.3
99.3
113.5
108.9
100.2
103.9
138.7
120.2
100.2
143.2
70.9
85.2
133
136.6
117.9
106.3
122.3
125.5
148.4
126.3
99.6
140.4
80.3
92.6
138.5
110.9
119.6
105
109
129.4
148.6
101.4
134.8
143.7
81.6
90.3
141.5
140.7
140.2
100.2
125.7
119.6
134.7
109
116.3
146.9
97.4
89.4
132.1
139.8
129
112.5
121.9
121.7
123.1
131.6
119.3
132.5
98.3
85.1
131.7
129.3
90.7
78.6
68.9
79.1
83.5
74.1
59.7
93.3
61.3
56.6
98.5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69953&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69953&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69953&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'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[93])
81132.1-------
82139.8-------
83129-------
84112.5-------
85121.9-------
86121.7-------
87123.1-------
88131.6-------
89119.3-------
90132.5-------
9198.3-------
9285.1-------
93131.7-------
94129.3138.7926109.416168.16930.26330.6820.47320.682
9590.7127.992698.0217157.96350.00740.46590.47370.4042
9678.6111.492680.939142.04620.01740.90890.47420.0974
9768.9120.892689.7672152.0185e-040.99610.47470.2481
9879.1120.692689.0058152.37940.0050.99930.47520.248
9983.5122.092689.8541154.33110.00950.99550.47560.2796
10074.1130.592697.8117163.37354e-040.99760.4760.4736
10159.7118.292684.9781151.60713e-040.99530.47640.2151
10293.3131.492697.6529165.33230.013510.47670.4952
10361.397.292662.9358131.64940.020.59010.47710.0248
10456.684.092649.2263118.95890.06110.90.47740.0037
10598.5130.692695.3242166.0610.037210.47770.4777

\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[93]) \tabularnewline
81 & 132.1 & - & - & - & - & - & - & - \tabularnewline
82 & 139.8 & - & - & - & - & - & - & - \tabularnewline
83 & 129 & - & - & - & - & - & - & - \tabularnewline
84 & 112.5 & - & - & - & - & - & - & - \tabularnewline
85 & 121.9 & - & - & - & - & - & - & - \tabularnewline
86 & 121.7 & - & - & - & - & - & - & - \tabularnewline
87 & 123.1 & - & - & - & - & - & - & - \tabularnewline
88 & 131.6 & - & - & - & - & - & - & - \tabularnewline
89 & 119.3 & - & - & - & - & - & - & - \tabularnewline
90 & 132.5 & - & - & - & - & - & - & - \tabularnewline
91 & 98.3 & - & - & - & - & - & - & - \tabularnewline
92 & 85.1 & - & - & - & - & - & - & - \tabularnewline
93 & 131.7 & - & - & - & - & - & - & - \tabularnewline
94 & 129.3 & 138.7926 & 109.416 & 168.1693 & 0.2633 & 0.682 & 0.4732 & 0.682 \tabularnewline
95 & 90.7 & 127.9926 & 98.0217 & 157.9635 & 0.0074 & 0.4659 & 0.4737 & 0.4042 \tabularnewline
96 & 78.6 & 111.4926 & 80.939 & 142.0462 & 0.0174 & 0.9089 & 0.4742 & 0.0974 \tabularnewline
97 & 68.9 & 120.8926 & 89.7672 & 152.018 & 5e-04 & 0.9961 & 0.4747 & 0.2481 \tabularnewline
98 & 79.1 & 120.6926 & 89.0058 & 152.3794 & 0.005 & 0.9993 & 0.4752 & 0.248 \tabularnewline
99 & 83.5 & 122.0926 & 89.8541 & 154.3311 & 0.0095 & 0.9955 & 0.4756 & 0.2796 \tabularnewline
100 & 74.1 & 130.5926 & 97.8117 & 163.3735 & 4e-04 & 0.9976 & 0.476 & 0.4736 \tabularnewline
101 & 59.7 & 118.2926 & 84.9781 & 151.6071 & 3e-04 & 0.9953 & 0.4764 & 0.2151 \tabularnewline
102 & 93.3 & 131.4926 & 97.6529 & 165.3323 & 0.0135 & 1 & 0.4767 & 0.4952 \tabularnewline
103 & 61.3 & 97.2926 & 62.9358 & 131.6494 & 0.02 & 0.5901 & 0.4771 & 0.0248 \tabularnewline
104 & 56.6 & 84.0926 & 49.2263 & 118.9589 & 0.0611 & 0.9 & 0.4774 & 0.0037 \tabularnewline
105 & 98.5 & 130.6926 & 95.3242 & 166.061 & 0.0372 & 1 & 0.4777 & 0.4777 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69953&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[93])[/C][/ROW]
[ROW][C]81[/C][C]132.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]139.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]129[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]112.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]121.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]121.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]123.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]119.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]132.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]98.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]85.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]131.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]129.3[/C][C]138.7926[/C][C]109.416[/C][C]168.1693[/C][C]0.2633[/C][C]0.682[/C][C]0.4732[/C][C]0.682[/C][/ROW]
[ROW][C]95[/C][C]90.7[/C][C]127.9926[/C][C]98.0217[/C][C]157.9635[/C][C]0.0074[/C][C]0.4659[/C][C]0.4737[/C][C]0.4042[/C][/ROW]
[ROW][C]96[/C][C]78.6[/C][C]111.4926[/C][C]80.939[/C][C]142.0462[/C][C]0.0174[/C][C]0.9089[/C][C]0.4742[/C][C]0.0974[/C][/ROW]
[ROW][C]97[/C][C]68.9[/C][C]120.8926[/C][C]89.7672[/C][C]152.018[/C][C]5e-04[/C][C]0.9961[/C][C]0.4747[/C][C]0.2481[/C][/ROW]
[ROW][C]98[/C][C]79.1[/C][C]120.6926[/C][C]89.0058[/C][C]152.3794[/C][C]0.005[/C][C]0.9993[/C][C]0.4752[/C][C]0.248[/C][/ROW]
[ROW][C]99[/C][C]83.5[/C][C]122.0926[/C][C]89.8541[/C][C]154.3311[/C][C]0.0095[/C][C]0.9955[/C][C]0.4756[/C][C]0.2796[/C][/ROW]
[ROW][C]100[/C][C]74.1[/C][C]130.5926[/C][C]97.8117[/C][C]163.3735[/C][C]4e-04[/C][C]0.9976[/C][C]0.476[/C][C]0.4736[/C][/ROW]
[ROW][C]101[/C][C]59.7[/C][C]118.2926[/C][C]84.9781[/C][C]151.6071[/C][C]3e-04[/C][C]0.9953[/C][C]0.4764[/C][C]0.2151[/C][/ROW]
[ROW][C]102[/C][C]93.3[/C][C]131.4926[/C][C]97.6529[/C][C]165.3323[/C][C]0.0135[/C][C]1[/C][C]0.4767[/C][C]0.4952[/C][/ROW]
[ROW][C]103[/C][C]61.3[/C][C]97.2926[/C][C]62.9358[/C][C]131.6494[/C][C]0.02[/C][C]0.5901[/C][C]0.4771[/C][C]0.0248[/C][/ROW]
[ROW][C]104[/C][C]56.6[/C][C]84.0926[/C][C]49.2263[/C][C]118.9589[/C][C]0.0611[/C][C]0.9[/C][C]0.4774[/C][C]0.0037[/C][/ROW]
[ROW][C]105[/C][C]98.5[/C][C]130.6926[/C][C]95.3242[/C][C]166.061[/C][C]0.0372[/C][C]1[/C][C]0.4777[/C][C]0.4777[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69953&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69953&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[93])
81132.1-------
82139.8-------
83129-------
84112.5-------
85121.9-------
86121.7-------
87123.1-------
88131.6-------
89119.3-------
90132.5-------
9198.3-------
9285.1-------
93131.7-------
94129.3138.7926109.416168.16930.26330.6820.47320.682
9590.7127.992698.0217157.96350.00740.46590.47370.4042
9678.6111.492680.939142.04620.01740.90890.47420.0974
9768.9120.892689.7672152.0185e-040.99610.47470.2481
9879.1120.692689.0058152.37940.0050.99930.47520.248
9983.5122.092689.8541154.33110.00950.99550.47560.2796
10074.1130.592697.8117163.37354e-040.99760.4760.4736
10159.7118.292684.9781151.60713e-040.99530.47640.2151
10293.3131.492697.6529165.33230.013510.47670.4952
10361.397.292662.9358131.64940.020.59010.47710.0248
10456.684.092649.2263118.95890.06110.90.47740.0037
10598.5130.692695.3242166.0610.037210.47770.4777







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
940.108-0.0684090.109700
950.1195-0.29140.17991390.7388740.424327.2107
960.1398-0.2950.21831081.9239854.257529.2277
970.1314-0.43010.27122703.23161316.50136.2836
980.1339-0.34460.28591729.94531399.189937.4057
990.1347-0.31610.29091489.38961414.223237.6062
1000.1281-0.43260.31123191.41511668.107740.8425
1010.1437-0.49530.33423433.09411888.73143.4595
1020.1313-0.29050.32931458.67551840.947142.9063
1030.1802-0.36990.33341295.46811786.399242.2658
1040.2115-0.32690.3328755.84371692.712341.1426
1050.1381-0.24630.32561036.36421638.016640.4724

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
94 & 0.108 & -0.0684 & 0 & 90.1097 & 0 & 0 \tabularnewline
95 & 0.1195 & -0.2914 & 0.1799 & 1390.7388 & 740.4243 & 27.2107 \tabularnewline
96 & 0.1398 & -0.295 & 0.2183 & 1081.9239 & 854.2575 & 29.2277 \tabularnewline
97 & 0.1314 & -0.4301 & 0.2712 & 2703.2316 & 1316.501 & 36.2836 \tabularnewline
98 & 0.1339 & -0.3446 & 0.2859 & 1729.9453 & 1399.1899 & 37.4057 \tabularnewline
99 & 0.1347 & -0.3161 & 0.2909 & 1489.3896 & 1414.2232 & 37.6062 \tabularnewline
100 & 0.1281 & -0.4326 & 0.3112 & 3191.4151 & 1668.1077 & 40.8425 \tabularnewline
101 & 0.1437 & -0.4953 & 0.3342 & 3433.0941 & 1888.731 & 43.4595 \tabularnewline
102 & 0.1313 & -0.2905 & 0.3293 & 1458.6755 & 1840.9471 & 42.9063 \tabularnewline
103 & 0.1802 & -0.3699 & 0.3334 & 1295.4681 & 1786.3992 & 42.2658 \tabularnewline
104 & 0.2115 & -0.3269 & 0.3328 & 755.8437 & 1692.7123 & 41.1426 \tabularnewline
105 & 0.1381 & -0.2463 & 0.3256 & 1036.3642 & 1638.0166 & 40.4724 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69953&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]94[/C][C]0.108[/C][C]-0.0684[/C][C]0[/C][C]90.1097[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]95[/C][C]0.1195[/C][C]-0.2914[/C][C]0.1799[/C][C]1390.7388[/C][C]740.4243[/C][C]27.2107[/C][/ROW]
[ROW][C]96[/C][C]0.1398[/C][C]-0.295[/C][C]0.2183[/C][C]1081.9239[/C][C]854.2575[/C][C]29.2277[/C][/ROW]
[ROW][C]97[/C][C]0.1314[/C][C]-0.4301[/C][C]0.2712[/C][C]2703.2316[/C][C]1316.501[/C][C]36.2836[/C][/ROW]
[ROW][C]98[/C][C]0.1339[/C][C]-0.3446[/C][C]0.2859[/C][C]1729.9453[/C][C]1399.1899[/C][C]37.4057[/C][/ROW]
[ROW][C]99[/C][C]0.1347[/C][C]-0.3161[/C][C]0.2909[/C][C]1489.3896[/C][C]1414.2232[/C][C]37.6062[/C][/ROW]
[ROW][C]100[/C][C]0.1281[/C][C]-0.4326[/C][C]0.3112[/C][C]3191.4151[/C][C]1668.1077[/C][C]40.8425[/C][/ROW]
[ROW][C]101[/C][C]0.1437[/C][C]-0.4953[/C][C]0.3342[/C][C]3433.0941[/C][C]1888.731[/C][C]43.4595[/C][/ROW]
[ROW][C]102[/C][C]0.1313[/C][C]-0.2905[/C][C]0.3293[/C][C]1458.6755[/C][C]1840.9471[/C][C]42.9063[/C][/ROW]
[ROW][C]103[/C][C]0.1802[/C][C]-0.3699[/C][C]0.3334[/C][C]1295.4681[/C][C]1786.3992[/C][C]42.2658[/C][/ROW]
[ROW][C]104[/C][C]0.2115[/C][C]-0.3269[/C][C]0.3328[/C][C]755.8437[/C][C]1692.7123[/C][C]41.1426[/C][/ROW]
[ROW][C]105[/C][C]0.1381[/C][C]-0.2463[/C][C]0.3256[/C][C]1036.3642[/C][C]1638.0166[/C][C]40.4724[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69953&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69953&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
940.108-0.0684090.109700
950.1195-0.29140.17991390.7388740.424327.2107
960.1398-0.2950.21831081.9239854.257529.2277
970.1314-0.43010.27122703.23161316.50136.2836
980.1339-0.34460.28591729.94531399.189937.4057
990.1347-0.31610.29091489.38961414.223237.6062
1000.1281-0.43260.31123191.41511668.107740.8425
1010.1437-0.49530.33423433.09411888.73143.4595
1020.1313-0.29050.32931458.67551840.947142.9063
1030.1802-0.36990.33341295.46811786.399242.2658
1040.2115-0.32690.3328755.84371692.712341.1426
1050.1381-0.24630.32561036.36421638.016640.4724



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