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 computationTue, 15 Dec 2009 08:40:27 -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/15/t1260891690lrqcyv9leovkjbc.htm/, Retrieved Wed, 08 May 2024 23:48:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67986, Retrieved Wed, 08 May 2024 23:48:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [ARIMA bel20] [2008-12-13 15:32:40] [74be16979710d4c4e7c6647856088456]
F RMP   [ARIMA Forecasting] [] [2008-12-13 15:36:11] [74be16979710d4c4e7c6647856088456]
-  MPD      [ARIMA Forecasting] [] [2009-12-15 15:40:27] [5858ea01c9bd81debbf921a11363ad90] [Current]
-    D        [ARIMA Forecasting] [] [2009-12-15 15:48:35] [2f674a53c3d7aaa1bcf80e66074d3c9b]
-   PD        [ARIMA Forecasting] [paper] [2010-12-25 14:06:37] [960f506a46b790b06fab7ca57984a121]
Feedback Forum

Post a new message
Dataseries X:
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
1862.83
1905.41
1810.99
1670.07
1864.44
2052.02
2029.6
2070.83
2293.41
2443.27
2513.17
2466.92




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67986&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[59])
474105.18-------
484116.68-------
493844.49-------
503720.98-------
513674.4-------
523857.62-------
533801.06-------
543504.37-------
553032.6-------
563047.03-------
572962.34-------
582197.82-------
592014.45-------
601862.831962.25251631.472293.03510.27790.378600.3786
611905.411947.39421408.88452485.90390.43930.620900.4036
621810.991943.16471240.26622646.06310.35620.541900.4212
631670.071941.96071102.26352781.65790.26280.620100.4328
641864.441941.618983.4342899.8020.43730.710700.4408
652052.021941.5204877.70063005.34030.41930.55653e-040.4466
662029.61941.4927781.5483101.43740.44080.42590.00410.4509
672070.831941.4848692.77473190.19490.41960.4450.04340.4544
682293.411941.4825609.90623273.05880.30220.42450.05180.4572
692443.271941.4819531.90123351.06250.24270.31230.07790.4596
702513.171941.4817457.99233424.97110.2250.25370.36740.4616
712466.921941.4816387.59483495.36850.25370.23540.46330.4633

