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, 15 Dec 2010 17:09:58 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/15/t1292432919mqf1u4a0ukf8gtx.htm/, Retrieved Fri, 03 May 2024 10:37:27 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=110588, Retrieved Fri, 03 May 2024 10:37:27 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
- RMP         [Standard Deviation-Mean Plot] [Births] [2010-11-29 10:52:49] [b98453cac15ba1066b407e146608df68]
- RMP           [ARIMA Forecasting] [Births] [2010-11-29 20:53:49] [b98453cac15ba1066b407e146608df68]
-   PD            [ARIMA Forecasting] [ARIMA forecasting] [2010-12-03 07:18:57] [717f3d787904f94c39256c5c1fc72d4c]
-   P                 [ARIMA Forecasting] [arima] [2010-12-15 17:09:58] [c1f1b5e209adb4577289f490325e36f2] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.3031
1.3241
1.2961
1.2865
1.2305
1.2101
1.2125
1.2350
1.2014
1.1992
1.1791
1.1832
1.2159
1.1922
1.2114
1.2614
1.2812
1.2786
1.2772
1.2815
1.2679
1.2765
1.3247
1.3191
1.3029
1.3234
1.3354
1.3651
1.3453
1.3534
1.3706
1.3638
1.4268
1.4485
1.4635
1.4587
1.4876
1.5189
1.5783
1.5633
1.5554
1.5757
1.5593
1.4660
1.4065
1.2759
1.2705
1.3954
1.2793
1.2694
1.3282
1.3230
1.4135
1.4042
1.4253
1.4322
1.4632
1.4713
1.5016
1.4318




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110588&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'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])
361.4587-------
371.4876-------
381.5189-------
391.5783-------
401.5633-------
411.5554-------
421.5757-------
431.5593-------
441.466-------
451.4065-------
461.2759-------
471.2705-------
481.3954-------
491.27931.39541.31821.47260.00160.50.00960.5
501.26941.39541.28621.50460.01180.98140.01330.5
511.32821.39541.26171.52910.16230.96760.00370.5
521.3231.39541.2411.54980.1790.80320.01650.5
531.41351.39541.22281.5680.41860.79450.03460.5
541.40421.39541.20631.58450.46370.42560.03080.5
551.42531.39541.19121.59960.38710.46630.05790.5
561.43221.39541.17711.61370.37060.39420.26310.5
571.46321.39541.16381.6270.2830.37770.46260.5
581.47131.39541.15131.63950.27110.29310.83130.5
591.50161.39541.13941.65140.20810.28060.83050.5
601.43181.39541.1281.66280.39480.21820.50.5

