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 09:08:42 -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/t1261411804b9gpdsgbz2w1qob.htm/, Retrieved Sun, 05 May 2024 14:48:29 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70316, Retrieved Sun, 05 May 2024 14:48:29 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact100
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-21 16:08:42] [208e60166df5802f3c494097313a670f] [Current]
Feedback Forum

Post a new message
Dataseries X:
9.3
9.3
8.7
8.2
8.3
8.5
8.6
8.5
8.2
8.1
7.9
8.6
8.7
8.7
8.5
8.4
8.5
8.7
8.7
8.6
8.5
8.3
8
8.2
8.1
8.1
8
7.9
7.9
8
8
7.9
8
7.7
7.2
7.5
7.3
7
7
7
7.2
7.3
7.1
6.8
6.4
6.1
6.5
7.7
7.9
7.5
6.9
6.6
6.9
7.7
8
8
7.7
7.3
7.4
8.1
8.3
8.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70316&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[50])
387-------
397-------
407-------
417.2-------
427.3-------
437.1-------
446.8-------
456.4-------
466.1-------
476.5-------
487.7-------
497.9-------
507.5-------
516.97.15246.7217.58370.12580.05710.75560.0571
526.66.91326.03967.78680.24110.51180.42280.094
536.97.13295.91598.350.35380.80460.4570.2772
547.77.43436.01388.85480.35690.76950.57350.4639
5587.44275.90568.97990.23870.37140.6690.4709
5687.24065.61078.87050.18060.18060.70190.3775
577.76.82685.08538.56830.16290.09340.68450.2243
587.36.4774.58778.36630.19660.10230.65210.1443
597.46.86474.80438.92510.30530.33940.63570.2728
608.18.11195.882210.34160.49580.73430.64140.7047
618.38.39246.008310.77650.46970.5950.65720.7684
628.38.06645.539510.59330.42810.42810.66980.6698

