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 computationSat, 19 Dec 2009 03:30:06 -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/19/t1261218722m7vlruig1coa3t3.htm/, Retrieved Thu, 02 May 2024 03:06:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69481, Retrieved Thu, 02 May 2024 03:06:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact157
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-08 17:36:01] [7369a9baefff1ba9d2171738b4c9faa6]
-    D  [ARIMA Forecasting] [ARIMA forecasting...] [2009-12-10 10:14:16] [e3c32faf833f030d3b397185b633f75f]
-   P       [ARIMA Forecasting] [Forecasting] [2009-12-19 10:30:06] [4996e0131d5120d29a6e9a8dccb25dc3] [Current]
Feedback Forum

Post a new message
Dataseries X:
19
18
19
19
22
23
20
14
14
14
15
11
17
16
20
24
23
20
21
19
23
23
23
23
27
26
17
24
26
24
27
27
26
24
23
23
24
17
21
19
22
22
18
16
14
12
14
16
8
3
0
5
1
1
3
6
7
8
14
14
13




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69481&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[49])
3724-------
3817-------
3921-------
4019-------
4122-------
4222-------
4318-------
4416-------
4514-------
4612-------
4714-------
4816-------
498-------
5036.1298-2.340714.60040.23450.33260.00590.3326
5105.3786-6.84217.59920.19420.64860.00610.3371
5253.2888-13.089119.66670.41890.65310.030.2864
5312.3897-19.805224.58460.45120.40880.04170.3101
5410.1889-28.309928.68780.47780.47780.06680.2956
553-3.5289-38.326631.26870.35650.39930.11260.258
566-8.6143-50.42133.19240.24660.2930.12430.218
577-10.6201-59.942938.70270.24190.25450.16390.2297
588-14.1359-71.223842.95190.22360.2340.18480.2236
5914-16.1149-81.364149.13440.18280.23440.18280.2344
6014-18.7417-92.573255.08990.19240.19240.17820.2389
6113-21.111-103.812261.59010.20940.20270.24510.2451

