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, 21 Dec 2009 14:30:51 -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/21/t1261431083rt14l7xg60a3qq3.htm/, Retrieved Sun, 05 May 2024 14:09:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70398, Retrieved Sun, 05 May 2024 14:09:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact97
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
F RMPD  [Univariate Explorative Data Analysis] [Colombia Coffee] [2008-01-07 14:21:11] [74be16979710d4c4e7c6647856088456]
F RMPD    [Univariate Data Series] [] [2009-10-14 08:30:28] [74be16979710d4c4e7c6647856088456]
- RMPD        [ARIMA Forecasting] [Paper] [2009-12-21 21:30:51] [e339dd08bcbfc073ac7494f09a949034] [Current]
Feedback Forum

Post a new message
Dataseries X:
22,4
21,3
20,3
19,3
18,7
21
24
24,8
24,2
23,3
22,7
22,3
21,8
21,2
20,5
19,7
19,2
21,2
23,9
24,8
24,2
23
22,2
21,8
21,2
20,5
19,7
19
18,4
20,7
24,5
26
25,2
24,1
23,7
23,5
23,1
22,7
22,5
21,7
20,5
21,9
22,9
21,5
19
17
16,1
15,9
15,7
15,1
14,8
14,3
14,5
18,9
21,6
20,4
17,9
15,7
14,5
14




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70398&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'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[48])
3623.5-------
3723.1-------
3822.7-------
3922.5-------
4021.7-------
4120.5-------
4221.9-------
4322.9-------
4421.5-------
4519-------
4617-------
4716.1-------
4815.9-------
4915.715.699914.907316.49240.49990.310300.3103
5015.115.379213.232617.52570.39940.384800.3172
5114.815.109811.406918.81270.43490.502100.3379
5214.314.59879.119320.07810.45750.47130.00550.3208
5314.513.92636.44121.41150.44030.4610.04260.3026
5418.915.99846.312225.68470.27860.61910.11620.5079
5521.618.59796.533330.66260.31290.48040.24230.6694
5620.418.8464.235433.45660.41740.35590.36090.6537
5717.917.40910.095834.72240.47780.36750.42850.5678
5815.716.0824-4.081636.24650.48520.42990.46450.5071
5914.515.6609-7.494638.81640.46090.49870.48520.4919
601415.6957-10.585841.97720.44970.53550.49390.4939

