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:33:33 -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/t1261431254s9rkuk8ygqjfnbc.htm/, Retrieved Sun, 05 May 2024 10:42:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70399, Retrieved Sun, 05 May 2024 10:42:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact89
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:33:33] [e339dd08bcbfc073ac7494f09a949034] [Current]
Feedback Forum

Post a new message
Dataseries X:
18,3
18,7
18,6
18,3
17,9
17,4
17,4
20,1
23,2
24,2
24,2
23,9
23,8
23,8
23,3
22,4
21,5
20,5
19,9
22
24,9
25,7
25,3
24,4
23,8
23,5
23
22,2
21,4
20,3
19,5
21,7
24,7
25,3
24,9
24,1
23,4
23,1
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




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70399&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 time3 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])
3624.1-------
3723.4-------
3823.1-------
3922.4-------
4021.3-------
4120.3-------
4219.3-------
4318.7-------
4421-------
4524-------
4624.8-------
4724.2-------
4823.3-------
4922.722.662922.366522.95940.4032000
5022.322.385621.771422.99990.39240.15790.01130.0018
5121.821.771220.855522.68690.47540.12880.08925e-04
5221.220.78719.581621.99230.25090.04970.20210
5320.519.8618.353321.36670.20250.04070.28350
5419.718.806416.973320.63960.16970.03510.29880
5519.218.111215.925920.29640.16440.07710.29870
5621.220.359217.800722.91780.25980.81270.31180.0121
5723.923.350220.400426.30.35740.92350.3330.5133
5824.824.052920.694827.41110.33140.53560.33140.6698
5924.223.531719.748427.31510.36460.25560.36460.5478
602322.666718.441526.8920.43860.23850.38450.3845

