Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Module--
Title produced by softwareARIMA Forecasting
Date of computationThu, 22 Dec 2011 05:01:09 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/22/t13245481073v0xaoh3ez1y64f.htm/, Retrieved Fri, 03 May 2024 05:17:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=159225, Retrieved Fri, 03 May 2024 05:17:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact108
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2010-12-24 16:20:41] [055a14fb8042f7ec27c73c5dfc3bfa50]
-   PD  [ARIMA Forecasting] [] [2010-12-28 16:53:26] [c6813a60da787bb62b5d86150b8926dd]
- R  D    [ARIMA Forecasting] [arima forecast] [2011-12-21 15:32:35] [74be16979710d4c4e7c6647856088456]
-  MP         [ARIMA Forecasting] [arima] [2011-12-22 10:01:09] [cfea828c93f35e07cca4521b1fb38047] [Current]
Feedback Forum

Post a new message
Dataseries X:
31
36
24
22
17
8
12
5
6
5
8
15
16
17
23
24
27
31
40
47
43
60
64
65
65
55
57
57
57
65
69
70
71
71
73
68
65
57
41
21
21
17
9
11
6
-2
0
5
3
7
4
8
9
14
12
12
7
15
14
19




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159225&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159225&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159225&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'Gertrude Mary Cox' @ cox.wessa.net







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])
3668-------
3765-------
3857-------
3941-------
4021-------
4121-------
4217-------
439-------
4411-------
456-------
46-2-------
470-------
485-------
4936.4782-5.924918.88130.29130.592400.5924
5076.9153-13.384627.21510.49670.647300.5734
5147.0445-19.532733.62170.41120.50130.00610.5599
5287.0827-24.724838.89020.47750.57530.19560.5511
5397.094-29.243343.43130.45910.48050.22660.545
54147.0973-33.276847.47150.36880.46320.31540.5405
55127.0983-36.947551.14410.41370.37940.46630.5372
56127.0986-40.336454.53370.41980.41980.4360.5346
5777.0987-43.499357.69670.49850.42470.5170.5324
58157.0987-46.475960.67330.38630.50140.63040.5306
59147.0987-49.295663.49310.40520.39180.59740.5291
60197.0987-51.98166.17840.34650.40950.52780.5278