\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 & 1.4587 & - & - & - & - & - & - & - \tabularnewline
37 & 1.4876 & - & - & - & - & - & - & - \tabularnewline
38 & 1.5189 & - & - & - & - & - & - & - \tabularnewline
39 & 1.5783 & - & - & - & - & - & - & - \tabularnewline
40 & 1.5633 & - & - & - & - & - & - & - \tabularnewline
41 & 1.5554 & - & - & - & - & - & - & - \tabularnewline
42 & 1.5757 & - & - & - & - & - & - & - \tabularnewline
43 & 1.5593 & - & - & - & - & - & - & - \tabularnewline
44 & 1.466 & - & - & - & - & - & - & - \tabularnewline
45 & 1.4065 & - & - & - & - & - & - & - \tabularnewline
46 & 1.2759 & - & - & - & - & - & - & - \tabularnewline
47 & 1.2705 & - & - & - & - & - & - & - \tabularnewline
48 & 1.3954 & - & - & - & - & - & - & - \tabularnewline
49 & 1.2793 & 1.3954 & 1.3182 & 1.4726 & 0.0016 & 0.5 & 0.0096 & 0.5 \tabularnewline
50 & 1.2694 & 1.3954 & 1.2862 & 1.5046 & 0.0118 & 0.9814 & 0.0133 & 0.5 \tabularnewline
51 & 1.3282 & 1.3954 & 1.2617 & 1.5291 & 0.1623 & 0.9676 & 0.0037 & 0.5 \tabularnewline
52 & 1.323 & 1.3954 & 1.241 & 1.5498 & 0.179 & 0.8032 & 0.0165 & 0.5 \tabularnewline
53 & 1.4135 & 1.3954 & 1.2228 & 1.568 & 0.4186 & 0.7945 & 0.0346 & 0.5 \tabularnewline
54 & 1.4042 & 1.3954 & 1.2063 & 1.5845 & 0.4637 & 0.4256 & 0.0308 & 0.5 \tabularnewline
55 & 1.4253 & 1.3954 & 1.1912 & 1.5996 & 0.3871 & 0.4663 & 0.0579 & 0.5 \tabularnewline
56 & 1.4322 & 1.3954 & 1.1771 & 1.6137 & 0.3706 & 0.3942 & 0.2631 & 0.5 \tabularnewline
57 & 1.4632 & 1.3954 & 1.1638 & 1.627 & 0.283 & 0.3777 & 0.4626 & 0.5 \tabularnewline
58 & 1.4713 & 1.3954 & 1.1513 & 1.6395 & 0.2711 & 0.2931 & 0.8313 & 0.5 \tabularnewline
59 & 1.5016 & 1.3954 & 1.1394 & 1.6514 & 0.2081 & 0.2806 & 0.8305 & 0.5 \tabularnewline
60 & 1.4318 & 1.3954 & 1.128 & 1.6628 & 0.3948 & 0.2182 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110588&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]1.4587[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1.4876[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1.5189[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1.5783[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1.5633[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1.5554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1.5757[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1.5593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1.466[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1.4065[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1.2759[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1.2705[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1.3954[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1.2793[/C][C]1.3954[/C][C]1.3182[/C][C]1.4726[/C][C]0.0016[/C][C]0.5[/C][C]0.0096[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]1.2694[/C][C]1.3954[/C][C]1.2862[/C][C]1.5046[/C][C]0.0118[/C][C]0.9814[/C][C]0.0133[/C][C]0.5[/C][/ROW]
[ROW][C]51[/C][C]1.3282[/C][C]1.3954[/C][C]1.2617[/C][C]1.5291[/C][C]0.1623[/C][C]0.9676[/C][C]0.0037[/C][C]0.5[/C][/ROW]
[ROW][C]52[/C][C]1.323[/C][C]1.3954[/C][C]1.241[/C][C]1.5498[/C][C]0.179[/C][C]0.8032[/C][C]0.0165[/C][C]0.5[/C][/ROW]
[ROW][C]53[/C][C]1.4135[/C][C]1.3954[/C][C]1.2228[/C][C]1.568[/C][C]0.4186[/C][C]0.7945[/C][C]0.0346[/C][C]0.5[/C][/ROW]
[ROW][C]54[/C][C]1.4042[/C][C]1.3954[/C][C]1.2063[/C][C]1.5845[/C][C]0.4637[/C][C]0.4256[/C][C]0.0308[/C][C]0.5[/C][/ROW]
[ROW][C]55[/C][C]1.4253[/C][C]1.3954[/C][C]1.1912[/C][C]1.5996[/C][C]0.3871[/C][C]0.4663[/C][C]0.0579[/C][C]0.5[/C][/ROW]
[ROW][C]56[/C][C]1.4322[/C][C]1.3954[/C][C]1.1771[/C][C]1.6137[/C][C]0.3706[/C][C]0.3942[/C][C]0.2631[/C][C]0.5[/C][/ROW]
[ROW][C]57[/C][C]1.4632[/C][C]1.3954[/C][C]1.1638[/C][C]1.627[/C][C]0.283[/C][C]0.3777[/C][C]0.4626[/C][C]0.5[/C][/ROW]
[ROW][C]58[/C][C]1.4713[/C][C]1.3954[/C][C]1.1513[/C][C]1.6395[/C][C]0.2711[/C][C]0.2931[/C][C]0.8313[/C][C]0.5[/C][/ROW]
[ROW][C]59[/C][C]1.5016[/C][C]1.3954[/C][C]1.1394[/C][C]1.6514[/C][C]0.2081[/C][C]0.2806[/C][C]0.8305[/C][C]0.5[/C][/ROW]
[ROW][C]60[/C][C]1.4318[/C][C]1.3954[/C][C]1.128[/C][C]1.6628[/C][C]0.3948[/C][C]0.2182[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110588&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110588&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])
361.4587-------
371.4876-------
381.5189-------
391.5783-------
401.5633-------
411.5554-------
421.5757-------
431.5593-------
441.466-------
451.4065-------
461.2759-------
471.2705-------
481.3954-------
491.27931.39541.31821.47260.00160.50.00960.5
501.26941.39541.28621.50460.01180.98140.01330.5
511.32821.39541.26171.52910.16230.96760.00370.5
521.3231.39541.2411.54980.1790.80320.01650.5
531.41351.39541.22281.5680.41860.79450.03460.5
541.40421.39541.20631.58450.46370.42560.03080.5
551.42531.39541.19121.59960.38710.46630.05790.5
561.43221.39541.17711.61370.37060.39420.26310.5
571.46321.39541.16381.6270.2830.37770.46260.5
581.47131.39541.15131.63950.27110.29310.83130.5
591.50161.39541.13941.65140.20810.28060.83050.5
601.43181.39541.1281.66280.39480.21820.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0282-0.083200.013500
500.0399-0.09030.08670.01590.01470.1212
510.0489-0.04820.07390.00450.01130.1063
520.0565-0.05190.06840.00520.00980.0989
530.06310.0130.05733e-040.00790.0888
540.06910.00630.04881e-040.00660.0812
550.07470.02140.04499e-040.00580.076
560.07980.02640.04260.00140.00520.0723
570.08470.04860.04320.00460.00520.0718
580.08930.05440.04440.00580.00520.0722
590.09360.07610.04720.01130.00580.0759
600.09780.02610.04550.00130.00540.0734

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0282 & -0.0832 & 0 & 0.0135 & 0 & 0 \tabularnewline
50 & 0.0399 & -0.0903 & 0.0867 & 0.0159 & 0.0147 & 0.1212 \tabularnewline
51 & 0.0489 & -0.0482 & 0.0739 & 0.0045 & 0.0113 & 0.1063 \tabularnewline
52 & 0.0565 & -0.0519 & 0.0684 & 0.0052 & 0.0098 & 0.0989 \tabularnewline
53 & 0.0631 & 0.013 & 0.0573 & 3e-04 & 0.0079 & 0.0888 \tabularnewline
54 & 0.0691 & 0.0063 & 0.0488 & 1e-04 & 0.0066 & 0.0812 \tabularnewline
55 & 0.0747 & 0.0214 & 0.0449 & 9e-04 & 0.0058 & 0.076 \tabularnewline
56 & 0.0798 & 0.0264 & 0.0426 & 0.0014 & 0.0052 & 0.0723 \tabularnewline
57 & 0.0847 & 0.0486 & 0.0432 & 0.0046 & 0.0052 & 0.0718 \tabularnewline
58 & 0.0893 & 0.0544 & 0.0444 & 0.0058 & 0.0052 & 0.0722 \tabularnewline
59 & 0.0936 & 0.0761 & 0.0472 & 0.0113 & 0.0058 & 0.0759 \tabularnewline
60 & 0.0978 & 0.0261 & 0.0455 & 0.0013 & 0.0054 & 0.0734 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110588&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.0282[/C][C]-0.0832[/C][C]0[/C][C]0.0135[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0399[/C][C]-0.0903[/C][C]0.0867[/C][C]0.0159[/C][C]0.0147[/C][C]0.1212[/C][/ROW]
[ROW][C]51[/C][C]0.0489[/C][C]-0.0482[/C][C]0.0739[/C][C]0.0045[/C][C]0.0113[/C][C]0.1063[/C][/ROW]
[ROW][C]52[/C][C]0.0565[/C][C]-0.0519[/C][C]0.0684[/C][C]0.0052[/C][C]0.0098[/C][C]0.0989[/C][/ROW]
[ROW][C]53[/C][C]0.0631[/C][C]0.013[/C][C]0.0573[/C][C]3e-04[/C][C]0.0079[/C][C]0.0888[/C][/ROW]
[ROW][C]54[/C][C]0.0691[/C][C]0.0063[/C][C]0.0488[/C][C]1e-04[/C][C]0.0066[/C][C]0.0812[/C][/ROW]
[ROW][C]55[/C][C]0.0747[/C][C]0.0214[/C][C]0.0449[/C][C]9e-04[/C][C]0.0058[/C][C]0.076[/C][/ROW]
[ROW][C]56[/C][C]0.0798[/C][C]0.0264[/C][C]0.0426[/C][C]0.0014[/C][C]0.0052[/C][C]0.0723[/C][/ROW]
[ROW][C]57[/C][C]0.0847[/C][C]0.0486[/C][C]0.0432[/C][C]0.0046[/C][C]0.0052[/C][C]0.0718[/C][/ROW]
[ROW][C]58[/C][C]0.0893[/C][C]0.0544[/C][C]0.0444[/C][C]0.0058[/C][C]0.0052[/C][C]0.0722[/C][/ROW]
[ROW][C]59[/C][C]0.0936[/C][C]0.0761[/C][C]0.0472[/C][C]0.0113[/C][C]0.0058[/C][C]0.0759[/C][/ROW]
[ROW][C]60[/C][C]0.0978[/C][C]0.0261[/C][C]0.0455[/C][C]0.0013[/C][C]0.0054[/C][C]0.0734[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110588&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110588&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.0282-0.083200.013500
500.0399-0.09030.08670.01590.01470.1212
510.0489-0.04820.07390.00450.01130.1063
520.0565-0.05190.06840.00520.00980.0989
530.06310.0130.05733e-040.00790.0888
540.06910.00630.04881e-040.00660.0812
550.07470.02140.04499e-040.00580.076
560.07980.02640.04260.00140.00520.0723
570.08470.04860.04320.00460.00520.0718
580.08930.05440.04440.00580.00520.0722
590.09360.07610.04720.01130.00580.0759
600.09780.02610.04550.00130.00540.0734



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