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 computationSun, 13 Dec 2009 07:28:47 -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/13/t1260714659fbw8w6fg1pc4r1i.htm/, Retrieved Sat, 27 Apr 2024 15:03:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67298, Retrieved Sat, 27 Apr 2024 15:03:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [] [2009-12-13 14:28:47] [faa1ded5041cd5a0e2be04844f08502a] [Current]
Feedback Forum

Post a new message
Dataseries X:
24
22
25
24
29
26
26
21
23
22
21
16
19
16
25
27
23
22
23
20
24
23
20
21
22
17
21
19
23
22
15
23
21
18
18
18
18
10
13
10
9
9
6
11
9
10
9
16
10
7
7
14
11
10
6
8
13
12
15
16
16




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67298&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[46])
3418-------
3518-------
3618-------
3718-------
3810-------
3913-------
4010-------
419-------
429-------
436-------
4411-------
459-------
4610-------
4799.56523.298315.83210.42980.44590.00420.4459
48169.75432.555516.9530.04450.58140.01240.4733
49109.67211.060218.2840.47030.07490.0290.4703
5079.70780.121119.29450.28990.47620.47620.4762
5179.6923-0.870920.25540.30870.69130.26970.4772
52149.699-1.720321.11840.23020.67840.47940.4794
53119.6961-2.534721.92690.41720.24520.54440.4806
54109.6974-3.288122.68280.48180.42210.54190.4818
5569.6968-4.004423.3980.29850.48270.70150.4827
5689.697-4.683224.07730.40850.69280.42950.4835
57139.6969-5.332124.7260.33330.58760.53620.4842
58129.697-5.953925.34790.38650.33960.48490.4849
59159.697-6.55225.9460.26120.39060.53350.4854
60169.697-7.128826.52280.23140.26840.23140.4859
61169.697-7.686527.08050.23860.23860.48640.4864