\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 & 68 & - & - & - & - & - & - & - \tabularnewline
37 & 65 & - & - & - & - & - & - & - \tabularnewline
38 & 57 & - & - & - & - & - & - & - \tabularnewline
39 & 41 & - & - & - & - & - & - & - \tabularnewline
40 & 21 & - & - & - & - & - & - & - \tabularnewline
41 & 21 & - & - & - & - & - & - & - \tabularnewline
42 & 17 & - & - & - & - & - & - & - \tabularnewline
43 & 9 & - & - & - & - & - & - & - \tabularnewline
44 & 11 & - & - & - & - & - & - & - \tabularnewline
45 & 6 & - & - & - & - & - & - & - \tabularnewline
46 & -2 & - & - & - & - & - & - & - \tabularnewline
47 & 0 & - & - & - & - & - & - & - \tabularnewline
48 & 5 & - & - & - & - & - & - & - \tabularnewline
49 & 3 & 6.4782 & -5.9249 & 18.8813 & 0.2913 & 0.5924 & 0 & 0.5924 \tabularnewline
50 & 7 & 6.9153 & -13.3846 & 27.2151 & 0.4967 & 0.6473 & 0 & 0.5734 \tabularnewline
51 & 4 & 7.0445 & -19.5327 & 33.6217 & 0.4112 & 0.5013 & 0.0061 & 0.5599 \tabularnewline
52 & 8 & 7.0827 & -24.7248 & 38.8902 & 0.4775 & 0.5753 & 0.1956 & 0.5511 \tabularnewline
53 & 9 & 7.094 & -29.2433 & 43.4313 & 0.4591 & 0.4805 & 0.2266 & 0.545 \tabularnewline
54 & 14 & 7.0973 & -33.2768 & 47.4715 & 0.3688 & 0.4632 & 0.3154 & 0.5405 \tabularnewline
55 & 12 & 7.0983 & -36.9475 & 51.1441 & 0.4137 & 0.3794 & 0.4663 & 0.5372 \tabularnewline
56 & 12 & 7.0986 & -40.3364 & 54.5337 & 0.4198 & 0.4198 & 0.436 & 0.5346 \tabularnewline
57 & 7 & 7.0987 & -43.4993 & 57.6967 & 0.4985 & 0.4247 & 0.517 & 0.5324 \tabularnewline
58 & 15 & 7.0987 & -46.4759 & 60.6733 & 0.3863 & 0.5014 & 0.6304 & 0.5306 \tabularnewline
59 & 14 & 7.0987 & -49.2956 & 63.4931 & 0.4052 & 0.3918 & 0.5974 & 0.5291 \tabularnewline
60 & 19 & 7.0987 & -51.981 & 66.1784 & 0.3465 & 0.4095 & 0.5278 & 0.5278 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159225&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]68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]57[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]11[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]-2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]0[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3[/C][C]6.4782[/C][C]-5.9249[/C][C]18.8813[/C][C]0.2913[/C][C]0.5924[/C][C]0[/C][C]0.5924[/C][/ROW]
[ROW][C]50[/C][C]7[/C][C]6.9153[/C][C]-13.3846[/C][C]27.2151[/C][C]0.4967[/C][C]0.6473[/C][C]0[/C][C]0.5734[/C][/ROW]
[ROW][C]51[/C][C]4[/C][C]7.0445[/C][C]-19.5327[/C][C]33.6217[/C][C]0.4112[/C][C]0.5013[/C][C]0.0061[/C][C]0.5599[/C][/ROW]
[ROW][C]52[/C][C]8[/C][C]7.0827[/C][C]-24.7248[/C][C]38.8902[/C][C]0.4775[/C][C]0.5753[/C][C]0.1956[/C][C]0.5511[/C][/ROW]
[ROW][C]53[/C][C]9[/C][C]7.094[/C][C]-29.2433[/C][C]43.4313[/C][C]0.4591[/C][C]0.4805[/C][C]0.2266[/C][C]0.545[/C][/ROW]
[ROW][C]54[/C][C]14[/C][C]7.0973[/C][C]-33.2768[/C][C]47.4715[/C][C]0.3688[/C][C]0.4632[/C][C]0.3154[/C][C]0.5405[/C][/ROW]
[ROW][C]55[/C][C]12[/C][C]7.0983[/C][C]-36.9475[/C][C]51.1441[/C][C]0.4137[/C][C]0.3794[/C][C]0.4663[/C][C]0.5372[/C][/ROW]
[ROW][C]56[/C][C]12[/C][C]7.0986[/C][C]-40.3364[/C][C]54.5337[/C][C]0.4198[/C][C]0.4198[/C][C]0.436[/C][C]0.5346[/C][/ROW]
[ROW][C]57[/C][C]7[/C][C]7.0987[/C][C]-43.4993[/C][C]57.6967[/C][C]0.4985[/C][C]0.4247[/C][C]0.517[/C][C]0.5324[/C][/ROW]
[ROW][C]58[/C][C]15[/C][C]7.0987[/C][C]-46.4759[/C][C]60.6733[/C][C]0.3863[/C][C]0.5014[/C][C]0.6304[/C][C]0.5306[/C][/ROW]
[ROW][C]59[/C][C]14[/C][C]7.0987[/C][C]-49.2956[/C][C]63.4931[/C][C]0.4052[/C][C]0.3918[/C][C]0.5974[/C][C]0.5291[/C][/ROW]
[ROW][C]60[/C][C]19[/C][C]7.0987[/C][C]-51.981[/C][C]66.1784[/C][C]0.3465[/C][C]0.4095[/C][C]0.5278[/C][C]0.5278[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159225&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159225&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])
3668-------
3765-------
3857-------
3941-------
4021-------
4121-------
4217-------
439-------
4411-------
456-------
46-2-------
470-------
485-------
4936.4782-5.924918.88130.29130.592400.5924
5076.9153-13.384627.21510.49670.647300.5734
5147.0445-19.532733.62170.41120.50130.00610.5599
5287.0827-24.724838.89020.47750.57530.19560.5511
5397.094-29.243343.43130.45910.48050.22660.545
54147.0973-33.276847.47150.36880.46320.31540.5405
55127.0983-36.947551.14410.41370.37940.46630.5372
56127.0986-40.336454.53370.41980.41980.4360.5346
5777.0987-43.499357.69670.49850.42470.5170.5324
58157.0987-46.475960.67330.38630.50140.63040.5306
59147.0987-49.295663.49310.40520.39180.59740.5291
60197.0987-51.98166.17840.34650.40950.52780.5278







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.9768-0.5369012.098200
501.49770.01230.27460.00726.05272.4602
511.9249-0.43220.32719.26897.12482.6692
522.29130.12950.27770.84155.55392.3567
532.61340.26870.27593.63295.16972.2737
542.90240.97260.39247.646912.24933.4999
553.16590.69050.434724.026513.93173.7325
563.40930.69050.466624.023715.19323.8978
573.6366-0.01390.41630.009713.50623.6751
583.85061.11310.48662.430318.39864.2894
594.05320.97220.530247.627621.05584.5887
604.24621.67650.6257141.640331.10455.5771

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.9768 & -0.5369 & 0 & 12.0982 & 0 & 0 \tabularnewline
50 & 1.4977 & 0.0123 & 0.2746 & 0.0072 & 6.0527 & 2.4602 \tabularnewline
51 & 1.9249 & -0.4322 & 0.3271 & 9.2689 & 7.1248 & 2.6692 \tabularnewline
52 & 2.2913 & 0.1295 & 0.2777 & 0.8415 & 5.5539 & 2.3567 \tabularnewline
53 & 2.6134 & 0.2687 & 0.2759 & 3.6329 & 5.1697 & 2.2737 \tabularnewline
54 & 2.9024 & 0.9726 & 0.392 & 47.6469 & 12.2493 & 3.4999 \tabularnewline
55 & 3.1659 & 0.6905 & 0.4347 & 24.0265 & 13.9317 & 3.7325 \tabularnewline
56 & 3.4093 & 0.6905 & 0.4666 & 24.0237 & 15.1932 & 3.8978 \tabularnewline
57 & 3.6366 & -0.0139 & 0.4163 & 0.0097 & 13.5062 & 3.6751 \tabularnewline
58 & 3.8506 & 1.1131 & 0.486 & 62.4303 & 18.3986 & 4.2894 \tabularnewline
59 & 4.0532 & 0.9722 & 0.5302 & 47.6276 & 21.0558 & 4.5887 \tabularnewline
60 & 4.2462 & 1.6765 & 0.6257 & 141.6403 & 31.1045 & 5.5771 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=159225&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.9768[/C][C]-0.5369[/C][C]0[/C][C]12.0982[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]1.4977[/C][C]0.0123[/C][C]0.2746[/C][C]0.0072[/C][C]6.0527[/C][C]2.4602[/C][/ROW]
[ROW][C]51[/C][C]1.9249[/C][C]-0.4322[/C][C]0.3271[/C][C]9.2689[/C][C]7.1248[/C][C]2.6692[/C][/ROW]
[ROW][C]52[/C][C]2.2913[/C][C]0.1295[/C][C]0.2777[/C][C]0.8415[/C][C]5.5539[/C][C]2.3567[/C][/ROW]
[ROW][C]53[/C][C]2.6134[/C][C]0.2687[/C][C]0.2759[/C][C]3.6329[/C][C]5.1697[/C][C]2.2737[/C][/ROW]
[ROW][C]54[/C][C]2.9024[/C][C]0.9726[/C][C]0.392[/C][C]47.6469[/C][C]12.2493[/C][C]3.4999[/C][/ROW]
[ROW][C]55[/C][C]3.1659[/C][C]0.6905[/C][C]0.4347[/C][C]24.0265[/C][C]13.9317[/C][C]3.7325[/C][/ROW]
[ROW][C]56[/C][C]3.4093[/C][C]0.6905[/C][C]0.4666[/C][C]24.0237[/C][C]15.1932[/C][C]3.8978[/C][/ROW]
[ROW][C]57[/C][C]3.6366[/C][C]-0.0139[/C][C]0.4163[/C][C]0.0097[/C][C]13.5062[/C][C]3.6751[/C][/ROW]
[ROW][C]58[/C][C]3.8506[/C][C]1.1131[/C][C]0.486[/C][C]62.4303[/C][C]18.3986[/C][C]4.2894[/C][/ROW]
[ROW][C]59[/C][C]4.0532[/C][C]0.9722[/C][C]0.5302[/C][C]47.6276[/C][C]21.0558[/C][C]4.5887[/C][/ROW]
[ROW][C]60[/C][C]4.2462[/C][C]1.6765[/C][C]0.6257[/C][C]141.6403[/C][C]31.1045[/C][C]5.5771[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=159225&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=159225&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.9768-0.5369012.098200
501.49770.01230.27460.00726.05272.4602
511.9249-0.43220.32719.26897.12482.6692
522.29130.12950.27770.84155.55392.3567
532.61340.26870.27593.63295.16972.2737
542.90240.97260.39247.646912.24933.4999
553.16590.69050.434724.026513.93173.7325
563.40930.69050.466624.023715.19323.8978
573.6366-0.01390.41630.009713.50623.6751
583.85061.11310.48662.430318.39864.2894
594.05320.97220.530247.627621.05584.5887
604.24621.67650.6257141.640331.10455.5771



Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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')