\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[50]) \tabularnewline
38 & 7 & - & - & - & - & - & - & - \tabularnewline
39 & 7 & - & - & - & - & - & - & - \tabularnewline
40 & 7 & - & - & - & - & - & - & - \tabularnewline
41 & 7.2 & - & - & - & - & - & - & - \tabularnewline
42 & 7.3 & - & - & - & - & - & - & - \tabularnewline
43 & 7.1 & - & - & - & - & - & - & - \tabularnewline
44 & 6.8 & - & - & - & - & - & - & - \tabularnewline
45 & 6.4 & - & - & - & - & - & - & - \tabularnewline
46 & 6.1 & - & - & - & - & - & - & - \tabularnewline
47 & 6.5 & - & - & - & - & - & - & - \tabularnewline
48 & 7.7 & - & - & - & - & - & - & - \tabularnewline
49 & 7.9 & - & - & - & - & - & - & - \tabularnewline
50 & 7.5 & - & - & - & - & - & - & - \tabularnewline
51 & 6.9 & 7.1524 & 6.721 & 7.5837 & 0.1258 & 0.0571 & 0.7556 & 0.0571 \tabularnewline
52 & 6.6 & 6.9132 & 6.0396 & 7.7868 & 0.2411 & 0.5118 & 0.4228 & 0.094 \tabularnewline
53 & 6.9 & 7.1329 & 5.9159 & 8.35 & 0.3538 & 0.8046 & 0.457 & 0.2772 \tabularnewline
54 & 7.7 & 7.4343 & 6.0138 & 8.8548 & 0.3569 & 0.7695 & 0.5735 & 0.4639 \tabularnewline
55 & 8 & 7.4427 & 5.9056 & 8.9799 & 0.2387 & 0.3714 & 0.669 & 0.4709 \tabularnewline
56 & 8 & 7.2406 & 5.6107 & 8.8705 & 0.1806 & 0.1806 & 0.7019 & 0.3775 \tabularnewline
57 & 7.7 & 6.8268 & 5.0853 & 8.5683 & 0.1629 & 0.0934 & 0.6845 & 0.2243 \tabularnewline
58 & 7.3 & 6.477 & 4.5877 & 8.3663 & 0.1966 & 0.1023 & 0.6521 & 0.1443 \tabularnewline
59 & 7.4 & 6.8647 & 4.8043 & 8.9251 & 0.3053 & 0.3394 & 0.6357 & 0.2728 \tabularnewline
60 & 8.1 & 8.1119 & 5.8822 & 10.3416 & 0.4958 & 0.7343 & 0.6414 & 0.7047 \tabularnewline
61 & 8.3 & 8.3924 & 6.0083 & 10.7765 & 0.4697 & 0.595 & 0.6572 & 0.7684 \tabularnewline
62 & 8.3 & 8.0664 & 5.5395 & 10.5933 & 0.4281 & 0.4281 & 0.6698 & 0.6698 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70316&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[50])[/C][/ROW]
[ROW][C]38[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]7.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]6.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]6.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]6.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]6.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]6.9[/C][C]7.1524[/C][C]6.721[/C][C]7.5837[/C][C]0.1258[/C][C]0.0571[/C][C]0.7556[/C][C]0.0571[/C][/ROW]
[ROW][C]52[/C][C]6.6[/C][C]6.9132[/C][C]6.0396[/C][C]7.7868[/C][C]0.2411[/C][C]0.5118[/C][C]0.4228[/C][C]0.094[/C][/ROW]
[ROW][C]53[/C][C]6.9[/C][C]7.1329[/C][C]5.9159[/C][C]8.35[/C][C]0.3538[/C][C]0.8046[/C][C]0.457[/C][C]0.2772[/C][/ROW]
[ROW][C]54[/C][C]7.7[/C][C]7.4343[/C][C]6.0138[/C][C]8.8548[/C][C]0.3569[/C][C]0.7695[/C][C]0.5735[/C][C]0.4639[/C][/ROW]
[ROW][C]55[/C][C]8[/C][C]7.4427[/C][C]5.9056[/C][C]8.9799[/C][C]0.2387[/C][C]0.3714[/C][C]0.669[/C][C]0.4709[/C][/ROW]
[ROW][C]56[/C][C]8[/C][C]7.2406[/C][C]5.6107[/C][C]8.8705[/C][C]0.1806[/C][C]0.1806[/C][C]0.7019[/C][C]0.3775[/C][/ROW]
[ROW][C]57[/C][C]7.7[/C][C]6.8268[/C][C]5.0853[/C][C]8.5683[/C][C]0.1629[/C][C]0.0934[/C][C]0.6845[/C][C]0.2243[/C][/ROW]
[ROW][C]58[/C][C]7.3[/C][C]6.477[/C][C]4.5877[/C][C]8.3663[/C][C]0.1966[/C][C]0.1023[/C][C]0.6521[/C][C]0.1443[/C][/ROW]
[ROW][C]59[/C][C]7.4[/C][C]6.8647[/C][C]4.8043[/C][C]8.9251[/C][C]0.3053[/C][C]0.3394[/C][C]0.6357[/C][C]0.2728[/C][/ROW]
[ROW][C]60[/C][C]8.1[/C][C]8.1119[/C][C]5.8822[/C][C]10.3416[/C][C]0.4958[/C][C]0.7343[/C][C]0.6414[/C][C]0.7047[/C][/ROW]
[ROW][C]61[/C][C]8.3[/C][C]8.3924[/C][C]6.0083[/C][C]10.7765[/C][C]0.4697[/C][C]0.595[/C][C]0.6572[/C][C]0.7684[/C][/ROW]
[ROW][C]62[/C][C]8.3[/C][C]8.0664[/C][C]5.5395[/C][C]10.5933[/C][C]0.4281[/C][C]0.4281[/C][C]0.6698[/C][C]0.6698[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70316&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70316&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[50])
387-------
397-------
407-------
417.2-------
427.3-------
437.1-------
446.8-------
456.4-------
466.1-------
476.5-------
487.7-------
497.9-------
507.5-------
516.97.15246.7217.58370.12580.05710.75560.0571
526.66.91326.03967.78680.24110.51180.42280.094
536.97.13295.91598.350.35380.80460.4570.2772
547.77.43436.01388.85480.35690.76950.57350.4639
5587.44275.90568.97990.23870.37140.6690.4709
5687.24065.61078.87050.18060.18060.70190.3775
577.76.82685.08538.56830.16290.09340.68450.2243
587.36.4774.58778.36630.19660.10230.65210.1443
597.46.86474.80438.92510.30530.33940.63570.2728
608.18.11195.882210.34160.49580.73430.64140.7047
618.38.39246.008310.77650.46970.5950.65720.7684
628.38.06645.539510.59330.42810.42810.66980.6698







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
510.0308-0.035300.063700
520.0645-0.04530.04030.09810.08090.2844
530.0871-0.03270.03770.05430.0720.2684
540.09750.03570.03720.07060.07170.2677
550.10540.07490.04480.31050.11940.3456
560.11490.10490.05480.57680.19570.4423
570.13020.12790.06520.76250.27660.526
580.14880.12710.0730.67730.32670.5716
590.15310.0780.07350.28660.32230.5677
600.1402-0.00150.06631e-040.290.5386
610.1449-0.0110.06130.00850.26450.5142
620.15980.0290.05860.05460.2470.497

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
51 & 0.0308 & -0.0353 & 0 & 0.0637 & 0 & 0 \tabularnewline
52 & 0.0645 & -0.0453 & 0.0403 & 0.0981 & 0.0809 & 0.2844 \tabularnewline
53 & 0.0871 & -0.0327 & 0.0377 & 0.0543 & 0.072 & 0.2684 \tabularnewline
54 & 0.0975 & 0.0357 & 0.0372 & 0.0706 & 0.0717 & 0.2677 \tabularnewline
55 & 0.1054 & 0.0749 & 0.0448 & 0.3105 & 0.1194 & 0.3456 \tabularnewline
56 & 0.1149 & 0.1049 & 0.0548 & 0.5768 & 0.1957 & 0.4423 \tabularnewline
57 & 0.1302 & 0.1279 & 0.0652 & 0.7625 & 0.2766 & 0.526 \tabularnewline
58 & 0.1488 & 0.1271 & 0.073 & 0.6773 & 0.3267 & 0.5716 \tabularnewline
59 & 0.1531 & 0.078 & 0.0735 & 0.2866 & 0.3223 & 0.5677 \tabularnewline
60 & 0.1402 & -0.0015 & 0.0663 & 1e-04 & 0.29 & 0.5386 \tabularnewline
61 & 0.1449 & -0.011 & 0.0613 & 0.0085 & 0.2645 & 0.5142 \tabularnewline
62 & 0.1598 & 0.029 & 0.0586 & 0.0546 & 0.247 & 0.497 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70316&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]51[/C][C]0.0308[/C][C]-0.0353[/C][C]0[/C][C]0.0637[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]0.0645[/C][C]-0.0453[/C][C]0.0403[/C][C]0.0981[/C][C]0.0809[/C][C]0.2844[/C][/ROW]
[ROW][C]53[/C][C]0.0871[/C][C]-0.0327[/C][C]0.0377[/C][C]0.0543[/C][C]0.072[/C][C]0.2684[/C][/ROW]
[ROW][C]54[/C][C]0.0975[/C][C]0.0357[/C][C]0.0372[/C][C]0.0706[/C][C]0.0717[/C][C]0.2677[/C][/ROW]
[ROW][C]55[/C][C]0.1054[/C][C]0.0749[/C][C]0.0448[/C][C]0.3105[/C][C]0.1194[/C][C]0.3456[/C][/ROW]
[ROW][C]56[/C][C]0.1149[/C][C]0.1049[/C][C]0.0548[/C][C]0.5768[/C][C]0.1957[/C][C]0.4423[/C][/ROW]
[ROW][C]57[/C][C]0.1302[/C][C]0.1279[/C][C]0.0652[/C][C]0.7625[/C][C]0.2766[/C][C]0.526[/C][/ROW]
[ROW][C]58[/C][C]0.1488[/C][C]0.1271[/C][C]0.073[/C][C]0.6773[/C][C]0.3267[/C][C]0.5716[/C][/ROW]
[ROW][C]59[/C][C]0.1531[/C][C]0.078[/C][C]0.0735[/C][C]0.2866[/C][C]0.3223[/C][C]0.5677[/C][/ROW]
[ROW][C]60[/C][C]0.1402[/C][C]-0.0015[/C][C]0.0663[/C][C]1e-04[/C][C]0.29[/C][C]0.5386[/C][/ROW]
[ROW][C]61[/C][C]0.1449[/C][C]-0.011[/C][C]0.0613[/C][C]0.0085[/C][C]0.2645[/C][C]0.5142[/C][/ROW]
[ROW][C]62[/C][C]0.1598[/C][C]0.029[/C][C]0.0586[/C][C]0.0546[/C][C]0.247[/C][C]0.497[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70316&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70316&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
510.0308-0.035300.063700
520.0645-0.04530.04030.09810.08090.2844
530.0871-0.03270.03770.05430.0720.2684
540.09750.03570.03720.07060.07170.2677
550.10540.07490.04480.31050.11940.3456
560.11490.10490.05480.57680.19570.4423
570.13020.12790.06520.76250.27660.526
580.14880.12710.0730.67730.32670.5716
590.15310.0780.07350.28660.32230.5677
600.1402-0.00150.06631e-040.290.5386
610.1449-0.0110.06130.00850.26450.5142
620.15980.0290.05860.05460.2470.497



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