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 computationMon, 22 Dec 2008 10:09:25 -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/22/t1229965823uuyctehkkxne64u.htm/, Retrieved Mon, 29 Apr 2024 10:48:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36150, Retrieved Mon, 29 Apr 2024 10:48:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact239
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] [85841a4a203c2f9589565c024425a91b]
-   PD              [ARIMA Forecasting] [arima forecast gas] [2008-12-22 17:09:25] [1aceffc2fa350402d9e8f8edd757a2e8] [Current]
Feedback Forum

Post a new message
Dataseries X:
127.96
127.47
126.47
125.75
125.42
125.14
125.15
125.51
125.63
126.22
126.88
127.96
128.74
129.6
131.2
132.72
134.67
135.94
136.39
136.74
137.2
137.36
138.63
141.07
143.32
147.91
152.56
151.61
156.56
157.45
158.13
159.18
159.47
159.79
161.65
162.77
163.48
166.16
163.86
162.12
149.08
145.32
141.21
134.68
133.65
139.17
138.61
144.96
157.99
167.18
174.48
182.77
190.00
189.70
188.90
198.28
201.18
204.14
221.02
221.12
220.68




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36150&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36150&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36150&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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])
37163.48-------
38166.16-------
39163.86-------
40162.12-------
41149.08-------
42145.32-------
43141.21-------
44134.68-------
45133.65-------
46139.17-------
47138.61-------
48144.96-------
49157.99-------
50167.18163.7953158.0931169.49760.12230.9770.20820.977
51174.48170.572160.2991180.84490.22790.74120.89980.9918
52182.77177.5517162.8329192.27050.24360.65870.98010.9954
53190185.5764165.8787205.27420.32990.610.99990.997
54189.7190.7412166.1201215.36230.4670.52350.99990.9954
55188.9195.4575165.9617224.95330.33150.6490.99980.9936
56198.28200.1856165.8448234.52650.45670.74030.99990.992
57201.18202.9429163.8731242.01270.46480.59250.99970.9879
58204.14203.339159.6551247.02290.48570.53860.9980.9791
59221.02205.0467156.8705253.22290.25790.51470.99660.9722
60221.12204.4511151.9159256.98630.2670.26820.98680.9585
61220.68201.6585144.8952258.42180.25570.25080.93420.9342