\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 & 24.1 & - & - & - & - & - & - & - \tabularnewline
37 & 23.4 & - & - & - & - & - & - & - \tabularnewline
38 & 23.1 & - & - & - & - & - & - & - \tabularnewline
39 & 22.4 & - & - & - & - & - & - & - \tabularnewline
40 & 21.3 & - & - & - & - & - & - & - \tabularnewline
41 & 20.3 & - & - & - & - & - & - & - \tabularnewline
42 & 19.3 & - & - & - & - & - & - & - \tabularnewline
43 & 18.7 & - & - & - & - & - & - & - \tabularnewline
44 & 21 & - & - & - & - & - & - & - \tabularnewline
45 & 24 & - & - & - & - & - & - & - \tabularnewline
46 & 24.8 & - & - & - & - & - & - & - \tabularnewline
47 & 24.2 & - & - & - & - & - & - & - \tabularnewline
48 & 23.3 & - & - & - & - & - & - & - \tabularnewline
49 & 22.7 & 22.6629 & 22.3665 & 22.9594 & 0.4032 & 0 & 0 & 0 \tabularnewline
50 & 22.3 & 22.3856 & 21.7714 & 22.9999 & 0.3924 & 0.1579 & 0.0113 & 0.0018 \tabularnewline
51 & 21.8 & 21.7712 & 20.8555 & 22.6869 & 0.4754 & 0.1288 & 0.0892 & 5e-04 \tabularnewline
52 & 21.2 & 20.787 & 19.5816 & 21.9923 & 0.2509 & 0.0497 & 0.2021 & 0 \tabularnewline
53 & 20.5 & 19.86 & 18.3533 & 21.3667 & 0.2025 & 0.0407 & 0.2835 & 0 \tabularnewline
54 & 19.7 & 18.8064 & 16.9733 & 20.6396 & 0.1697 & 0.0351 & 0.2988 & 0 \tabularnewline
55 & 19.2 & 18.1112 & 15.9259 & 20.2964 & 0.1644 & 0.0771 & 0.2987 & 0 \tabularnewline
56 & 21.2 & 20.3592 & 17.8007 & 22.9178 & 0.2598 & 0.8127 & 0.3118 & 0.0121 \tabularnewline
57 & 23.9 & 23.3502 & 20.4004 & 26.3 & 0.3574 & 0.9235 & 0.333 & 0.5133 \tabularnewline
58 & 24.8 & 24.0529 & 20.6948 & 27.4111 & 0.3314 & 0.5356 & 0.3314 & 0.6698 \tabularnewline
59 & 24.2 & 23.5317 & 19.7484 & 27.3151 & 0.3646 & 0.2556 & 0.3646 & 0.5478 \tabularnewline
60 & 23 & 22.6667 & 18.4415 & 26.892 & 0.4386 & 0.2385 & 0.3845 & 0.3845 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70399&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]24.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]23.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]23.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]22.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]19.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]24.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]24.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]23.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22.7[/C][C]22.6629[/C][C]22.3665[/C][C]22.9594[/C][C]0.4032[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]22.3[/C][C]22.3856[/C][C]21.7714[/C][C]22.9999[/C][C]0.3924[/C][C]0.1579[/C][C]0.0113[/C][C]0.0018[/C][/ROW]
[ROW][C]51[/C][C]21.8[/C][C]21.7712[/C][C]20.8555[/C][C]22.6869[/C][C]0.4754[/C][C]0.1288[/C][C]0.0892[/C][C]5e-04[/C][/ROW]
[ROW][C]52[/C][C]21.2[/C][C]20.787[/C][C]19.5816[/C][C]21.9923[/C][C]0.2509[/C][C]0.0497[/C][C]0.2021[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]20.5[/C][C]19.86[/C][C]18.3533[/C][C]21.3667[/C][C]0.2025[/C][C]0.0407[/C][C]0.2835[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]19.7[/C][C]18.8064[/C][C]16.9733[/C][C]20.6396[/C][C]0.1697[/C][C]0.0351[/C][C]0.2988[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]19.2[/C][C]18.1112[/C][C]15.9259[/C][C]20.2964[/C][C]0.1644[/C][C]0.0771[/C][C]0.2987[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]21.2[/C][C]20.3592[/C][C]17.8007[/C][C]22.9178[/C][C]0.2598[/C][C]0.8127[/C][C]0.3118[/C][C]0.0121[/C][/ROW]
[ROW][C]57[/C][C]23.9[/C][C]23.3502[/C][C]20.4004[/C][C]26.3[/C][C]0.3574[/C][C]0.9235[/C][C]0.333[/C][C]0.5133[/C][/ROW]
[ROW][C]58[/C][C]24.8[/C][C]24.0529[/C][C]20.6948[/C][C]27.4111[/C][C]0.3314[/C][C]0.5356[/C][C]0.3314[/C][C]0.6698[/C][/ROW]
[ROW][C]59[/C][C]24.2[/C][C]23.5317[/C][C]19.7484[/C][C]27.3151[/C][C]0.3646[/C][C]0.2556[/C][C]0.3646[/C][C]0.5478[/C][/ROW]
[ROW][C]60[/C][C]23[/C][C]22.6667[/C][C]18.4415[/C][C]26.892[/C][C]0.4386[/C][C]0.2385[/C][C]0.3845[/C][C]0.3845[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70399&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70399&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])
3624.1-------
3723.4-------
3823.1-------
3922.4-------
4021.3-------
4120.3-------
4219.3-------
4318.7-------
4421-------
4524-------
4624.8-------
4724.2-------
4823.3-------
4922.722.662922.366522.95940.4032000
5022.322.385621.771422.99990.39240.15790.01130.0018
5121.821.771220.855522.68690.47540.12880.08925e-04
5221.220.78719.581621.99230.25090.04970.20210
5320.519.8618.353321.36670.20250.04070.28350
5419.718.806416.973320.63960.16970.03510.29880
5519.218.111215.925920.29640.16440.07710.29870
5621.220.359217.800722.91780.25980.81270.31180.0121
5723.923.350220.400426.30.35740.92350.3330.5133
5824.824.052920.694827.41110.33140.53560.33140.6698
5924.223.531719.748427.31510.36460.25560.36460.5478
602322.666718.441526.8920.43860.23850.38450.3845







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.00670.001600.001400
500.014-0.00380.00270.00730.00440.066
510.02150.00130.00238e-040.00320.0564
520.02960.01990.00670.17060.0450.2122
530.03870.03220.01180.40960.11790.3434
540.04970.04750.01770.79850.23140.481
550.06160.06010.02381.18560.36770.6064
560.06410.04130.0260.70690.41010.6404
570.06450.02350.02570.30220.39810.6309
580.07120.03110.02620.55810.41410.6435
590.0820.02840.02640.44660.41710.6458
600.09510.01470.02550.11110.39160.6257

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0067 & 0.0016 & 0 & 0.0014 & 0 & 0 \tabularnewline
50 & 0.014 & -0.0038 & 0.0027 & 0.0073 & 0.0044 & 0.066 \tabularnewline
51 & 0.0215 & 0.0013 & 0.0023 & 8e-04 & 0.0032 & 0.0564 \tabularnewline
52 & 0.0296 & 0.0199 & 0.0067 & 0.1706 & 0.045 & 0.2122 \tabularnewline
53 & 0.0387 & 0.0322 & 0.0118 & 0.4096 & 0.1179 & 0.3434 \tabularnewline
54 & 0.0497 & 0.0475 & 0.0177 & 0.7985 & 0.2314 & 0.481 \tabularnewline
55 & 0.0616 & 0.0601 & 0.0238 & 1.1856 & 0.3677 & 0.6064 \tabularnewline
56 & 0.0641 & 0.0413 & 0.026 & 0.7069 & 0.4101 & 0.6404 \tabularnewline
57 & 0.0645 & 0.0235 & 0.0257 & 0.3022 & 0.3981 & 0.6309 \tabularnewline
58 & 0.0712 & 0.0311 & 0.0262 & 0.5581 & 0.4141 & 0.6435 \tabularnewline
59 & 0.082 & 0.0284 & 0.0264 & 0.4466 & 0.4171 & 0.6458 \tabularnewline
60 & 0.0951 & 0.0147 & 0.0255 & 0.1111 & 0.3916 & 0.6257 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70399&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.0067[/C][C]0.0016[/C][C]0[/C][C]0.0014[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.014[/C][C]-0.0038[/C][C]0.0027[/C][C]0.0073[/C][C]0.0044[/C][C]0.066[/C][/ROW]
[ROW][C]51[/C][C]0.0215[/C][C]0.0013[/C][C]0.0023[/C][C]8e-04[/C][C]0.0032[/C][C]0.0564[/C][/ROW]
[ROW][C]52[/C][C]0.0296[/C][C]0.0199[/C][C]0.0067[/C][C]0.1706[/C][C]0.045[/C][C]0.2122[/C][/ROW]
[ROW][C]53[/C][C]0.0387[/C][C]0.0322[/C][C]0.0118[/C][C]0.4096[/C][C]0.1179[/C][C]0.3434[/C][/ROW]
[ROW][C]54[/C][C]0.0497[/C][C]0.0475[/C][C]0.0177[/C][C]0.7985[/C][C]0.2314[/C][C]0.481[/C][/ROW]
[ROW][C]55[/C][C]0.0616[/C][C]0.0601[/C][C]0.0238[/C][C]1.1856[/C][C]0.3677[/C][C]0.6064[/C][/ROW]
[ROW][C]56[/C][C]0.0641[/C][C]0.0413[/C][C]0.026[/C][C]0.7069[/C][C]0.4101[/C][C]0.6404[/C][/ROW]
[ROW][C]57[/C][C]0.0645[/C][C]0.0235[/C][C]0.0257[/C][C]0.3022[/C][C]0.3981[/C][C]0.6309[/C][/ROW]
[ROW][C]58[/C][C]0.0712[/C][C]0.0311[/C][C]0.0262[/C][C]0.5581[/C][C]0.4141[/C][C]0.6435[/C][/ROW]
[ROW][C]59[/C][C]0.082[/C][C]0.0284[/C][C]0.0264[/C][C]0.4466[/C][C]0.4171[/C][C]0.6458[/C][/ROW]
[ROW][C]60[/C][C]0.0951[/C][C]0.0147[/C][C]0.0255[/C][C]0.1111[/C][C]0.3916[/C][C]0.6257[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70399&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70399&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.00670.001600.001400
500.014-0.00380.00270.00730.00440.066
510.02150.00130.00238e-040.00320.0564
520.02960.01990.00670.17060.0450.2122
530.03870.03220.01180.40960.11790.3434
540.04970.04750.01770.79850.23140.481
550.06160.06010.02381.18560.36770.6064
560.06410.04130.0260.70690.41010.6404
570.06450.02350.02570.30220.39810.6309
580.07120.03110.02620.55810.41410.6435
590.0820.02840.02640.44660.41710.6458
600.09510.01470.02550.11110.39160.6257



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')