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, 21 Dec 2008 12:50:13 -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/21/t12298894502dqt3iqeex1r1la.htm/, Retrieved Mon, 29 Apr 2024 14:36:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=35794, Retrieved Mon, 29 Apr 2024 14:36:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact213
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Q1 The Seatbeltlaw] [2007-11-14 19:27:43] [8cd6641b921d30ebe00b648d1481bba0]
F    D  [Multiple Regression] [The Seatbelt Law ...] [2008-11-15 12:00:57] [93834488277b53a4510bfd06084ae13b]
-   PD    [Multiple Regression] [] [2008-11-15 18:50:27] [93834488277b53a4510bfd06084ae13b]
-    D      [Multiple Regression] [Paper - Multiple ...] [2008-12-21 14:45:31] [85841a4a203c2f9589565c024425a91b]
-   PD        [Multiple Regression] [Paper - Multiple ...] [2008-12-21 15:09:11] [85841a4a203c2f9589565c024425a91b]
- RMPD            [ARIMA Forecasting] [Paper - Arima for...] [2008-12-21 19:50:13] [07b7cf1321bc38017c2c7efcf91ca696] [Current]
-   PD              [ARIMA Forecasting] [arima forecast gas] [2008-12-22 17:09:25] [44a98561a4b3e6ab8cd5a857b48b0914]
Feedback Forum

Post a new message
Dataseries X:
20,72
21,45
22,09
21,53
23,35
23,57
26,42
25,21
26,44
29,34
29,40
33,05
28,38
26,01
29,31
30,36
35,75
36,15
34,21
37,91
38,70
42,12
42,16
39,80
37,36
38,35
42,60
41,25
42,16
46,94
47,43
47,06
50,18
50,13
43,23
40,04
40,37
42,21
37,00
39,74
42,68
46,29
46,97
48,73
52,37
50,05
54,04
57,78
64,72
63,41
64,36
66,03
72,14
76,60
86,97
93,48
95,59
81,89
70,55
50,38
36,25




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=35794&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=35794&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35794&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[49])
3740.37-------
3842.21-------
3937-------
4039.74-------
4142.68-------
4246.29-------
4346.97-------
4448.73-------
4552.37-------
4650.05-------
4754.04-------
4857.78-------
4964.72-------
5063.4165.759956.771476.33870.33160.576410.5764
5164.3667.251653.737984.59810.37190.66790.99970.6126
5266.0368.404352.083390.52870.41670.63990.99440.6279
5372.1469.90150.64497.52120.43690.60820.97330.6434
5476.671.153949.601103.46040.37050.47610.93430.6519
5586.9772.67148.6571110.37150.22860.41910.90930.6603
5693.4874.015647.8903116.68290.18560.27590.87730.6653
5795.5975.565447.191123.84830.20810.23350.82680.6701
5881.8976.996146.5853130.68820.42910.24860.83740.673
5970.5578.588646.0308138.29390.39590.45680.78980.6755
6050.3880.102145.5312145.7710.18750.61220.74740.6769
6136.2581.745545.0717153.95640.10840.80270.6780.678