\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 & 163.48 & - & - & - & - & - & - & - \tabularnewline
38 & 166.16 & - & - & - & - & - & - & - \tabularnewline
39 & 163.86 & - & - & - & - & - & - & - \tabularnewline
40 & 162.12 & - & - & - & - & - & - & - \tabularnewline
41 & 149.08 & - & - & - & - & - & - & - \tabularnewline
42 & 145.32 & - & - & - & - & - & - & - \tabularnewline
43 & 141.21 & - & - & - & - & - & - & - \tabularnewline
44 & 134.68 & - & - & - & - & - & - & - \tabularnewline
45 & 133.65 & - & - & - & - & - & - & - \tabularnewline
46 & 139.17 & - & - & - & - & - & - & - \tabularnewline
47 & 138.61 & - & - & - & - & - & - & - \tabularnewline
48 & 144.96 & - & - & - & - & - & - & - \tabularnewline
49 & 157.99 & - & - & - & - & - & - & - \tabularnewline
50 & 167.18 & 163.7953 & 158.0931 & 169.4976 & 0.1223 & 0.977 & 0.2082 & 0.977 \tabularnewline
51 & 174.48 & 170.572 & 160.2991 & 180.8449 & 0.2279 & 0.7412 & 0.8998 & 0.9918 \tabularnewline
52 & 182.77 & 177.5517 & 162.8329 & 192.2705 & 0.2436 & 0.6587 & 0.9801 & 0.9954 \tabularnewline
53 & 190 & 185.5764 & 165.8787 & 205.2742 & 0.3299 & 0.61 & 0.9999 & 0.997 \tabularnewline
54 & 189.7 & 190.7412 & 166.1201 & 215.3623 & 0.467 & 0.5235 & 0.9999 & 0.9954 \tabularnewline
55 & 188.9 & 195.4575 & 165.9617 & 224.9533 & 0.3315 & 0.649 & 0.9998 & 0.9936 \tabularnewline
56 & 198.28 & 200.1856 & 165.8448 & 234.5265 & 0.4567 & 0.7403 & 0.9999 & 0.992 \tabularnewline
57 & 201.18 & 202.9429 & 163.8731 & 242.0127 & 0.4648 & 0.5925 & 0.9997 & 0.9879 \tabularnewline
58 & 204.14 & 203.339 & 159.6551 & 247.0229 & 0.4857 & 0.5386 & 0.998 & 0.9791 \tabularnewline
59 & 221.02 & 205.0467 & 156.8705 & 253.2229 & 0.2579 & 0.5147 & 0.9966 & 0.9722 \tabularnewline
60 & 221.12 & 204.4511 & 151.9159 & 256.9863 & 0.267 & 0.2682 & 0.9868 & 0.9585 \tabularnewline
61 & 220.68 & 201.6585 & 144.8952 & 258.4218 & 0.2557 & 0.2508 & 0.9342 & 0.9342 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36150&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]163.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]166.16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]163.86[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]162.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]149.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]145.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]141.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]134.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]133.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]139.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]138.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]144.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]157.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]167.18[/C][C]163.7953[/C][C]158.0931[/C][C]169.4976[/C][C]0.1223[/C][C]0.977[/C][C]0.2082[/C][C]0.977[/C][/ROW]
[ROW][C]51[/C][C]174.48[/C][C]170.572[/C][C]160.2991[/C][C]180.8449[/C][C]0.2279[/C][C]0.7412[/C][C]0.8998[/C][C]0.9918[/C][/ROW]
[ROW][C]52[/C][C]182.77[/C][C]177.5517[/C][C]162.8329[/C][C]192.2705[/C][C]0.2436[/C][C]0.6587[/C][C]0.9801[/C][C]0.9954[/C][/ROW]
[ROW][C]53[/C][C]190[/C][C]185.5764[/C][C]165.8787[/C][C]205.2742[/C][C]0.3299[/C][C]0.61[/C][C]0.9999[/C][C]0.997[/C][/ROW]
[ROW][C]54[/C][C]189.7[/C][C]190.7412[/C][C]166.1201[/C][C]215.3623[/C][C]0.467[/C][C]0.5235[/C][C]0.9999[/C][C]0.9954[/C][/ROW]
[ROW][C]55[/C][C]188.9[/C][C]195.4575[/C][C]165.9617[/C][C]224.9533[/C][C]0.3315[/C][C]0.649[/C][C]0.9998[/C][C]0.9936[/C][/ROW]
[ROW][C]56[/C][C]198.28[/C][C]200.1856[/C][C]165.8448[/C][C]234.5265[/C][C]0.4567[/C][C]0.7403[/C][C]0.9999[/C][C]0.992[/C][/ROW]
[ROW][C]57[/C][C]201.18[/C][C]202.9429[/C][C]163.8731[/C][C]242.0127[/C][C]0.4648[/C][C]0.5925[/C][C]0.9997[/C][C]0.9879[/C][/ROW]
[ROW][C]58[/C][C]204.14[/C][C]203.339[/C][C]159.6551[/C][C]247.0229[/C][C]0.4857[/C][C]0.5386[/C][C]0.998[/C][C]0.9791[/C][/ROW]
[ROW][C]59[/C][C]221.02[/C][C]205.0467[/C][C]156.8705[/C][C]253.2229[/C][C]0.2579[/C][C]0.5147[/C][C]0.9966[/C][C]0.9722[/C][/ROW]
[ROW][C]60[/C][C]221.12[/C][C]204.4511[/C][C]151.9159[/C][C]256.9863[/C][C]0.267[/C][C]0.2682[/C][C]0.9868[/C][C]0.9585[/C][/ROW]
[ROW][C]61[/C][C]220.68[/C][C]201.6585[/C][C]144.8952[/C][C]258.4218[/C][C]0.2557[/C][C]0.2508[/C][C]0.9342[/C][C]0.9342[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36150&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36150&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])
37163.48-------
38166.16-------
39163.86-------
40162.12-------
41149.08-------
42145.32-------
43141.21-------
44134.68-------
45133.65-------
46139.17-------
47138.61-------
48144.96-------
49157.99-------
50167.18163.7953158.0931169.49760.12230.9770.20820.977
51174.48170.572160.2991180.84490.22790.74120.89980.9918
52182.77177.5517162.8329192.27050.24360.65870.98010.9954
53190185.5764165.8787205.27420.32990.610.99990.997
54189.7190.7412166.1201215.36230.4670.52350.99990.9954
55188.9195.4575165.9617224.95330.33150.6490.99980.9936
56198.28200.1856165.8448234.52650.45670.74030.99990.992
57201.18202.9429163.8731242.01270.46480.59250.99970.9879
58204.14203.339159.6551247.02290.48570.53860.9980.9791
59221.02205.0467156.8705253.22290.25790.51470.99660.9722
60221.12204.4511151.9159256.98630.2670.26820.98680.9585
61220.68201.6585144.8952258.42180.25570.25080.93420.9342







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.01780.02070.001711.45610.95470.9771
510.03070.02290.001915.27251.27271.1281
520.04230.02940.002427.23072.26921.5064
530.05420.02380.00219.56781.63071.277
540.0659-0.00555e-041.08410.09030.3006
550.077-0.03350.002843.00073.58341.893
560.0875-0.00958e-043.63140.30260.5501
570.0982-0.00877e-043.10780.2590.5089
580.10960.00393e-040.64160.05350.2312
590.11990.07790.0065255.146121.26224.6111
600.13110.08150.0068277.852723.15444.8119
610.14360.09430.0079361.816830.15145.491

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0178 & 0.0207 & 0.0017 & 11.4561 & 0.9547 & 0.9771 \tabularnewline
51 & 0.0307 & 0.0229 & 0.0019 & 15.2725 & 1.2727 & 1.1281 \tabularnewline
52 & 0.0423 & 0.0294 & 0.0024 & 27.2307 & 2.2692 & 1.5064 \tabularnewline
53 & 0.0542 & 0.0238 & 0.002 & 19.5678 & 1.6307 & 1.277 \tabularnewline
54 & 0.0659 & -0.0055 & 5e-04 & 1.0841 & 0.0903 & 0.3006 \tabularnewline
55 & 0.077 & -0.0335 & 0.0028 & 43.0007 & 3.5834 & 1.893 \tabularnewline
56 & 0.0875 & -0.0095 & 8e-04 & 3.6314 & 0.3026 & 0.5501 \tabularnewline
57 & 0.0982 & -0.0087 & 7e-04 & 3.1078 & 0.259 & 0.5089 \tabularnewline
58 & 0.1096 & 0.0039 & 3e-04 & 0.6416 & 0.0535 & 0.2312 \tabularnewline
59 & 0.1199 & 0.0779 & 0.0065 & 255.1461 & 21.2622 & 4.6111 \tabularnewline
60 & 0.1311 & 0.0815 & 0.0068 & 277.8527 & 23.1544 & 4.8119 \tabularnewline
61 & 0.1436 & 0.0943 & 0.0079 & 361.8168 & 30.1514 & 5.491 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36150&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.0178[/C][C]0.0207[/C][C]0.0017[/C][C]11.4561[/C][C]0.9547[/C][C]0.9771[/C][/ROW]
[ROW][C]51[/C][C]0.0307[/C][C]0.0229[/C][C]0.0019[/C][C]15.2725[/C][C]1.2727[/C][C]1.1281[/C][/ROW]
[ROW][C]52[/C][C]0.0423[/C][C]0.0294[/C][C]0.0024[/C][C]27.2307[/C][C]2.2692[/C][C]1.5064[/C][/ROW]
[ROW][C]53[/C][C]0.0542[/C][C]0.0238[/C][C]0.002[/C][C]19.5678[/C][C]1.6307[/C][C]1.277[/C][/ROW]
[ROW][C]54[/C][C]0.0659[/C][C]-0.0055[/C][C]5e-04[/C][C]1.0841[/C][C]0.0903[/C][C]0.3006[/C][/ROW]
[ROW][C]55[/C][C]0.077[/C][C]-0.0335[/C][C]0.0028[/C][C]43.0007[/C][C]3.5834[/C][C]1.893[/C][/ROW]
[ROW][C]56[/C][C]0.0875[/C][C]-0.0095[/C][C]8e-04[/C][C]3.6314[/C][C]0.3026[/C][C]0.5501[/C][/ROW]
[ROW][C]57[/C][C]0.0982[/C][C]-0.0087[/C][C]7e-04[/C][C]3.1078[/C][C]0.259[/C][C]0.5089[/C][/ROW]
[ROW][C]58[/C][C]0.1096[/C][C]0.0039[/C][C]3e-04[/C][C]0.6416[/C][C]0.0535[/C][C]0.2312[/C][/ROW]
[ROW][C]59[/C][C]0.1199[/C][C]0.0779[/C][C]0.0065[/C][C]255.1461[/C][C]21.2622[/C][C]4.6111[/C][/ROW]
[ROW][C]60[/C][C]0.1311[/C][C]0.0815[/C][C]0.0068[/C][C]277.8527[/C][C]23.1544[/C][C]4.8119[/C][/ROW]
[ROW][C]61[/C][C]0.1436[/C][C]0.0943[/C][C]0.0079[/C][C]361.8168[/C][C]30.1514[/C][C]5.491[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36150&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36150&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.01780.02070.001711.45610.95470.9771
510.03070.02290.001915.27251.27271.1281
520.04230.02940.002427.23072.26921.5064
530.05420.02380.00219.56781.63071.277
540.0659-0.00555e-041.08410.09030.3006
550.077-0.03350.002843.00073.58341.893
560.0875-0.00958e-043.63140.30260.5501
570.0982-0.00877e-043.10780.2590.5089
580.10960.00393e-040.64160.05350.2312
590.11990.07790.0065255.146121.26224.6111
600.13110.08150.0068277.852723.15444.8119
610.14360.09430.0079361.816830.15145.491



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