Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 22 Dec 2008 07:05:56 -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/t1229954828p0u6nlvwxkdeo1n.htm/, Retrieved Mon, 13 May 2024 15:18:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36073, Retrieved Mon, 13 May 2024 15:18:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact146
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast BEL-20] [2008-12-22 14:05:56] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2196.72
2350.44
2440.25
2408.64
2472.81
2407.6
2454.62
2448.05
2497.84
2645.64
2756.76
2849.27
2921.44
2981.85
3080.58
3106.22
3119.31
3061.26
3097.31
3161.69
3257.16
3277.01
3295.32
3363.99
3494.17
3667.03
3813.06
3917.96
3895.51
3801.06
3570.12
3701.61
3862.27
3970.1
4138.52
4199.75
4290.89
4443.91
4502.64
4356.98
4591.27
4696.96
4621.4
4562.84
4202.52
4296.49
4435.23
4105.18
4116.68
3844.49
3720.98
3674.4
3857.62
3801.06
3504.37
3032.6
3047.03
2962.34
2197.82
2014.45




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36073&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 time0 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])
364199.75-------
374290.89-------
384443.91-------
394502.64-------
404356.98-------
414591.27-------
424696.96-------
434621.4-------
444562.84-------
454202.52-------
464296.49-------
474435.23-------
484105.18-------
494116.683981.78843741.10144223.93990.13750.1590.00620.159
503844.493981.78843577.81184389.91180.25480.25860.01320.2767
513720.983981.78843464.21424506.19590.16480.69610.02580.3223
523674.43981.78843371.77594601.32480.16540.79530.11760.3481
533857.623981.78843291.89134683.90410.36440.80460.04440.3653
543801.063981.78843220.5714757.92350.32410.62310.03550.3777
553504.373981.78843155.57654825.62110.13370.66270.06870.3872
563032.63981.78843095.50284888.40220.02010.8490.10450.3948
573047.033981.78843039.39954947.21730.02890.9730.3270.4011
582962.343981.78842986.58775002.74510.02520.96360.27290.4064
592197.823981.78842936.56295055.49026e-040.96860.20390.4109
602014.453981.78842888.93795105.83993e-040.99910.41480.4148