\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[49]) \tabularnewline
37 & 24 & - & - & - & - & - & - & - \tabularnewline
38 & 17 & - & - & - & - & - & - & - \tabularnewline
39 & 21 & - & - & - & - & - & - & - \tabularnewline
40 & 19 & - & - & - & - & - & - & - \tabularnewline
41 & 22 & - & - & - & - & - & - & - \tabularnewline
42 & 22 & - & - & - & - & - & - & - \tabularnewline
43 & 18 & - & - & - & - & - & - & - \tabularnewline
44 & 16 & - & - & - & - & - & - & - \tabularnewline
45 & 14 & - & - & - & - & - & - & - \tabularnewline
46 & 12 & - & - & - & - & - & - & - \tabularnewline
47 & 14 & - & - & - & - & - & - & - \tabularnewline
48 & 16 & - & - & - & - & - & - & - \tabularnewline
49 & 8 & - & - & - & - & - & - & - \tabularnewline
50 & 3 & 6.1298 & -2.3407 & 14.6004 & 0.2345 & 0.3326 & 0.0059 & 0.3326 \tabularnewline
51 & 0 & 5.3786 & -6.842 & 17.5992 & 0.1942 & 0.6486 & 0.0061 & 0.3371 \tabularnewline
52 & 5 & 3.2888 & -13.0891 & 19.6667 & 0.4189 & 0.6531 & 0.03 & 0.2864 \tabularnewline
53 & 1 & 2.3897 & -19.8052 & 24.5846 & 0.4512 & 0.4088 & 0.0417 & 0.3101 \tabularnewline
54 & 1 & 0.1889 & -28.3099 & 28.6878 & 0.4778 & 0.4778 & 0.0668 & 0.2956 \tabularnewline
55 & 3 & -3.5289 & -38.3266 & 31.2687 & 0.3565 & 0.3993 & 0.1126 & 0.258 \tabularnewline
56 & 6 & -8.6143 & -50.421 & 33.1924 & 0.2466 & 0.293 & 0.1243 & 0.218 \tabularnewline
57 & 7 & -10.6201 & -59.9429 & 38.7027 & 0.2419 & 0.2545 & 0.1639 & 0.2297 \tabularnewline
58 & 8 & -14.1359 & -71.2238 & 42.9519 & 0.2236 & 0.234 & 0.1848 & 0.2236 \tabularnewline
59 & 14 & -16.1149 & -81.3641 & 49.1344 & 0.1828 & 0.2344 & 0.1828 & 0.2344 \tabularnewline
60 & 14 & -18.7417 & -92.5732 & 55.0899 & 0.1924 & 0.1924 & 0.1782 & 0.2389 \tabularnewline
61 & 13 & -21.111 & -103.8122 & 61.5901 & 0.2094 & 0.2027 & 0.2451 & 0.2451 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69481&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[49])[/C][/ROW]
[ROW][C]37[/C][C]24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3[/C][C]6.1298[/C][C]-2.3407[/C][C]14.6004[/C][C]0.2345[/C][C]0.3326[/C][C]0.0059[/C][C]0.3326[/C][/ROW]
[ROW][C]51[/C][C]0[/C][C]5.3786[/C][C]-6.842[/C][C]17.5992[/C][C]0.1942[/C][C]0.6486[/C][C]0.0061[/C][C]0.3371[/C][/ROW]
[ROW][C]52[/C][C]5[/C][C]3.2888[/C][C]-13.0891[/C][C]19.6667[/C][C]0.4189[/C][C]0.6531[/C][C]0.03[/C][C]0.2864[/C][/ROW]
[ROW][C]53[/C][C]1[/C][C]2.3897[/C][C]-19.8052[/C][C]24.5846[/C][C]0.4512[/C][C]0.4088[/C][C]0.0417[/C][C]0.3101[/C][/ROW]
[ROW][C]54[/C][C]1[/C][C]0.1889[/C][C]-28.3099[/C][C]28.6878[/C][C]0.4778[/C][C]0.4778[/C][C]0.0668[/C][C]0.2956[/C][/ROW]
[ROW][C]55[/C][C]3[/C][C]-3.5289[/C][C]-38.3266[/C][C]31.2687[/C][C]0.3565[/C][C]0.3993[/C][C]0.1126[/C][C]0.258[/C][/ROW]
[ROW][C]56[/C][C]6[/C][C]-8.6143[/C][C]-50.421[/C][C]33.1924[/C][C]0.2466[/C][C]0.293[/C][C]0.1243[/C][C]0.218[/C][/ROW]
[ROW][C]57[/C][C]7[/C][C]-10.6201[/C][C]-59.9429[/C][C]38.7027[/C][C]0.2419[/C][C]0.2545[/C][C]0.1639[/C][C]0.2297[/C][/ROW]
[ROW][C]58[/C][C]8[/C][C]-14.1359[/C][C]-71.2238[/C][C]42.9519[/C][C]0.2236[/C][C]0.234[/C][C]0.1848[/C][C]0.2236[/C][/ROW]
[ROW][C]59[/C][C]14[/C][C]-16.1149[/C][C]-81.3641[/C][C]49.1344[/C][C]0.1828[/C][C]0.2344[/C][C]0.1828[/C][C]0.2344[/C][/ROW]
[ROW][C]60[/C][C]14[/C][C]-18.7417[/C][C]-92.5732[/C][C]55.0899[/C][C]0.1924[/C][C]0.1924[/C][C]0.1782[/C][C]0.2389[/C][/ROW]
[ROW][C]61[/C][C]13[/C][C]-21.111[/C][C]-103.8122[/C][C]61.5901[/C][C]0.2094[/C][C]0.2027[/C][C]0.2451[/C][C]0.2451[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69481&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69481&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[49])
3724-------
3817-------
3921-------
4019-------
4122-------
4222-------
4318-------
4416-------
4514-------
4612-------
4714-------
4816-------
498-------
5036.1298-2.340714.60040.23450.33260.00590.3326
5105.3786-6.84217.59920.19420.64860.00610.3371
5253.2888-13.089119.66670.41890.65310.030.2864
5312.3897-19.805224.58460.45120.40880.04170.3101
5410.1889-28.309928.68780.47780.47780.06680.2956
553-3.5289-38.326631.26870.35650.39930.11260.258
566-8.6143-50.42133.19240.24660.2930.12430.218
577-10.6201-59.942938.70270.24190.25450.16390.2297
588-14.1359-71.223842.95190.22360.2340.18480.2236
5914-16.1149-81.364149.13440.18280.23440.18280.2344
6014-18.7417-92.573255.08990.19240.19240.17820.2389
6113-21.111-103.812261.59010.20940.20270.24510.2451







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.705-0.510609.795800
511.1592-10.755328.929619.36274.4003
522.54080.52030.6772.928313.88453.7262
534.7386-0.58150.65311.931310.89623.3009
5476.95434.29251.3810.65788.84862.9747
55-5.0309-1.85011.459242.627114.47833.805
56-2.4761-1.69651.4931213.578142.92116.5514
57-2.3695-1.65911.5138310.467476.36448.7387
58-2.0605-1.56591.5196489.9998122.323911.06
59-2.0658-1.86881.5545906.9043200.781914.1698
60-2.0099-1.7471.5721072.0157279.98516.7328
61-1.9987-1.61581.57571163.5629353.616518.8047

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.705 & -0.5106 & 0 & 9.7958 & 0 & 0 \tabularnewline
51 & 1.1592 & -1 & 0.7553 & 28.9296 & 19.3627 & 4.4003 \tabularnewline
52 & 2.5408 & 0.5203 & 0.677 & 2.9283 & 13.8845 & 3.7262 \tabularnewline
53 & 4.7386 & -0.5815 & 0.6531 & 1.9313 & 10.8962 & 3.3009 \tabularnewline
54 & 76.9543 & 4.2925 & 1.381 & 0.6578 & 8.8486 & 2.9747 \tabularnewline
55 & -5.0309 & -1.8501 & 1.4592 & 42.6271 & 14.4783 & 3.805 \tabularnewline
56 & -2.4761 & -1.6965 & 1.4931 & 213.5781 & 42.9211 & 6.5514 \tabularnewline
57 & -2.3695 & -1.6591 & 1.5138 & 310.4674 & 76.3644 & 8.7387 \tabularnewline
58 & -2.0605 & -1.5659 & 1.5196 & 489.9998 & 122.3239 & 11.06 \tabularnewline
59 & -2.0658 & -1.8688 & 1.5545 & 906.9043 & 200.7819 & 14.1698 \tabularnewline
60 & -2.0099 & -1.747 & 1.572 & 1072.0157 & 279.985 & 16.7328 \tabularnewline
61 & -1.9987 & -1.6158 & 1.5757 & 1163.5629 & 353.6165 & 18.8047 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69481&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]50[/C][C]0.705[/C][C]-0.5106[/C][C]0[/C][C]9.7958[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]1.1592[/C][C]-1[/C][C]0.7553[/C][C]28.9296[/C][C]19.3627[/C][C]4.4003[/C][/ROW]
[ROW][C]52[/C][C]2.5408[/C][C]0.5203[/C][C]0.677[/C][C]2.9283[/C][C]13.8845[/C][C]3.7262[/C][/ROW]
[ROW][C]53[/C][C]4.7386[/C][C]-0.5815[/C][C]0.6531[/C][C]1.9313[/C][C]10.8962[/C][C]3.3009[/C][/ROW]
[ROW][C]54[/C][C]76.9543[/C][C]4.2925[/C][C]1.381[/C][C]0.6578[/C][C]8.8486[/C][C]2.9747[/C][/ROW]
[ROW][C]55[/C][C]-5.0309[/C][C]-1.8501[/C][C]1.4592[/C][C]42.6271[/C][C]14.4783[/C][C]3.805[/C][/ROW]
[ROW][C]56[/C][C]-2.4761[/C][C]-1.6965[/C][C]1.4931[/C][C]213.5781[/C][C]42.9211[/C][C]6.5514[/C][/ROW]
[ROW][C]57[/C][C]-2.3695[/C][C]-1.6591[/C][C]1.5138[/C][C]310.4674[/C][C]76.3644[/C][C]8.7387[/C][/ROW]
[ROW][C]58[/C][C]-2.0605[/C][C]-1.5659[/C][C]1.5196[/C][C]489.9998[/C][C]122.3239[/C][C]11.06[/C][/ROW]
[ROW][C]59[/C][C]-2.0658[/C][C]-1.8688[/C][C]1.5545[/C][C]906.9043[/C][C]200.7819[/C][C]14.1698[/C][/ROW]
[ROW][C]60[/C][C]-2.0099[/C][C]-1.747[/C][C]1.572[/C][C]1072.0157[/C][C]279.985[/C][C]16.7328[/C][/ROW]
[ROW][C]61[/C][C]-1.9987[/C][C]-1.6158[/C][C]1.5757[/C][C]1163.5629[/C][C]353.6165[/C][C]18.8047[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69481&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69481&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
500.705-0.510609.795800
511.1592-10.755328.929619.36274.4003
522.54080.52030.6772.928313.88453.7262
534.7386-0.58150.65311.931310.89623.3009
5476.95434.29251.3810.65788.84862.9747
55-5.0309-1.85011.459242.627114.47833.805
56-2.4761-1.69651.4931213.578142.92116.5514
57-2.3695-1.65911.5138310.467476.36448.7387
58-2.0605-1.56591.5196489.9998122.323911.06
59-2.0658-1.86881.5545906.9043200.781914.1698
60-2.0099-1.7471.5721072.0157279.98516.7328
61-1.9987-1.61581.57571163.5629353.616518.8047



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