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, 16 Dec 2009 13:44:06 -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/16/t12609963249mxwj7cldqbg1xr.htm/, Retrieved Tue, 30 Apr 2024 10:10:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68596, Retrieved Tue, 30 Apr 2024 10:10:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact126
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [VRM - vaste rente...] [2008-12-12 10:51:08] [c5a66f1c8528a963efc2b82a8519f117]
- RM D  [Standard Deviation-Mean Plot] [SDMP inschrijving...] [2008-12-12 11:03:14] [c5a66f1c8528a963efc2b82a8519f117]
- RM      [Variance Reduction Matrix] [VRM - inschrijvin...] [2008-12-12 11:08:27] [c5a66f1c8528a963efc2b82a8519f117]
- RMP       [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:14:36] [c5a66f1c8528a963efc2b82a8519f117]
-   P         [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:32:48] [c5a66f1c8528a963efc2b82a8519f117]
-               [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:37:19] [c5a66f1c8528a963efc2b82a8519f117]
- RM              [ARIMA Backward Selection] [ARIMA backward se...] [2008-12-12 11:51:13] [c5a66f1c8528a963efc2b82a8519f117]
- RM                [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-12 11:57:42] [c5a66f1c8528a963efc2b82a8519f117]
F                     [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-12 12:06:55] [c5a66f1c8528a963efc2b82a8519f117]
-  MPD                    [ARIMA Forecasting] [ARIMA forecasting...] [2009-12-16 20:44:06] [557d56ec4b06cd0135c259898de8ce95] [Current]
Feedback Forum

Post a new message
Dataseries X:
17,8
17,9
17,4
16,7
16
16,6
19,1
17,8
17,2
18,6
16,3
15,1
19,2
17,7
19,1
18
17,5
17,8
21,1
17,2
19,4
19,8
17,6
16,2
19,5
19,9
20
17,3
18,9
18,6
21,4
18,6
19,8
20,8
19,6
17,7
19,8
22,2
20,7
17,9
20,9
21,2
21,4
23
21,3
23,9
22,4
18,3
22,8
22,3
17,8
16,4
16
16,4
17,7
16,6
16,2
18,3
17,6
15,1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68596&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 time4 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])
3617.7-------
3719.8-------
3822.2-------
3920.7-------
4017.9-------
4120.9-------
4221.2-------
4321.4-------
4423-------
4521.3-------
4623.9-------
4722.4-------
4818.3-------
4922.823.444321.240726.190.32280.99990.99540.9999
5022.324.673422.240427.7420.06480.88430.94291
5117.822.920420.716125.68271e-040.67010.94240.9995
5216.421.099319.013923.7312e-040.9930.99140.9815
531622.447620.062525.517800.99990.83840.9959
5416.423.154320.511126.63131e-0410.86470.9969
5517.725.281521.998429.7965e-040.99990.9540.9988
5616.625.386322.009830.07161e-040.99930.84090.9985
5716.223.846620.765828.07482e-040.99960.88110.9949
5818.326.955322.934532.81090.00190.99980.84680.9981
5917.623.698520.496728.16890.00370.9910.71540.991
6015.119.677717.40422.680.00140.91250.81580.8158