\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 & 4199.75 & - & - & - & - & - & - & - \tabularnewline
37 & 4290.89 & - & - & - & - & - & - & - \tabularnewline
38 & 4443.91 & - & - & - & - & - & - & - \tabularnewline
39 & 4502.64 & - & - & - & - & - & - & - \tabularnewline
40 & 4356.98 & - & - & - & - & - & - & - \tabularnewline
41 & 4591.27 & - & - & - & - & - & - & - \tabularnewline
42 & 4696.96 & - & - & - & - & - & - & - \tabularnewline
43 & 4621.4 & - & - & - & - & - & - & - \tabularnewline
44 & 4562.84 & - & - & - & - & - & - & - \tabularnewline
45 & 4202.52 & - & - & - & - & - & - & - \tabularnewline
46 & 4296.49 & - & - & - & - & - & - & - \tabularnewline
47 & 4435.23 & - & - & - & - & - & - & - \tabularnewline
48 & 4105.18 & - & - & - & - & - & - & - \tabularnewline
49 & 4116.68 & 3981.7884 & 3741.1014 & 4223.9399 & 0.1375 & 0.159 & 0.0062 & 0.159 \tabularnewline
50 & 3844.49 & 3981.7884 & 3577.8118 & 4389.9118 & 0.2548 & 0.2586 & 0.0132 & 0.2767 \tabularnewline
51 & 3720.98 & 3981.7884 & 3464.2142 & 4506.1959 & 0.1648 & 0.6961 & 0.0258 & 0.3223 \tabularnewline
52 & 3674.4 & 3981.7884 & 3371.7759 & 4601.3248 & 0.1654 & 0.7953 & 0.1176 & 0.3481 \tabularnewline
53 & 3857.62 & 3981.7884 & 3291.8913 & 4683.9041 & 0.3644 & 0.8046 & 0.0444 & 0.3653 \tabularnewline
54 & 3801.06 & 3981.7884 & 3220.571 & 4757.9235 & 0.3241 & 0.6231 & 0.0355 & 0.3777 \tabularnewline
55 & 3504.37 & 3981.7884 & 3155.5765 & 4825.6211 & 0.1337 & 0.6627 & 0.0687 & 0.3872 \tabularnewline
56 & 3032.6 & 3981.7884 & 3095.5028 & 4888.4022 & 0.0201 & 0.849 & 0.1045 & 0.3948 \tabularnewline
57 & 3047.03 & 3981.7884 & 3039.3995 & 4947.2173 & 0.0289 & 0.973 & 0.327 & 0.4011 \tabularnewline
58 & 2962.34 & 3981.7884 & 2986.5877 & 5002.7451 & 0.0252 & 0.9636 & 0.2729 & 0.4064 \tabularnewline
59 & 2197.82 & 3981.7884 & 2936.5629 & 5055.4902 & 6e-04 & 0.9686 & 0.2039 & 0.4109 \tabularnewline
60 & 2014.45 & 3981.7884 & 2888.9379 & 5105.8399 & 3e-04 & 0.9991 & 0.4148 & 0.4148 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36073&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]4199.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4290.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4443.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4502.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4356.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4591.27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4696.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4621.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4562.84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4202.52[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4296.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4435.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4105.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4116.68[/C][C]3981.7884[/C][C]3741.1014[/C][C]4223.9399[/C][C]0.1375[/C][C]0.159[/C][C]0.0062[/C][C]0.159[/C][/ROW]
[ROW][C]50[/C][C]3844.49[/C][C]3981.7884[/C][C]3577.8118[/C][C]4389.9118[/C][C]0.2548[/C][C]0.2586[/C][C]0.0132[/C][C]0.2767[/C][/ROW]
[ROW][C]51[/C][C]3720.98[/C][C]3981.7884[/C][C]3464.2142[/C][C]4506.1959[/C][C]0.1648[/C][C]0.6961[/C][C]0.0258[/C][C]0.3223[/C][/ROW]
[ROW][C]52[/C][C]3674.4[/C][C]3981.7884[/C][C]3371.7759[/C][C]4601.3248[/C][C]0.1654[/C][C]0.7953[/C][C]0.1176[/C][C]0.3481[/C][/ROW]
[ROW][C]53[/C][C]3857.62[/C][C]3981.7884[/C][C]3291.8913[/C][C]4683.9041[/C][C]0.3644[/C][C]0.8046[/C][C]0.0444[/C][C]0.3653[/C][/ROW]
[ROW][C]54[/C][C]3801.06[/C][C]3981.7884[/C][C]3220.571[/C][C]4757.9235[/C][C]0.3241[/C][C]0.6231[/C][C]0.0355[/C][C]0.3777[/C][/ROW]
[ROW][C]55[/C][C]3504.37[/C][C]3981.7884[/C][C]3155.5765[/C][C]4825.6211[/C][C]0.1337[/C][C]0.6627[/C][C]0.0687[/C][C]0.3872[/C][/ROW]
[ROW][C]56[/C][C]3032.6[/C][C]3981.7884[/C][C]3095.5028[/C][C]4888.4022[/C][C]0.0201[/C][C]0.849[/C][C]0.1045[/C][C]0.3948[/C][/ROW]
[ROW][C]57[/C][C]3047.03[/C][C]3981.7884[/C][C]3039.3995[/C][C]4947.2173[/C][C]0.0289[/C][C]0.973[/C][C]0.327[/C][C]0.4011[/C][/ROW]
[ROW][C]58[/C][C]2962.34[/C][C]3981.7884[/C][C]2986.5877[/C][C]5002.7451[/C][C]0.0252[/C][C]0.9636[/C][C]0.2729[/C][C]0.4064[/C][/ROW]
[ROW][C]59[/C][C]2197.82[/C][C]3981.7884[/C][C]2936.5629[/C][C]5055.4902[/C][C]6e-04[/C][C]0.9686[/C][C]0.2039[/C][C]0.4109[/C][/ROW]
[ROW][C]60[/C][C]2014.45[/C][C]3981.7884[/C][C]2888.9379[/C][C]5105.8399[/C][C]3e-04[/C][C]0.9991[/C][C]0.4148[/C][C]0.4148[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36073&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36073&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])
364199.75-------
374290.89-------
384443.91-------
394502.64-------
404356.98-------
414591.27-------
424696.96-------
434621.4-------
444562.84-------
454202.52-------
464296.49-------
474435.23-------
484105.18-------
494116.683981.78843741.10144223.93990.13750.1590.00620.159
503844.493981.78843577.81184389.91180.25480.25860.01320.2767
513720.983981.78843464.21424506.19590.16480.69610.02580.3223
523674.43981.78843371.77594601.32480.16540.79530.11760.3481
533857.623981.78843291.89134683.90410.36440.80460.04440.3653
543801.063981.78843220.5714757.92350.32410.62310.03550.3777
553504.373981.78843155.57654825.62110.13370.66270.06870.3872
563032.63981.78843095.50284888.40220.02010.8490.10450.3948
573047.033981.78843039.39954947.21730.02890.9730.3270.4011
582962.343981.78842986.58775002.74510.02520.96360.27290.4064
592197.823981.78842936.56295055.49026e-040.96860.20390.4109
602014.453981.78842888.93795105.83993e-040.99910.41480.4148







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0310.03390.002818195.73571516.311338.9398
500.0523-0.03450.002918850.85881570.904939.6346
510.0672-0.06550.005568021.0375668.419775.2889
520.0794-0.07720.006494487.64677873.970688.7354
530.09-0.03120.002615417.79891284.816635.8443
540.0994-0.04540.003832662.76532721.897152.1718
550.1081-0.11990.01227928.35718994.0297137.8188
560.1162-0.23840.0199900958.67575079.8896274.0071
570.1237-0.23480.0196873773.321872814.4435269.8415
580.1308-0.2560.02131039275.100786606.2584294.2894
590.1376-0.4480.03733182543.358265211.9465514.9873
600.144-0.49410.04123870420.4968322535.0414567.9217

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.031 & 0.0339 & 0.0028 & 18195.7357 & 1516.3113 & 38.9398 \tabularnewline
50 & 0.0523 & -0.0345 & 0.0029 & 18850.8588 & 1570.9049 & 39.6346 \tabularnewline
51 & 0.0672 & -0.0655 & 0.0055 & 68021.037 & 5668.4197 & 75.2889 \tabularnewline
52 & 0.0794 & -0.0772 & 0.0064 & 94487.6467 & 7873.9706 & 88.7354 \tabularnewline
53 & 0.09 & -0.0312 & 0.0026 & 15417.7989 & 1284.8166 & 35.8443 \tabularnewline
54 & 0.0994 & -0.0454 & 0.0038 & 32662.7653 & 2721.8971 & 52.1718 \tabularnewline
55 & 0.1081 & -0.1199 & 0.01 & 227928.357 & 18994.0297 & 137.8188 \tabularnewline
56 & 0.1162 & -0.2384 & 0.0199 & 900958.675 & 75079.8896 & 274.0071 \tabularnewline
57 & 0.1237 & -0.2348 & 0.0196 & 873773.3218 & 72814.4435 & 269.8415 \tabularnewline
58 & 0.1308 & -0.256 & 0.0213 & 1039275.1007 & 86606.2584 & 294.2894 \tabularnewline
59 & 0.1376 & -0.448 & 0.0373 & 3182543.358 & 265211.9465 & 514.9873 \tabularnewline
60 & 0.144 & -0.4941 & 0.0412 & 3870420.4968 & 322535.0414 & 567.9217 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36073&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.031[/C][C]0.0339[/C][C]0.0028[/C][C]18195.7357[/C][C]1516.3113[/C][C]38.9398[/C][/ROW]
[ROW][C]50[/C][C]0.0523[/C][C]-0.0345[/C][C]0.0029[/C][C]18850.8588[/C][C]1570.9049[/C][C]39.6346[/C][/ROW]
[ROW][C]51[/C][C]0.0672[/C][C]-0.0655[/C][C]0.0055[/C][C]68021.037[/C][C]5668.4197[/C][C]75.2889[/C][/ROW]
[ROW][C]52[/C][C]0.0794[/C][C]-0.0772[/C][C]0.0064[/C][C]94487.6467[/C][C]7873.9706[/C][C]88.7354[/C][/ROW]
[ROW][C]53[/C][C]0.09[/C][C]-0.0312[/C][C]0.0026[/C][C]15417.7989[/C][C]1284.8166[/C][C]35.8443[/C][/ROW]
[ROW][C]54[/C][C]0.0994[/C][C]-0.0454[/C][C]0.0038[/C][C]32662.7653[/C][C]2721.8971[/C][C]52.1718[/C][/ROW]
[ROW][C]55[/C][C]0.1081[/C][C]-0.1199[/C][C]0.01[/C][C]227928.357[/C][C]18994.0297[/C][C]137.8188[/C][/ROW]
[ROW][C]56[/C][C]0.1162[/C][C]-0.2384[/C][C]0.0199[/C][C]900958.675[/C][C]75079.8896[/C][C]274.0071[/C][/ROW]
[ROW][C]57[/C][C]0.1237[/C][C]-0.2348[/C][C]0.0196[/C][C]873773.3218[/C][C]72814.4435[/C][C]269.8415[/C][/ROW]
[ROW][C]58[/C][C]0.1308[/C][C]-0.256[/C][C]0.0213[/C][C]1039275.1007[/C][C]86606.2584[/C][C]294.2894[/C][/ROW]
[ROW][C]59[/C][C]0.1376[/C][C]-0.448[/C][C]0.0373[/C][C]3182543.358[/C][C]265211.9465[/C][C]514.9873[/C][/ROW]
[ROW][C]60[/C][C]0.144[/C][C]-0.4941[/C][C]0.0412[/C][C]3870420.4968[/C][C]322535.0414[/C][C]567.9217[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36073&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36073&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.0310.03390.002818195.73571516.311338.9398
500.0523-0.03450.002918850.85881570.904939.6346
510.0672-0.06550.005568021.0375668.419775.2889
520.0794-0.07720.006494487.64677873.970688.7354
530.09-0.03120.002615417.79891284.816635.8443
540.0994-0.04540.003832662.76532721.897152.1718
550.1081-0.11990.01227928.35718994.0297137.8188
560.1162-0.23840.0199900958.67575079.8896274.0071
570.1237-0.23480.0196873773.321872814.4435269.8415
580.1308-0.2560.02131039275.100786606.2584294.2894
590.1376-0.4480.03733182543.358265211.9465514.9873
600.144-0.49410.04123870420.4968322535.0414567.9217



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