\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[46]) \tabularnewline
34 & 18 & - & - & - & - & - & - & - \tabularnewline
35 & 18 & - & - & - & - & - & - & - \tabularnewline
36 & 18 & - & - & - & - & - & - & - \tabularnewline
37 & 18 & - & - & - & - & - & - & - \tabularnewline
38 & 10 & - & - & - & - & - & - & - \tabularnewline
39 & 13 & - & - & - & - & - & - & - \tabularnewline
40 & 10 & - & - & - & - & - & - & - \tabularnewline
41 & 9 & - & - & - & - & - & - & - \tabularnewline
42 & 9 & - & - & - & - & - & - & - \tabularnewline
43 & 6 & - & - & - & - & - & - & - \tabularnewline
44 & 11 & - & - & - & - & - & - & - \tabularnewline
45 & 9 & - & - & - & - & - & - & - \tabularnewline
46 & 10 & - & - & - & - & - & - & - \tabularnewline
47 & 9 & 9.5652 & 3.2983 & 15.8321 & 0.4298 & 0.4459 & 0.0042 & 0.4459 \tabularnewline
48 & 16 & 9.7543 & 2.5555 & 16.953 & 0.0445 & 0.5814 & 0.0124 & 0.4733 \tabularnewline
49 & 10 & 9.6721 & 1.0602 & 18.284 & 0.4703 & 0.0749 & 0.029 & 0.4703 \tabularnewline
50 & 7 & 9.7078 & 0.1211 & 19.2945 & 0.2899 & 0.4762 & 0.4762 & 0.4762 \tabularnewline
51 & 7 & 9.6923 & -0.8709 & 20.2554 & 0.3087 & 0.6913 & 0.2697 & 0.4772 \tabularnewline
52 & 14 & 9.699 & -1.7203 & 21.1184 & 0.2302 & 0.6784 & 0.4794 & 0.4794 \tabularnewline
53 & 11 & 9.6961 & -2.5347 & 21.9269 & 0.4172 & 0.2452 & 0.5444 & 0.4806 \tabularnewline
54 & 10 & 9.6974 & -3.2881 & 22.6828 & 0.4818 & 0.4221 & 0.5419 & 0.4818 \tabularnewline
55 & 6 & 9.6968 & -4.0044 & 23.398 & 0.2985 & 0.4827 & 0.7015 & 0.4827 \tabularnewline
56 & 8 & 9.697 & -4.6832 & 24.0773 & 0.4085 & 0.6928 & 0.4295 & 0.4835 \tabularnewline
57 & 13 & 9.6969 & -5.3321 & 24.726 & 0.3333 & 0.5876 & 0.5362 & 0.4842 \tabularnewline
58 & 12 & 9.697 & -5.9539 & 25.3479 & 0.3865 & 0.3396 & 0.4849 & 0.4849 \tabularnewline
59 & 15 & 9.697 & -6.552 & 25.946 & 0.2612 & 0.3906 & 0.5335 & 0.4854 \tabularnewline
60 & 16 & 9.697 & -7.1288 & 26.5228 & 0.2314 & 0.2684 & 0.2314 & 0.4859 \tabularnewline
61 & 16 & 9.697 & -7.6865 & 27.0805 & 0.2386 & 0.2386 & 0.4864 & 0.4864 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67298&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[46])[/C][/ROW]
[ROW][C]34[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]10[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]10[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]6[/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]9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]10[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]9[/C][C]9.5652[/C][C]3.2983[/C][C]15.8321[/C][C]0.4298[/C][C]0.4459[/C][C]0.0042[/C][C]0.4459[/C][/ROW]
[ROW][C]48[/C][C]16[/C][C]9.7543[/C][C]2.5555[/C][C]16.953[/C][C]0.0445[/C][C]0.5814[/C][C]0.0124[/C][C]0.4733[/C][/ROW]
[ROW][C]49[/C][C]10[/C][C]9.6721[/C][C]1.0602[/C][C]18.284[/C][C]0.4703[/C][C]0.0749[/C][C]0.029[/C][C]0.4703[/C][/ROW]
[ROW][C]50[/C][C]7[/C][C]9.7078[/C][C]0.1211[/C][C]19.2945[/C][C]0.2899[/C][C]0.4762[/C][C]0.4762[/C][C]0.4762[/C][/ROW]
[ROW][C]51[/C][C]7[/C][C]9.6923[/C][C]-0.8709[/C][C]20.2554[/C][C]0.3087[/C][C]0.6913[/C][C]0.2697[/C][C]0.4772[/C][/ROW]
[ROW][C]52[/C][C]14[/C][C]9.699[/C][C]-1.7203[/C][C]21.1184[/C][C]0.2302[/C][C]0.6784[/C][C]0.4794[/C][C]0.4794[/C][/ROW]
[ROW][C]53[/C][C]11[/C][C]9.6961[/C][C]-2.5347[/C][C]21.9269[/C][C]0.4172[/C][C]0.2452[/C][C]0.5444[/C][C]0.4806[/C][/ROW]
[ROW][C]54[/C][C]10[/C][C]9.6974[/C][C]-3.2881[/C][C]22.6828[/C][C]0.4818[/C][C]0.4221[/C][C]0.5419[/C][C]0.4818[/C][/ROW]
[ROW][C]55[/C][C]6[/C][C]9.6968[/C][C]-4.0044[/C][C]23.398[/C][C]0.2985[/C][C]0.4827[/C][C]0.7015[/C][C]0.4827[/C][/ROW]
[ROW][C]56[/C][C]8[/C][C]9.697[/C][C]-4.6832[/C][C]24.0773[/C][C]0.4085[/C][C]0.6928[/C][C]0.4295[/C][C]0.4835[/C][/ROW]
[ROW][C]57[/C][C]13[/C][C]9.6969[/C][C]-5.3321[/C][C]24.726[/C][C]0.3333[/C][C]0.5876[/C][C]0.5362[/C][C]0.4842[/C][/ROW]
[ROW][C]58[/C][C]12[/C][C]9.697[/C][C]-5.9539[/C][C]25.3479[/C][C]0.3865[/C][C]0.3396[/C][C]0.4849[/C][C]0.4849[/C][/ROW]
[ROW][C]59[/C][C]15[/C][C]9.697[/C][C]-6.552[/C][C]25.946[/C][C]0.2612[/C][C]0.3906[/C][C]0.5335[/C][C]0.4854[/C][/ROW]
[ROW][C]60[/C][C]16[/C][C]9.697[/C][C]-7.1288[/C][C]26.5228[/C][C]0.2314[/C][C]0.2684[/C][C]0.2314[/C][C]0.4859[/C][/ROW]
[ROW][C]61[/C][C]16[/C][C]9.697[/C][C]-7.6865[/C][C]27.0805[/C][C]0.2386[/C][C]0.2386[/C][C]0.4864[/C][C]0.4864[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67298&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67298&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[46])
3418-------
3518-------
3618-------
3718-------
3810-------
3913-------
4010-------
419-------
429-------
436-------
4411-------
459-------
4610-------
4799.56523.298315.83210.42980.44590.00420.4459
48169.75432.555516.9530.04450.58140.01240.4733
49109.67211.060218.2840.47030.07490.0290.4703
5079.70780.121119.29450.28990.47620.47620.4762
5179.6923-0.870920.25540.30870.69130.26970.4772
52149.699-1.720321.11840.23020.67840.47940.4794
53119.6961-2.534721.92690.41720.24520.54440.4806
54109.6974-3.288122.68280.48180.42210.54190.4818
5569.6968-4.004423.3980.29850.48270.70150.4827
5689.697-4.683224.07730.40850.69280.42950.4835
57139.6969-5.332124.7260.33330.58760.53620.4842
58129.697-5.953925.34790.38650.33960.48490.4849
59159.697-6.55225.9460.26120.39060.53350.4854
60169.697-7.128826.52280.23140.26840.23140.4859
61169.697-7.686527.08050.23860.23860.48640.4864







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
470.3343-0.059100.319500
480.37650.64030.349739.009319.66444.4345
490.45430.03390.24440.107513.14553.6257
500.5038-0.27890.25317.332211.69213.4194
510.556-0.27780.2587.248310.80343.2868
520.60070.44340.288918.498412.08593.4765
530.64360.13450.26681.700210.60223.2561
540.68320.03120.23740.09169.28843.0477
550.7209-0.38120.253413.66649.77483.1265
560.7566-0.1750.24552.889.08533.0142
570.79080.34060.254210.91029.25123.0416
580.82350.23750.25285.30398.92232.987
590.85490.54690.275428.122110.39923.2248
600.88530.650.302239.728112.49413.5347
610.91460.650.325439.728114.30973.7828

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
47 & 0.3343 & -0.0591 & 0 & 0.3195 & 0 & 0 \tabularnewline
48 & 0.3765 & 0.6403 & 0.3497 & 39.0093 & 19.6644 & 4.4345 \tabularnewline
49 & 0.4543 & 0.0339 & 0.2444 & 0.1075 & 13.1455 & 3.6257 \tabularnewline
50 & 0.5038 & -0.2789 & 0.2531 & 7.3322 & 11.6921 & 3.4194 \tabularnewline
51 & 0.556 & -0.2778 & 0.258 & 7.2483 & 10.8034 & 3.2868 \tabularnewline
52 & 0.6007 & 0.4434 & 0.2889 & 18.4984 & 12.0859 & 3.4765 \tabularnewline
53 & 0.6436 & 0.1345 & 0.2668 & 1.7002 & 10.6022 & 3.2561 \tabularnewline
54 & 0.6832 & 0.0312 & 0.2374 & 0.0916 & 9.2884 & 3.0477 \tabularnewline
55 & 0.7209 & -0.3812 & 0.2534 & 13.6664 & 9.7748 & 3.1265 \tabularnewline
56 & 0.7566 & -0.175 & 0.2455 & 2.88 & 9.0853 & 3.0142 \tabularnewline
57 & 0.7908 & 0.3406 & 0.2542 & 10.9102 & 9.2512 & 3.0416 \tabularnewline
58 & 0.8235 & 0.2375 & 0.2528 & 5.3039 & 8.9223 & 2.987 \tabularnewline
59 & 0.8549 & 0.5469 & 0.2754 & 28.1221 & 10.3992 & 3.2248 \tabularnewline
60 & 0.8853 & 0.65 & 0.3022 & 39.7281 & 12.4941 & 3.5347 \tabularnewline
61 & 0.9146 & 0.65 & 0.3254 & 39.7281 & 14.3097 & 3.7828 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67298&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]47[/C][C]0.3343[/C][C]-0.0591[/C][C]0[/C][C]0.3195[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]48[/C][C]0.3765[/C][C]0.6403[/C][C]0.3497[/C][C]39.0093[/C][C]19.6644[/C][C]4.4345[/C][/ROW]
[ROW][C]49[/C][C]0.4543[/C][C]0.0339[/C][C]0.2444[/C][C]0.1075[/C][C]13.1455[/C][C]3.6257[/C][/ROW]
[ROW][C]50[/C][C]0.5038[/C][C]-0.2789[/C][C]0.2531[/C][C]7.3322[/C][C]11.6921[/C][C]3.4194[/C][/ROW]
[ROW][C]51[/C][C]0.556[/C][C]-0.2778[/C][C]0.258[/C][C]7.2483[/C][C]10.8034[/C][C]3.2868[/C][/ROW]
[ROW][C]52[/C][C]0.6007[/C][C]0.4434[/C][C]0.2889[/C][C]18.4984[/C][C]12.0859[/C][C]3.4765[/C][/ROW]
[ROW][C]53[/C][C]0.6436[/C][C]0.1345[/C][C]0.2668[/C][C]1.7002[/C][C]10.6022[/C][C]3.2561[/C][/ROW]
[ROW][C]54[/C][C]0.6832[/C][C]0.0312[/C][C]0.2374[/C][C]0.0916[/C][C]9.2884[/C][C]3.0477[/C][/ROW]
[ROW][C]55[/C][C]0.7209[/C][C]-0.3812[/C][C]0.2534[/C][C]13.6664[/C][C]9.7748[/C][C]3.1265[/C][/ROW]
[ROW][C]56[/C][C]0.7566[/C][C]-0.175[/C][C]0.2455[/C][C]2.88[/C][C]9.0853[/C][C]3.0142[/C][/ROW]
[ROW][C]57[/C][C]0.7908[/C][C]0.3406[/C][C]0.2542[/C][C]10.9102[/C][C]9.2512[/C][C]3.0416[/C][/ROW]
[ROW][C]58[/C][C]0.8235[/C][C]0.2375[/C][C]0.2528[/C][C]5.3039[/C][C]8.9223[/C][C]2.987[/C][/ROW]
[ROW][C]59[/C][C]0.8549[/C][C]0.5469[/C][C]0.2754[/C][C]28.1221[/C][C]10.3992[/C][C]3.2248[/C][/ROW]
[ROW][C]60[/C][C]0.8853[/C][C]0.65[/C][C]0.3022[/C][C]39.7281[/C][C]12.4941[/C][C]3.5347[/C][/ROW]
[ROW][C]61[/C][C]0.9146[/C][C]0.65[/C][C]0.3254[/C][C]39.7281[/C][C]14.3097[/C][C]3.7828[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67298&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67298&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
470.3343-0.059100.319500
480.37650.64030.349739.009319.66444.4345
490.45430.03390.24440.107513.14553.6257
500.5038-0.27890.25317.332211.69213.4194
510.556-0.27780.2587.248310.80343.2868
520.60070.44340.288918.498412.08593.4765
530.64360.13450.26681.700210.60223.2561
540.68320.03120.23740.09169.28843.0477
550.7209-0.38120.253413.66649.77483.1265
560.7566-0.1750.24552.889.08533.0142
570.79080.34060.254210.91029.25123.0416
580.82350.23750.25285.30398.92232.987
590.85490.54690.275428.122110.39923.2248
600.88530.650.302239.728112.49413.5347
610.91460.650.325439.728114.30973.7828



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