\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[59]) \tabularnewline
47 & 4105.18 & - & - & - & - & - & - & - \tabularnewline
48 & 4116.68 & - & - & - & - & - & - & - \tabularnewline
49 & 3844.49 & - & - & - & - & - & - & - \tabularnewline
50 & 3720.98 & - & - & - & - & - & - & - \tabularnewline
51 & 3674.4 & - & - & - & - & - & - & - \tabularnewline
52 & 3857.62 & - & - & - & - & - & - & - \tabularnewline
53 & 3801.06 & - & - & - & - & - & - & - \tabularnewline
54 & 3504.37 & - & - & - & - & - & - & - \tabularnewline
55 & 3032.6 & - & - & - & - & - & - & - \tabularnewline
56 & 3047.03 & - & - & - & - & - & - & - \tabularnewline
57 & 2962.34 & - & - & - & - & - & - & - \tabularnewline
58 & 2197.82 & - & - & - & - & - & - & - \tabularnewline
59 & 2014.45 & - & - & - & - & - & - & - \tabularnewline
60 & 1862.83 & 1962.2525 & 1631.47 & 2293.0351 & 0.2779 & 0.3786 & 0 & 0.3786 \tabularnewline
61 & 1905.41 & 1947.3942 & 1408.8845 & 2485.9039 & 0.4393 & 0.6209 & 0 & 0.4036 \tabularnewline
62 & 1810.99 & 1943.1647 & 1240.2662 & 2646.0631 & 0.3562 & 0.5419 & 0 & 0.4212 \tabularnewline
63 & 1670.07 & 1941.9607 & 1102.2635 & 2781.6579 & 0.2628 & 0.6201 & 0 & 0.4328 \tabularnewline
64 & 1864.44 & 1941.618 & 983.434 & 2899.802 & 0.4373 & 0.7107 & 0 & 0.4408 \tabularnewline
65 & 2052.02 & 1941.5204 & 877.7006 & 3005.3403 & 0.4193 & 0.5565 & 3e-04 & 0.4466 \tabularnewline
66 & 2029.6 & 1941.4927 & 781.548 & 3101.4374 & 0.4408 & 0.4259 & 0.0041 & 0.4509 \tabularnewline
67 & 2070.83 & 1941.4848 & 692.7747 & 3190.1949 & 0.4196 & 0.445 & 0.0434 & 0.4544 \tabularnewline
68 & 2293.41 & 1941.4825 & 609.9062 & 3273.0588 & 0.3022 & 0.4245 & 0.0518 & 0.4572 \tabularnewline
69 & 2443.27 & 1941.4819 & 531.9012 & 3351.0625 & 0.2427 & 0.3123 & 0.0779 & 0.4596 \tabularnewline
70 & 2513.17 & 1941.4817 & 457.9923 & 3424.9711 & 0.225 & 0.2537 & 0.3674 & 0.4616 \tabularnewline
71 & 2466.92 & 1941.4816 & 387.5948 & 3495.3685 & 0.2537 & 0.2354 & 0.4633 & 0.4633 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67986&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[59])[/C][/ROW]
[ROW][C]47[/C][C]4105.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4116.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3844.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3720.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]3674.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]3857.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]3801.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]3504.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]3032.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]3047.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]2962.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]2197.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]2014.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]1862.83[/C][C]1962.2525[/C][C]1631.47[/C][C]2293.0351[/C][C]0.2779[/C][C]0.3786[/C][C]0[/C][C]0.3786[/C][/ROW]
[ROW][C]61[/C][C]1905.41[/C][C]1947.3942[/C][C]1408.8845[/C][C]2485.9039[/C][C]0.4393[/C][C]0.6209[/C][C]0[/C][C]0.4036[/C][/ROW]
[ROW][C]62[/C][C]1810.99[/C][C]1943.1647[/C][C]1240.2662[/C][C]2646.0631[/C][C]0.3562[/C][C]0.5419[/C][C]0[/C][C]0.4212[/C][/ROW]
[ROW][C]63[/C][C]1670.07[/C][C]1941.9607[/C][C]1102.2635[/C][C]2781.6579[/C][C]0.2628[/C][C]0.6201[/C][C]0[/C][C]0.4328[/C][/ROW]
[ROW][C]64[/C][C]1864.44[/C][C]1941.618[/C][C]983.434[/C][C]2899.802[/C][C]0.4373[/C][C]0.7107[/C][C]0[/C][C]0.4408[/C][/ROW]
[ROW][C]65[/C][C]2052.02[/C][C]1941.5204[/C][C]877.7006[/C][C]3005.3403[/C][C]0.4193[/C][C]0.5565[/C][C]3e-04[/C][C]0.4466[/C][/ROW]
[ROW][C]66[/C][C]2029.6[/C][C]1941.4927[/C][C]781.548[/C][C]3101.4374[/C][C]0.4408[/C][C]0.4259[/C][C]0.0041[/C][C]0.4509[/C][/ROW]
[ROW][C]67[/C][C]2070.83[/C][C]1941.4848[/C][C]692.7747[/C][C]3190.1949[/C][C]0.4196[/C][C]0.445[/C][C]0.0434[/C][C]0.4544[/C][/ROW]
[ROW][C]68[/C][C]2293.41[/C][C]1941.4825[/C][C]609.9062[/C][C]3273.0588[/C][C]0.3022[/C][C]0.4245[/C][C]0.0518[/C][C]0.4572[/C][/ROW]
[ROW][C]69[/C][C]2443.27[/C][C]1941.4819[/C][C]531.9012[/C][C]3351.0625[/C][C]0.2427[/C][C]0.3123[/C][C]0.0779[/C][C]0.4596[/C][/ROW]
[ROW][C]70[/C][C]2513.17[/C][C]1941.4817[/C][C]457.9923[/C][C]3424.9711[/C][C]0.225[/C][C]0.2537[/C][C]0.3674[/C][C]0.4616[/C][/ROW]
[ROW][C]71[/C][C]2466.92[/C][C]1941.4816[/C][C]387.5948[/C][C]3495.3685[/C][C]0.2537[/C][C]0.2354[/C][C]0.4633[/C][C]0.4633[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67986&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67986&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[59])
474105.18-------
484116.68-------
493844.49-------
503720.98-------
513674.4-------
523857.62-------
533801.06-------
543504.37-------
553032.6-------
563047.03-------
572962.34-------
582197.82-------
592014.45-------
601862.831962.25251631.472293.03510.27790.378600.3786
611905.411947.39421408.88452485.90390.43930.620900.4036
621810.991943.16471240.26622646.06310.35620.541900.4212
631670.071941.96071102.26352781.65790.26280.620100.4328
641864.441941.618983.4342899.8020.43730.710700.4408
652052.021941.5204877.70063005.34030.41930.55653e-040.4466
662029.61941.4927781.5483101.43740.44080.42590.00410.4509
672070.831941.4848692.77473190.19490.41960.4450.04340.4544
682293.411941.4825609.90623273.05880.30220.42450.05180.4572
692443.271941.4819531.90123351.06250.24270.31230.07790.4596
702513.171941.4817457.99233424.97110.2250.25370.36740.4616
712466.921941.4816387.59483495.36850.25370.23540.46330.4633







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
600.086-0.05070.00429884.8421823.736828.7008
610.1411-0.02160.00181762.673146.889412.1198
620.1846-0.0680.005717470.14481455.845438.1555
630.2206-0.140.011773924.56046160.3878.4881
640.2518-0.03970.00335956.4435496.370322.2794
650.27960.05690.004712210.15221017.512731.8985
660.30480.04540.00387762.9011646.908425.4344
670.32810.06660.005616730.18911394.182437.3388
680.34990.18130.0151123852.952910321.0794101.5927
690.37040.25850.0215251791.320420982.61144.8538
700.38980.29450.0245326827.518427235.6265165.0322
710.40830.27060.0226276085.467223007.1223151.681

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
60 & 0.086 & -0.0507 & 0.0042 & 9884.8421 & 823.7368 & 28.7008 \tabularnewline
61 & 0.1411 & -0.0216 & 0.0018 & 1762.673 & 146.8894 & 12.1198 \tabularnewline
62 & 0.1846 & -0.068 & 0.0057 & 17470.1448 & 1455.8454 & 38.1555 \tabularnewline
63 & 0.2206 & -0.14 & 0.0117 & 73924.5604 & 6160.38 & 78.4881 \tabularnewline
64 & 0.2518 & -0.0397 & 0.0033 & 5956.4435 & 496.3703 & 22.2794 \tabularnewline
65 & 0.2796 & 0.0569 & 0.0047 & 12210.1522 & 1017.5127 & 31.8985 \tabularnewline
66 & 0.3048 & 0.0454 & 0.0038 & 7762.9011 & 646.9084 & 25.4344 \tabularnewline
67 & 0.3281 & 0.0666 & 0.0056 & 16730.1891 & 1394.1824 & 37.3388 \tabularnewline
68 & 0.3499 & 0.1813 & 0.0151 & 123852.9529 & 10321.0794 & 101.5927 \tabularnewline
69 & 0.3704 & 0.2585 & 0.0215 & 251791.3204 & 20982.61 & 144.8538 \tabularnewline
70 & 0.3898 & 0.2945 & 0.0245 & 326827.5184 & 27235.6265 & 165.0322 \tabularnewline
71 & 0.4083 & 0.2706 & 0.0226 & 276085.4672 & 23007.1223 & 151.681 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67986&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]60[/C][C]0.086[/C][C]-0.0507[/C][C]0.0042[/C][C]9884.8421[/C][C]823.7368[/C][C]28.7008[/C][/ROW]
[ROW][C]61[/C][C]0.1411[/C][C]-0.0216[/C][C]0.0018[/C][C]1762.673[/C][C]146.8894[/C][C]12.1198[/C][/ROW]
[ROW][C]62[/C][C]0.1846[/C][C]-0.068[/C][C]0.0057[/C][C]17470.1448[/C][C]1455.8454[/C][C]38.1555[/C][/ROW]
[ROW][C]63[/C][C]0.2206[/C][C]-0.14[/C][C]0.0117[/C][C]73924.5604[/C][C]6160.38[/C][C]78.4881[/C][/ROW]
[ROW][C]64[/C][C]0.2518[/C][C]-0.0397[/C][C]0.0033[/C][C]5956.4435[/C][C]496.3703[/C][C]22.2794[/C][/ROW]
[ROW][C]65[/C][C]0.2796[/C][C]0.0569[/C][C]0.0047[/C][C]12210.1522[/C][C]1017.5127[/C][C]31.8985[/C][/ROW]
[ROW][C]66[/C][C]0.3048[/C][C]0.0454[/C][C]0.0038[/C][C]7762.9011[/C][C]646.9084[/C][C]25.4344[/C][/ROW]
[ROW][C]67[/C][C]0.3281[/C][C]0.0666[/C][C]0.0056[/C][C]16730.1891[/C][C]1394.1824[/C][C]37.3388[/C][/ROW]
[ROW][C]68[/C][C]0.3499[/C][C]0.1813[/C][C]0.0151[/C][C]123852.9529[/C][C]10321.0794[/C][C]101.5927[/C][/ROW]
[ROW][C]69[/C][C]0.3704[/C][C]0.2585[/C][C]0.0215[/C][C]251791.3204[/C][C]20982.61[/C][C]144.8538[/C][/ROW]
[ROW][C]70[/C][C]0.3898[/C][C]0.2945[/C][C]0.0245[/C][C]326827.5184[/C][C]27235.6265[/C][C]165.0322[/C][/ROW]
[ROW][C]71[/C][C]0.4083[/C][C]0.2706[/C][C]0.0226[/C][C]276085.4672[/C][C]23007.1223[/C][C]151.681[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67986&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67986&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
600.086-0.05070.00429884.8421823.736828.7008
610.1411-0.02160.00181762.673146.889412.1198
620.1846-0.0680.005717470.14481455.845438.1555
630.2206-0.140.011773924.56046160.3878.4881
640.2518-0.03970.00335956.4435496.370322.2794
650.27960.05690.004712210.15221017.512731.8985
660.30480.04540.00387762.9011646.908425.4344
670.32810.06660.005616730.18911394.182437.3388
680.34990.18130.0151123852.952910321.0794101.5927
690.37040.25850.0215251791.320420982.61144.8538
700.38980.29450.0245326827.518427235.6265165.0322
710.40830.27060.0226276085.467223007.1223151.681



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