\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 & 23.5 & - & - & - & - & - & - & - \tabularnewline
37 & 23.1 & - & - & - & - & - & - & - \tabularnewline
38 & 22.7 & - & - & - & - & - & - & - \tabularnewline
39 & 22.5 & - & - & - & - & - & - & - \tabularnewline
40 & 21.7 & - & - & - & - & - & - & - \tabularnewline
41 & 20.5 & - & - & - & - & - & - & - \tabularnewline
42 & 21.9 & - & - & - & - & - & - & - \tabularnewline
43 & 22.9 & - & - & - & - & - & - & - \tabularnewline
44 & 21.5 & - & - & - & - & - & - & - \tabularnewline
45 & 19 & - & - & - & - & - & - & - \tabularnewline
46 & 17 & - & - & - & - & - & - & - \tabularnewline
47 & 16.1 & - & - & - & - & - & - & - \tabularnewline
48 & 15.9 & - & - & - & - & - & - & - \tabularnewline
49 & 15.7 & 15.6999 & 14.9073 & 16.4924 & 0.4999 & 0.3103 & 0 & 0.3103 \tabularnewline
50 & 15.1 & 15.3792 & 13.2326 & 17.5257 & 0.3994 & 0.3848 & 0 & 0.3172 \tabularnewline
51 & 14.8 & 15.1098 & 11.4069 & 18.8127 & 0.4349 & 0.5021 & 0 & 0.3379 \tabularnewline
52 & 14.3 & 14.5987 & 9.1193 & 20.0781 & 0.4575 & 0.4713 & 0.0055 & 0.3208 \tabularnewline
53 & 14.5 & 13.9263 & 6.441 & 21.4115 & 0.4403 & 0.461 & 0.0426 & 0.3026 \tabularnewline
54 & 18.9 & 15.9984 & 6.3122 & 25.6847 & 0.2786 & 0.6191 & 0.1162 & 0.5079 \tabularnewline
55 & 21.6 & 18.5979 & 6.5333 & 30.6626 & 0.3129 & 0.4804 & 0.2423 & 0.6694 \tabularnewline
56 & 20.4 & 18.846 & 4.2354 & 33.4566 & 0.4174 & 0.3559 & 0.3609 & 0.6537 \tabularnewline
57 & 17.9 & 17.4091 & 0.0958 & 34.7224 & 0.4778 & 0.3675 & 0.4285 & 0.5678 \tabularnewline
58 & 15.7 & 16.0824 & -4.0816 & 36.2465 & 0.4852 & 0.4299 & 0.4645 & 0.5071 \tabularnewline
59 & 14.5 & 15.6609 & -7.4946 & 38.8164 & 0.4609 & 0.4987 & 0.4852 & 0.4919 \tabularnewline
60 & 14 & 15.6957 & -10.5858 & 41.9772 & 0.4497 & 0.5355 & 0.4939 & 0.4939 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70398&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]23.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]23.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]22.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]22.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]22.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]21.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]16.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]15.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]15.7[/C][C]15.6999[/C][C]14.9073[/C][C]16.4924[/C][C]0.4999[/C][C]0.3103[/C][C]0[/C][C]0.3103[/C][/ROW]
[ROW][C]50[/C][C]15.1[/C][C]15.3792[/C][C]13.2326[/C][C]17.5257[/C][C]0.3994[/C][C]0.3848[/C][C]0[/C][C]0.3172[/C][/ROW]
[ROW][C]51[/C][C]14.8[/C][C]15.1098[/C][C]11.4069[/C][C]18.8127[/C][C]0.4349[/C][C]0.5021[/C][C]0[/C][C]0.3379[/C][/ROW]
[ROW][C]52[/C][C]14.3[/C][C]14.5987[/C][C]9.1193[/C][C]20.0781[/C][C]0.4575[/C][C]0.4713[/C][C]0.0055[/C][C]0.3208[/C][/ROW]
[ROW][C]53[/C][C]14.5[/C][C]13.9263[/C][C]6.441[/C][C]21.4115[/C][C]0.4403[/C][C]0.461[/C][C]0.0426[/C][C]0.3026[/C][/ROW]
[ROW][C]54[/C][C]18.9[/C][C]15.9984[/C][C]6.3122[/C][C]25.6847[/C][C]0.2786[/C][C]0.6191[/C][C]0.1162[/C][C]0.5079[/C][/ROW]
[ROW][C]55[/C][C]21.6[/C][C]18.5979[/C][C]6.5333[/C][C]30.6626[/C][C]0.3129[/C][C]0.4804[/C][C]0.2423[/C][C]0.6694[/C][/ROW]
[ROW][C]56[/C][C]20.4[/C][C]18.846[/C][C]4.2354[/C][C]33.4566[/C][C]0.4174[/C][C]0.3559[/C][C]0.3609[/C][C]0.6537[/C][/ROW]
[ROW][C]57[/C][C]17.9[/C][C]17.4091[/C][C]0.0958[/C][C]34.7224[/C][C]0.4778[/C][C]0.3675[/C][C]0.4285[/C][C]0.5678[/C][/ROW]
[ROW][C]58[/C][C]15.7[/C][C]16.0824[/C][C]-4.0816[/C][C]36.2465[/C][C]0.4852[/C][C]0.4299[/C][C]0.4645[/C][C]0.5071[/C][/ROW]
[ROW][C]59[/C][C]14.5[/C][C]15.6609[/C][C]-7.4946[/C][C]38.8164[/C][C]0.4609[/C][C]0.4987[/C][C]0.4852[/C][C]0.4919[/C][/ROW]
[ROW][C]60[/C][C]14[/C][C]15.6957[/C][C]-10.5858[/C][C]41.9772[/C][C]0.4497[/C][C]0.5355[/C][C]0.4939[/C][C]0.4939[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70398&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70398&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])
3623.5-------
3723.1-------
3822.7-------
3922.5-------
4021.7-------
4120.5-------
4221.9-------
4322.9-------
4421.5-------
4519-------
4617-------
4716.1-------
4815.9-------
4915.715.699914.907316.49240.49990.310300.3103
5015.115.379213.232617.52570.39940.384800.3172
5114.815.109811.406918.81270.43490.502100.3379
5214.314.59879.119320.07810.45750.47130.00550.3208
5314.513.92636.44121.41150.44030.4610.04260.3026
5418.915.99846.312225.68470.27860.61910.11620.5079
5521.618.59796.533330.66260.31290.48040.24230.6694
5620.418.8464.235433.45660.41740.35590.36090.6537
5717.917.40910.095834.72240.47780.36750.42850.5678
5815.716.0824-4.081636.24650.48520.42990.46450.5071
5914.515.6609-7.494638.81640.46090.49870.48520.4919
601415.6957-10.585841.97720.44970.53550.49390.4939







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.025800000
500.0712-0.01820.00910.07790.0390.1974
510.125-0.02050.01290.0960.0580.2408
520.1915-0.02050.01480.08920.06580.2565
530.27420.04120.02010.32910.11850.3442
540.30890.18140.04698.41921.50191.2255
550.3310.16140.06339.01232.57481.6046
560.39550.08250.06572.41492.55481.5984
570.50740.02820.06150.2412.29771.5158
580.6397-0.02380.05780.14632.08261.4431
590.7544-0.07410.05921.34772.01581.4198
600.8543-0.1080.06332.87532.08741.4448

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0258 & 0 & 0 & 0 & 0 & 0 \tabularnewline
50 & 0.0712 & -0.0182 & 0.0091 & 0.0779 & 0.039 & 0.1974 \tabularnewline
51 & 0.125 & -0.0205 & 0.0129 & 0.096 & 0.058 & 0.2408 \tabularnewline
52 & 0.1915 & -0.0205 & 0.0148 & 0.0892 & 0.0658 & 0.2565 \tabularnewline
53 & 0.2742 & 0.0412 & 0.0201 & 0.3291 & 0.1185 & 0.3442 \tabularnewline
54 & 0.3089 & 0.1814 & 0.0469 & 8.4192 & 1.5019 & 1.2255 \tabularnewline
55 & 0.331 & 0.1614 & 0.0633 & 9.0123 & 2.5748 & 1.6046 \tabularnewline
56 & 0.3955 & 0.0825 & 0.0657 & 2.4149 & 2.5548 & 1.5984 \tabularnewline
57 & 0.5074 & 0.0282 & 0.0615 & 0.241 & 2.2977 & 1.5158 \tabularnewline
58 & 0.6397 & -0.0238 & 0.0578 & 0.1463 & 2.0826 & 1.4431 \tabularnewline
59 & 0.7544 & -0.0741 & 0.0592 & 1.3477 & 2.0158 & 1.4198 \tabularnewline
60 & 0.8543 & -0.108 & 0.0633 & 2.8753 & 2.0874 & 1.4448 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70398&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.0258[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0712[/C][C]-0.0182[/C][C]0.0091[/C][C]0.0779[/C][C]0.039[/C][C]0.1974[/C][/ROW]
[ROW][C]51[/C][C]0.125[/C][C]-0.0205[/C][C]0.0129[/C][C]0.096[/C][C]0.058[/C][C]0.2408[/C][/ROW]
[ROW][C]52[/C][C]0.1915[/C][C]-0.0205[/C][C]0.0148[/C][C]0.0892[/C][C]0.0658[/C][C]0.2565[/C][/ROW]
[ROW][C]53[/C][C]0.2742[/C][C]0.0412[/C][C]0.0201[/C][C]0.3291[/C][C]0.1185[/C][C]0.3442[/C][/ROW]
[ROW][C]54[/C][C]0.3089[/C][C]0.1814[/C][C]0.0469[/C][C]8.4192[/C][C]1.5019[/C][C]1.2255[/C][/ROW]
[ROW][C]55[/C][C]0.331[/C][C]0.1614[/C][C]0.0633[/C][C]9.0123[/C][C]2.5748[/C][C]1.6046[/C][/ROW]
[ROW][C]56[/C][C]0.3955[/C][C]0.0825[/C][C]0.0657[/C][C]2.4149[/C][C]2.5548[/C][C]1.5984[/C][/ROW]
[ROW][C]57[/C][C]0.5074[/C][C]0.0282[/C][C]0.0615[/C][C]0.241[/C][C]2.2977[/C][C]1.5158[/C][/ROW]
[ROW][C]58[/C][C]0.6397[/C][C]-0.0238[/C][C]0.0578[/C][C]0.1463[/C][C]2.0826[/C][C]1.4431[/C][/ROW]
[ROW][C]59[/C][C]0.7544[/C][C]-0.0741[/C][C]0.0592[/C][C]1.3477[/C][C]2.0158[/C][C]1.4198[/C][/ROW]
[ROW][C]60[/C][C]0.8543[/C][C]-0.108[/C][C]0.0633[/C][C]2.8753[/C][C]2.0874[/C][C]1.4448[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70398&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70398&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.025800000
500.0712-0.01820.00910.07790.0390.1974
510.125-0.02050.01290.0960.0580.2408
520.1915-0.02050.01480.08920.06580.2565
530.27420.04120.02010.32910.11850.3442
540.30890.18140.04698.41921.50191.2255
550.3310.16140.06339.01232.57481.6046
560.39550.08250.06572.41492.55481.5984
570.50740.02820.06150.2412.29771.5158
580.6397-0.02380.05780.14632.08261.4431
590.7544-0.07410.05921.34772.01581.4198
600.8543-0.1080.06332.87532.08741.4448



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