\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 & 17.7 & - & - & - & - & - & - & - \tabularnewline
37 & 19.8 & - & - & - & - & - & - & - \tabularnewline
38 & 22.2 & - & - & - & - & - & - & - \tabularnewline
39 & 20.7 & - & - & - & - & - & - & - \tabularnewline
40 & 17.9 & - & - & - & - & - & - & - \tabularnewline
41 & 20.9 & - & - & - & - & - & - & - \tabularnewline
42 & 21.2 & - & - & - & - & - & - & - \tabularnewline
43 & 21.4 & - & - & - & - & - & - & - \tabularnewline
44 & 23 & - & - & - & - & - & - & - \tabularnewline
45 & 21.3 & - & - & - & - & - & - & - \tabularnewline
46 & 23.9 & - & - & - & - & - & - & - \tabularnewline
47 & 22.4 & - & - & - & - & - & - & - \tabularnewline
48 & 18.3 & - & - & - & - & - & - & - \tabularnewline
49 & 22.8 & 23.4443 & 21.2407 & 26.19 & 0.3228 & 0.9999 & 0.9954 & 0.9999 \tabularnewline
50 & 22.3 & 24.6734 & 22.2404 & 27.742 & 0.0648 & 0.8843 & 0.9429 & 1 \tabularnewline
51 & 17.8 & 22.9204 & 20.7161 & 25.6827 & 1e-04 & 0.6701 & 0.9424 & 0.9995 \tabularnewline
52 & 16.4 & 21.0993 & 19.0139 & 23.731 & 2e-04 & 0.993 & 0.9914 & 0.9815 \tabularnewline
53 & 16 & 22.4476 & 20.0625 & 25.5178 & 0 & 0.9999 & 0.8384 & 0.9959 \tabularnewline
54 & 16.4 & 23.1543 & 20.5111 & 26.6313 & 1e-04 & 1 & 0.8647 & 0.9969 \tabularnewline
55 & 17.7 & 25.2815 & 21.9984 & 29.796 & 5e-04 & 0.9999 & 0.954 & 0.9988 \tabularnewline
56 & 16.6 & 25.3863 & 22.0098 & 30.0716 & 1e-04 & 0.9993 & 0.8409 & 0.9985 \tabularnewline
57 & 16.2 & 23.8466 & 20.7658 & 28.0748 & 2e-04 & 0.9996 & 0.8811 & 0.9949 \tabularnewline
58 & 18.3 & 26.9553 & 22.9345 & 32.8109 & 0.0019 & 0.9998 & 0.8468 & 0.9981 \tabularnewline
59 & 17.6 & 23.6985 & 20.4967 & 28.1689 & 0.0037 & 0.991 & 0.7154 & 0.991 \tabularnewline
60 & 15.1 & 19.6777 & 17.404 & 22.68 & 0.0014 & 0.9125 & 0.8158 & 0.8158 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68596&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]17.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]19.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]22.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]20.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]21.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]21.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]23.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]22.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]18.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22.8[/C][C]23.4443[/C][C]21.2407[/C][C]26.19[/C][C]0.3228[/C][C]0.9999[/C][C]0.9954[/C][C]0.9999[/C][/ROW]
[ROW][C]50[/C][C]22.3[/C][C]24.6734[/C][C]22.2404[/C][C]27.742[/C][C]0.0648[/C][C]0.8843[/C][C]0.9429[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]17.8[/C][C]22.9204[/C][C]20.7161[/C][C]25.6827[/C][C]1e-04[/C][C]0.6701[/C][C]0.9424[/C][C]0.9995[/C][/ROW]
[ROW][C]52[/C][C]16.4[/C][C]21.0993[/C][C]19.0139[/C][C]23.731[/C][C]2e-04[/C][C]0.993[/C][C]0.9914[/C][C]0.9815[/C][/ROW]
[ROW][C]53[/C][C]16[/C][C]22.4476[/C][C]20.0625[/C][C]25.5178[/C][C]0[/C][C]0.9999[/C][C]0.8384[/C][C]0.9959[/C][/ROW]
[ROW][C]54[/C][C]16.4[/C][C]23.1543[/C][C]20.5111[/C][C]26.6313[/C][C]1e-04[/C][C]1[/C][C]0.8647[/C][C]0.9969[/C][/ROW]
[ROW][C]55[/C][C]17.7[/C][C]25.2815[/C][C]21.9984[/C][C]29.796[/C][C]5e-04[/C][C]0.9999[/C][C]0.954[/C][C]0.9988[/C][/ROW]
[ROW][C]56[/C][C]16.6[/C][C]25.3863[/C][C]22.0098[/C][C]30.0716[/C][C]1e-04[/C][C]0.9993[/C][C]0.8409[/C][C]0.9985[/C][/ROW]
[ROW][C]57[/C][C]16.2[/C][C]23.8466[/C][C]20.7658[/C][C]28.0748[/C][C]2e-04[/C][C]0.9996[/C][C]0.8811[/C][C]0.9949[/C][/ROW]
[ROW][C]58[/C][C]18.3[/C][C]26.9553[/C][C]22.9345[/C][C]32.8109[/C][C]0.0019[/C][C]0.9998[/C][C]0.8468[/C][C]0.9981[/C][/ROW]
[ROW][C]59[/C][C]17.6[/C][C]23.6985[/C][C]20.4967[/C][C]28.1689[/C][C]0.0037[/C][C]0.991[/C][C]0.7154[/C][C]0.991[/C][/ROW]
[ROW][C]60[/C][C]15.1[/C][C]19.6777[/C][C]17.404[/C][C]22.68[/C][C]0.0014[/C][C]0.9125[/C][C]0.8158[/C][C]0.8158[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68596&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68596&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])
3617.7-------
3719.8-------
3822.2-------
3920.7-------
4017.9-------
4120.9-------
4221.2-------
4321.4-------
4423-------
4521.3-------
4623.9-------
4722.4-------
4818.3-------
4922.823.444321.240726.190.32280.99990.99540.9999
5022.324.673422.240427.7420.06480.88430.94291
5117.822.920420.716125.68271e-040.67010.94240.9995
5216.421.099319.013923.7312e-040.9930.99140.9815
531622.447620.062525.517800.99990.83840.9959
5416.423.154320.511126.63131e-0410.86470.9969
5517.725.281521.998429.7965e-040.99990.9540.9988
5616.625.386322.009830.07161e-040.99930.84090.9985
5716.223.846620.765828.07482e-040.99960.88110.9949
5818.326.955322.934532.81090.00190.99980.84680.9981
5917.623.698520.496728.16890.00370.9910.71540.991
6015.119.677717.40422.680.00140.91250.81580.8158







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0598-0.02750.00230.41510.03460.186
500.0635-0.09620.0085.63320.46940.6851
510.0615-0.22340.018626.21892.18491.4781
520.0636-0.22270.018622.08341.84031.3566
530.0698-0.28720.023941.57133.46431.8613
540.0766-0.29170.024345.62123.80181.9498
550.0911-0.29990.02557.47924.78992.1886
560.0942-0.34610.028877.19866.43322.5364
570.0905-0.32070.026758.47054.87252.2074
580.1108-0.32110.026874.91466.24292.4986
590.0962-0.25730.021437.19183.09931.7605
600.0778-0.23260.019420.95521.74631.3215

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0598 & -0.0275 & 0.0023 & 0.4151 & 0.0346 & 0.186 \tabularnewline
50 & 0.0635 & -0.0962 & 0.008 & 5.6332 & 0.4694 & 0.6851 \tabularnewline
51 & 0.0615 & -0.2234 & 0.0186 & 26.2189 & 2.1849 & 1.4781 \tabularnewline
52 & 0.0636 & -0.2227 & 0.0186 & 22.0834 & 1.8403 & 1.3566 \tabularnewline
53 & 0.0698 & -0.2872 & 0.0239 & 41.5713 & 3.4643 & 1.8613 \tabularnewline
54 & 0.0766 & -0.2917 & 0.0243 & 45.6212 & 3.8018 & 1.9498 \tabularnewline
55 & 0.0911 & -0.2999 & 0.025 & 57.4792 & 4.7899 & 2.1886 \tabularnewline
56 & 0.0942 & -0.3461 & 0.0288 & 77.1986 & 6.4332 & 2.5364 \tabularnewline
57 & 0.0905 & -0.3207 & 0.0267 & 58.4705 & 4.8725 & 2.2074 \tabularnewline
58 & 0.1108 & -0.3211 & 0.0268 & 74.9146 & 6.2429 & 2.4986 \tabularnewline
59 & 0.0962 & -0.2573 & 0.0214 & 37.1918 & 3.0993 & 1.7605 \tabularnewline
60 & 0.0778 & -0.2326 & 0.0194 & 20.9552 & 1.7463 & 1.3215 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68596&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.0598[/C][C]-0.0275[/C][C]0.0023[/C][C]0.4151[/C][C]0.0346[/C][C]0.186[/C][/ROW]
[ROW][C]50[/C][C]0.0635[/C][C]-0.0962[/C][C]0.008[/C][C]5.6332[/C][C]0.4694[/C][C]0.6851[/C][/ROW]
[ROW][C]51[/C][C]0.0615[/C][C]-0.2234[/C][C]0.0186[/C][C]26.2189[/C][C]2.1849[/C][C]1.4781[/C][/ROW]
[ROW][C]52[/C][C]0.0636[/C][C]-0.2227[/C][C]0.0186[/C][C]22.0834[/C][C]1.8403[/C][C]1.3566[/C][/ROW]
[ROW][C]53[/C][C]0.0698[/C][C]-0.2872[/C][C]0.0239[/C][C]41.5713[/C][C]3.4643[/C][C]1.8613[/C][/ROW]
[ROW][C]54[/C][C]0.0766[/C][C]-0.2917[/C][C]0.0243[/C][C]45.6212[/C][C]3.8018[/C][C]1.9498[/C][/ROW]
[ROW][C]55[/C][C]0.0911[/C][C]-0.2999[/C][C]0.025[/C][C]57.4792[/C][C]4.7899[/C][C]2.1886[/C][/ROW]
[ROW][C]56[/C][C]0.0942[/C][C]-0.3461[/C][C]0.0288[/C][C]77.1986[/C][C]6.4332[/C][C]2.5364[/C][/ROW]
[ROW][C]57[/C][C]0.0905[/C][C]-0.3207[/C][C]0.0267[/C][C]58.4705[/C][C]4.8725[/C][C]2.2074[/C][/ROW]
[ROW][C]58[/C][C]0.1108[/C][C]-0.3211[/C][C]0.0268[/C][C]74.9146[/C][C]6.2429[/C][C]2.4986[/C][/ROW]
[ROW][C]59[/C][C]0.0962[/C][C]-0.2573[/C][C]0.0214[/C][C]37.1918[/C][C]3.0993[/C][C]1.7605[/C][/ROW]
[ROW][C]60[/C][C]0.0778[/C][C]-0.2326[/C][C]0.0194[/C][C]20.9552[/C][C]1.7463[/C][C]1.3215[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68596&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68596&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.0598-0.02750.00230.41510.03460.186
500.0635-0.09620.0085.63320.46940.6851
510.0615-0.22340.018626.21892.18491.4781
520.0636-0.22270.018622.08341.84031.3566
530.0698-0.28720.023941.57133.46431.8613
540.0766-0.29170.024345.62123.80181.9498
550.0911-0.29990.02557.47924.78992.1886
560.0942-0.34610.028877.19866.43322.5364
570.0905-0.32070.026758.47054.87252.2074
580.1108-0.32110.026874.91466.24292.4986
590.0962-0.25730.021437.19183.09931.7605
600.0778-0.23260.019420.95521.74631.3215



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