\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[49]) \tabularnewline
37 & 40.37 & - & - & - & - & - & - & - \tabularnewline
38 & 42.21 & - & - & - & - & - & - & - \tabularnewline
39 & 37 & - & - & - & - & - & - & - \tabularnewline
40 & 39.74 & - & - & - & - & - & - & - \tabularnewline
41 & 42.68 & - & - & - & - & - & - & - \tabularnewline
42 & 46.29 & - & - & - & - & - & - & - \tabularnewline
43 & 46.97 & - & - & - & - & - & - & - \tabularnewline
44 & 48.73 & - & - & - & - & - & - & - \tabularnewline
45 & 52.37 & - & - & - & - & - & - & - \tabularnewline
46 & 50.05 & - & - & - & - & - & - & - \tabularnewline
47 & 54.04 & - & - & - & - & - & - & - \tabularnewline
48 & 57.78 & - & - & - & - & - & - & - \tabularnewline
49 & 64.72 & - & - & - & - & - & - & - \tabularnewline
50 & 63.41 & 65.7599 & 56.7714 & 76.3387 & 0.3316 & 0.5764 & 1 & 0.5764 \tabularnewline
51 & 64.36 & 67.2516 & 53.7379 & 84.5981 & 0.3719 & 0.6679 & 0.9997 & 0.6126 \tabularnewline
52 & 66.03 & 68.4043 & 52.0833 & 90.5287 & 0.4167 & 0.6399 & 0.9944 & 0.6279 \tabularnewline
53 & 72.14 & 69.901 & 50.644 & 97.5212 & 0.4369 & 0.6082 & 0.9733 & 0.6434 \tabularnewline
54 & 76.6 & 71.1539 & 49.601 & 103.4604 & 0.3705 & 0.4761 & 0.9343 & 0.6519 \tabularnewline
55 & 86.97 & 72.671 & 48.6571 & 110.3715 & 0.2286 & 0.4191 & 0.9093 & 0.6603 \tabularnewline
56 & 93.48 & 74.0156 & 47.8903 & 116.6829 & 0.1856 & 0.2759 & 0.8773 & 0.6653 \tabularnewline
57 & 95.59 & 75.5654 & 47.191 & 123.8483 & 0.2081 & 0.2335 & 0.8268 & 0.6701 \tabularnewline
58 & 81.89 & 76.9961 & 46.5853 & 130.6882 & 0.4291 & 0.2486 & 0.8374 & 0.673 \tabularnewline
59 & 70.55 & 78.5886 & 46.0308 & 138.2939 & 0.3959 & 0.4568 & 0.7898 & 0.6755 \tabularnewline
60 & 50.38 & 80.1021 & 45.5312 & 145.771 & 0.1875 & 0.6122 & 0.7474 & 0.6769 \tabularnewline
61 & 36.25 & 81.7455 & 45.0717 & 153.9564 & 0.1084 & 0.8027 & 0.678 & 0.678 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35794&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[49])[/C][/ROW]
[ROW][C]37[/C][C]40.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]42.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]39.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]42.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]46.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]46.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]48.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]52.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]50.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]54.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]57.78[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]64.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]63.41[/C][C]65.7599[/C][C]56.7714[/C][C]76.3387[/C][C]0.3316[/C][C]0.5764[/C][C]1[/C][C]0.5764[/C][/ROW]
[ROW][C]51[/C][C]64.36[/C][C]67.2516[/C][C]53.7379[/C][C]84.5981[/C][C]0.3719[/C][C]0.6679[/C][C]0.9997[/C][C]0.6126[/C][/ROW]
[ROW][C]52[/C][C]66.03[/C][C]68.4043[/C][C]52.0833[/C][C]90.5287[/C][C]0.4167[/C][C]0.6399[/C][C]0.9944[/C][C]0.6279[/C][/ROW]
[ROW][C]53[/C][C]72.14[/C][C]69.901[/C][C]50.644[/C][C]97.5212[/C][C]0.4369[/C][C]0.6082[/C][C]0.9733[/C][C]0.6434[/C][/ROW]
[ROW][C]54[/C][C]76.6[/C][C]71.1539[/C][C]49.601[/C][C]103.4604[/C][C]0.3705[/C][C]0.4761[/C][C]0.9343[/C][C]0.6519[/C][/ROW]
[ROW][C]55[/C][C]86.97[/C][C]72.671[/C][C]48.6571[/C][C]110.3715[/C][C]0.2286[/C][C]0.4191[/C][C]0.9093[/C][C]0.6603[/C][/ROW]
[ROW][C]56[/C][C]93.48[/C][C]74.0156[/C][C]47.8903[/C][C]116.6829[/C][C]0.1856[/C][C]0.2759[/C][C]0.8773[/C][C]0.6653[/C][/ROW]
[ROW][C]57[/C][C]95.59[/C][C]75.5654[/C][C]47.191[/C][C]123.8483[/C][C]0.2081[/C][C]0.2335[/C][C]0.8268[/C][C]0.6701[/C][/ROW]
[ROW][C]58[/C][C]81.89[/C][C]76.9961[/C][C]46.5853[/C][C]130.6882[/C][C]0.4291[/C][C]0.2486[/C][C]0.8374[/C][C]0.673[/C][/ROW]
[ROW][C]59[/C][C]70.55[/C][C]78.5886[/C][C]46.0308[/C][C]138.2939[/C][C]0.3959[/C][C]0.4568[/C][C]0.7898[/C][C]0.6755[/C][/ROW]
[ROW][C]60[/C][C]50.38[/C][C]80.1021[/C][C]45.5312[/C][C]145.771[/C][C]0.1875[/C][C]0.6122[/C][C]0.7474[/C][C]0.6769[/C][/ROW]
[ROW][C]61[/C][C]36.25[/C][C]81.7455[/C][C]45.0717[/C][C]153.9564[/C][C]0.1084[/C][C]0.8027[/C][C]0.678[/C][C]0.678[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35794&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35794&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[49])
3740.37-------
3842.21-------
3937-------
4039.74-------
4142.68-------
4246.29-------
4346.97-------
4448.73-------
4552.37-------
4650.05-------
4754.04-------
4857.78-------
4964.72-------
5063.4165.759956.771476.33870.33160.576410.5764
5164.3667.251653.737984.59810.37190.66790.99970.6126
5266.0368.404352.083390.52870.41670.63990.99440.6279
5372.1469.90150.64497.52120.43690.60820.97330.6434
5476.671.153949.601103.46040.37050.47610.93430.6519
5586.9772.67148.6571110.37150.22860.41910.90930.6603
5693.4874.015647.8903116.68290.18560.27590.87730.6653
5795.5975.565447.191123.84830.20810.23350.82680.6701
5881.8976.996146.5853130.68820.42910.24860.83740.673
5970.5578.588646.0308138.29390.39590.45680.78980.6755
6050.3880.102145.5312145.7710.18750.61220.74740.6769
6136.2581.745545.0717153.95640.10840.80270.6780.678







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0821-0.03570.0035.52190.46020.6784
510.1316-0.0430.00368.36140.69680.8347
520.165-0.03470.00295.63750.46980.6854
530.20160.0320.00275.01330.41780.6464
540.23170.07650.006429.65972.47161.5721
550.26470.19680.0164204.462317.03854.1278
560.29410.2630.0219378.86331.57195.6189
570.3260.2650.0221400.985333.41545.7806
580.35580.06360.005323.95041.99591.4128
590.3876-0.10230.008564.61895.38492.3205
600.4183-0.37110.0309883.400973.61678.58
610.4507-0.55660.04642069.8451172.487113.1334

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0821 & -0.0357 & 0.003 & 5.5219 & 0.4602 & 0.6784 \tabularnewline
51 & 0.1316 & -0.043 & 0.0036 & 8.3614 & 0.6968 & 0.8347 \tabularnewline
52 & 0.165 & -0.0347 & 0.0029 & 5.6375 & 0.4698 & 0.6854 \tabularnewline
53 & 0.2016 & 0.032 & 0.0027 & 5.0133 & 0.4178 & 0.6464 \tabularnewline
54 & 0.2317 & 0.0765 & 0.0064 & 29.6597 & 2.4716 & 1.5721 \tabularnewline
55 & 0.2647 & 0.1968 & 0.0164 & 204.4623 & 17.0385 & 4.1278 \tabularnewline
56 & 0.2941 & 0.263 & 0.0219 & 378.863 & 31.5719 & 5.6189 \tabularnewline
57 & 0.326 & 0.265 & 0.0221 & 400.9853 & 33.4154 & 5.7806 \tabularnewline
58 & 0.3558 & 0.0636 & 0.0053 & 23.9504 & 1.9959 & 1.4128 \tabularnewline
59 & 0.3876 & -0.1023 & 0.0085 & 64.6189 & 5.3849 & 2.3205 \tabularnewline
60 & 0.4183 & -0.3711 & 0.0309 & 883.4009 & 73.6167 & 8.58 \tabularnewline
61 & 0.4507 & -0.5566 & 0.0464 & 2069.8451 & 172.4871 & 13.1334 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=35794&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]50[/C][C]0.0821[/C][C]-0.0357[/C][C]0.003[/C][C]5.5219[/C][C]0.4602[/C][C]0.6784[/C][/ROW]
[ROW][C]51[/C][C]0.1316[/C][C]-0.043[/C][C]0.0036[/C][C]8.3614[/C][C]0.6968[/C][C]0.8347[/C][/ROW]
[ROW][C]52[/C][C]0.165[/C][C]-0.0347[/C][C]0.0029[/C][C]5.6375[/C][C]0.4698[/C][C]0.6854[/C][/ROW]
[ROW][C]53[/C][C]0.2016[/C][C]0.032[/C][C]0.0027[/C][C]5.0133[/C][C]0.4178[/C][C]0.6464[/C][/ROW]
[ROW][C]54[/C][C]0.2317[/C][C]0.0765[/C][C]0.0064[/C][C]29.6597[/C][C]2.4716[/C][C]1.5721[/C][/ROW]
[ROW][C]55[/C][C]0.2647[/C][C]0.1968[/C][C]0.0164[/C][C]204.4623[/C][C]17.0385[/C][C]4.1278[/C][/ROW]
[ROW][C]56[/C][C]0.2941[/C][C]0.263[/C][C]0.0219[/C][C]378.863[/C][C]31.5719[/C][C]5.6189[/C][/ROW]
[ROW][C]57[/C][C]0.326[/C][C]0.265[/C][C]0.0221[/C][C]400.9853[/C][C]33.4154[/C][C]5.7806[/C][/ROW]
[ROW][C]58[/C][C]0.3558[/C][C]0.0636[/C][C]0.0053[/C][C]23.9504[/C][C]1.9959[/C][C]1.4128[/C][/ROW]
[ROW][C]59[/C][C]0.3876[/C][C]-0.1023[/C][C]0.0085[/C][C]64.6189[/C][C]5.3849[/C][C]2.3205[/C][/ROW]
[ROW][C]60[/C][C]0.4183[/C][C]-0.3711[/C][C]0.0309[/C][C]883.4009[/C][C]73.6167[/C][C]8.58[/C][/ROW]
[ROW][C]61[/C][C]0.4507[/C][C]-0.5566[/C][C]0.0464[/C][C]2069.8451[/C][C]172.4871[/C][C]13.1334[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=35794&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=35794&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
500.0821-0.03570.0035.52190.46020.6784
510.1316-0.0430.00368.36140.69680.8347
520.165-0.03470.00295.63750.46980.6854
530.20160.0320.00275.01330.41780.6464
540.23170.07650.006429.65972.47161.5721
550.26470.19680.0164204.462317.03854.1278
560.29410.2630.0219378.86331.57195.6189
570.3260.2650.0221400.985333.41545.7806
580.35580.06360.005323.95041.99591.4128
590.3876-0.10230.008564.61895.38492.3205
600.4183-0.37110.0309883.400973.61678.58
610.4507-0.55660.04642069.8451172.487113.1334



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