Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 30 Dec 2009 06:28: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/30/t1262179922qvdy8u1nfadltco.htm/, Retrieved Mon, 29 Apr 2024 04:59:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71271, Retrieved Mon, 29 Apr 2024 04:59:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact160
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
F RMP   [ARIMA Backward Selection] [ARIMA Backward Se...] [2008-12-06 10:27:24] [c94d7012e41b73cfa20d93e879679ede]
-   PD    [ARIMA Backward Selection] [ARIMA backward se...] [2008-12-14 08:46:35] [12d343c4448a5f9e527bb31caeac580b]
- RMPD        [ARIMA Forecasting] [Paper Forecasting] [2009-12-30 13:28:42] [40c1a6696fd12c035173887b10978c8d] [Current]
Feedback Forum

Post a new message
Dataseries X:
10001.60
10411.75
10673.38
10539.51
10723.78
10682.06
10283.19
10377.18
10486.64
10545.38
10554.27
10532.54
10324.31
10695.25
10827.81
10872.48
10971.19
11145.65
11234.68
11333.88
10997.97
11036.89
11257.35
11533.59
11963.12
12185.15
12377.62
12512.89
12631.48
12268.53
12754.80
13407.75
13480.21
13673.28
13239.71
13557.69
13901.28
13200.58
13406.97
12538.12
12419.57
12193.88
12656.63
12812.48
12056.67
11322.38
11530.75
11114.08
9181.73
8614.55
8595.56
8396.20
7690.50
7235.47
7992.12
8398.37
8593.01
8679.75
9374.63
9634.97




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71271&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[48])
3613557.69-------
3713901.28-------
3813200.58-------
3913406.97-------
4012538.12-------
4112419.57-------
4212193.88-------
4312656.63-------
4412812.48-------
4512056.67-------
4611322.38-------
4711530.75-------
4811114.08-------
499181.7311108.744610442.553311774.93600.493700.4937
508614.5511087.88710130.226212045.54780100.4786
518595.5611093.24579913.670512272.8209011e-040.4862
528396.211068.23019702.31912434.14131e-040.99980.01750.4738
537690.511064.56839534.852712594.283900.99970.04130.4747
547235.4711059.17339381.571912736.7747010.09250.4744
557992.1211071.04649257.579212884.51354e-0410.04330.4815
568398.3711073.75239133.912113013.59240.00340.99910.03950.4837
578593.0111052.0138993.543613110.48240.00960.99420.16940.4764
588679.7511030.65828860.033213201.28320.01690.98610.39610.47
599374.6311037.78598760.522313315.04950.07620.97880.33570.4738
609634.9711025.17728646.0513404.30440.1260.9130.47080.4708

\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 & 13557.69 & - & - & - & - & - & - & - \tabularnewline
37 & 13901.28 & - & - & - & - & - & - & - \tabularnewline
38 & 13200.58 & - & - & - & - & - & - & - \tabularnewline
39 & 13406.97 & - & - & - & - & - & - & - \tabularnewline
40 & 12538.12 & - & - & - & - & - & - & - \tabularnewline
41 & 12419.57 & - & - & - & - & - & - & - \tabularnewline
42 & 12193.88 & - & - & - & - & - & - & - \tabularnewline
43 & 12656.63 & - & - & - & - & - & - & - \tabularnewline
44 & 12812.48 & - & - & - & - & - & - & - \tabularnewline
45 & 12056.67 & - & - & - & - & - & - & - \tabularnewline
46 & 11322.38 & - & - & - & - & - & - & - \tabularnewline
47 & 11530.75 & - & - & - & - & - & - & - \tabularnewline
48 & 11114.08 & - & - & - & - & - & - & - \tabularnewline
49 & 9181.73 & 11108.7446 & 10442.5533 & 11774.936 & 0 & 0.4937 & 0 & 0.4937 \tabularnewline
50 & 8614.55 & 11087.887 & 10130.2262 & 12045.5478 & 0 & 1 & 0 & 0.4786 \tabularnewline
51 & 8595.56 & 11093.2457 & 9913.6705 & 12272.8209 & 0 & 1 & 1e-04 & 0.4862 \tabularnewline
52 & 8396.2 & 11068.2301 & 9702.319 & 12434.1413 & 1e-04 & 0.9998 & 0.0175 & 0.4738 \tabularnewline
53 & 7690.5 & 11064.5683 & 9534.8527 & 12594.2839 & 0 & 0.9997 & 0.0413 & 0.4747 \tabularnewline
54 & 7235.47 & 11059.1733 & 9381.5719 & 12736.7747 & 0 & 1 & 0.0925 & 0.4744 \tabularnewline
55 & 7992.12 & 11071.0464 & 9257.5792 & 12884.5135 & 4e-04 & 1 & 0.0433 & 0.4815 \tabularnewline
56 & 8398.37 & 11073.7523 & 9133.9121 & 13013.5924 & 0.0034 & 0.9991 & 0.0395 & 0.4837 \tabularnewline
57 & 8593.01 & 11052.013 & 8993.5436 & 13110.4824 & 0.0096 & 0.9942 & 0.1694 & 0.4764 \tabularnewline
58 & 8679.75 & 11030.6582 & 8860.0332 & 13201.2832 & 0.0169 & 0.9861 & 0.3961 & 0.47 \tabularnewline
59 & 9374.63 & 11037.7859 & 8760.5223 & 13315.0495 & 0.0762 & 0.9788 & 0.3357 & 0.4738 \tabularnewline
60 & 9634.97 & 11025.1772 & 8646.05 & 13404.3044 & 0.126 & 0.913 & 0.4708 & 0.4708 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71271&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]13557.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]13901.28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]13200.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]13406.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]12538.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]12419.57[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]12193.88[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]12656.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]12812.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]12056.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]11322.38[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]11530.75[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]11114.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]9181.73[/C][C]11108.7446[/C][C]10442.5533[/C][C]11774.936[/C][C]0[/C][C]0.4937[/C][C]0[/C][C]0.4937[/C][/ROW]
[ROW][C]50[/C][C]8614.55[/C][C]11087.887[/C][C]10130.2262[/C][C]12045.5478[/C][C]0[/C][C]1[/C][C]0[/C][C]0.4786[/C][/ROW]
[ROW][C]51[/C][C]8595.56[/C][C]11093.2457[/C][C]9913.6705[/C][C]12272.8209[/C][C]0[/C][C]1[/C][C]1e-04[/C][C]0.4862[/C][/ROW]
[ROW][C]52[/C][C]8396.2[/C][C]11068.2301[/C][C]9702.319[/C][C]12434.1413[/C][C]1e-04[/C][C]0.9998[/C][C]0.0175[/C][C]0.4738[/C][/ROW]
[ROW][C]53[/C][C]7690.5[/C][C]11064.5683[/C][C]9534.8527[/C][C]12594.2839[/C][C]0[/C][C]0.9997[/C][C]0.0413[/C][C]0.4747[/C][/ROW]
[ROW][C]54[/C][C]7235.47[/C][C]11059.1733[/C][C]9381.5719[/C][C]12736.7747[/C][C]0[/C][C]1[/C][C]0.0925[/C][C]0.4744[/C][/ROW]
[ROW][C]55[/C][C]7992.12[/C][C]11071.0464[/C][C]9257.5792[/C][C]12884.5135[/C][C]4e-04[/C][C]1[/C][C]0.0433[/C][C]0.4815[/C][/ROW]
[ROW][C]56[/C][C]8398.37[/C][C]11073.7523[/C][C]9133.9121[/C][C]13013.5924[/C][C]0.0034[/C][C]0.9991[/C][C]0.0395[/C][C]0.4837[/C][/ROW]
[ROW][C]57[/C][C]8593.01[/C][C]11052.013[/C][C]8993.5436[/C][C]13110.4824[/C][C]0.0096[/C][C]0.9942[/C][C]0.1694[/C][C]0.4764[/C][/ROW]
[ROW][C]58[/C][C]8679.75[/C][C]11030.6582[/C][C]8860.0332[/C][C]13201.2832[/C][C]0.0169[/C][C]0.9861[/C][C]0.3961[/C][C]0.47[/C][/ROW]
[ROW][C]59[/C][C]9374.63[/C][C]11037.7859[/C][C]8760.5223[/C][C]13315.0495[/C][C]0.0762[/C][C]0.9788[/C][C]0.3357[/C][C]0.4738[/C][/ROW]
[ROW][C]60[/C][C]9634.97[/C][C]11025.1772[/C][C]8646.05[/C][C]13404.3044[/C][C]0.126[/C][C]0.913[/C][C]0.4708[/C][C]0.4708[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71271&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71271&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])
3613557.69-------
3713901.28-------
3813200.58-------
3913406.97-------
4012538.12-------
4112419.57-------
4212193.88-------
4312656.63-------
4412812.48-------
4512056.67-------
4611322.38-------
4711530.75-------
4811114.08-------
499181.7311108.744610442.553311774.93600.493700.4937
508614.5511087.88710130.226212045.54780100.4786
518595.5611093.24579913.670512272.8209011e-040.4862
528396.211068.23019702.31912434.14131e-040.99980.01750.4738
537690.511064.56839534.852712594.283900.99970.04130.4747
547235.4711059.17339381.571912736.7747010.09250.4744
557992.1211071.04649257.579212884.51354e-0410.04330.4815
568398.3711073.75239133.912113013.59240.00340.99910.03950.4837
578593.0111052.0138993.543613110.48240.00960.99420.16940.4764
588679.7511030.65828860.033213201.28320.01690.98610.39610.47
599374.6311037.78598760.522313315.04950.07620.97880.33570.4738
609634.9711025.17728646.0513404.30440.1260.9130.47080.4708







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0306-0.173503713385.30400
500.0441-0.22310.19836117396.04344915390.67372217.068
510.0543-0.22520.20726238434.03565356405.12772314.3909
520.063-0.24140.21587139744.95285802240.08392408.7839
530.0705-0.30490.233611384336.71216918659.40962630.3345
540.0774-0.34570.252314620706.66168202333.95162863.9717
550.0836-0.27810.2569479787.63098384827.33432895.6566
560.0894-0.24160.25427157670.22588231432.69582869.0473
570.095-0.22250.25076046695.97927988684.17172826.426
580.1004-0.21310.24695526769.54537742492.70912782.5335
590.1053-0.15070.23822766087.56277290092.24122700.0171
600.1101-0.12610.22881932676.14086843640.89952616.0353

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0306 & -0.1735 & 0 & 3713385.304 & 0 & 0 \tabularnewline
50 & 0.0441 & -0.2231 & 0.1983 & 6117396.0434 & 4915390.6737 & 2217.068 \tabularnewline
51 & 0.0543 & -0.2252 & 0.2072 & 6238434.0356 & 5356405.1277 & 2314.3909 \tabularnewline
52 & 0.063 & -0.2414 & 0.2158 & 7139744.9528 & 5802240.0839 & 2408.7839 \tabularnewline
53 & 0.0705 & -0.3049 & 0.2336 & 11384336.7121 & 6918659.4096 & 2630.3345 \tabularnewline
54 & 0.0774 & -0.3457 & 0.2523 & 14620706.6616 & 8202333.9516 & 2863.9717 \tabularnewline
55 & 0.0836 & -0.2781 & 0.256 & 9479787.6309 & 8384827.3343 & 2895.6566 \tabularnewline
56 & 0.0894 & -0.2416 & 0.2542 & 7157670.2258 & 8231432.6958 & 2869.0473 \tabularnewline
57 & 0.095 & -0.2225 & 0.2507 & 6046695.9792 & 7988684.1717 & 2826.426 \tabularnewline
58 & 0.1004 & -0.2131 & 0.2469 & 5526769.5453 & 7742492.7091 & 2782.5335 \tabularnewline
59 & 0.1053 & -0.1507 & 0.2382 & 2766087.5627 & 7290092.2412 & 2700.0171 \tabularnewline
60 & 0.1101 & -0.1261 & 0.2288 & 1932676.1408 & 6843640.8995 & 2616.0353 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71271&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.0306[/C][C]-0.1735[/C][C]0[/C][C]3713385.304[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0441[/C][C]-0.2231[/C][C]0.1983[/C][C]6117396.0434[/C][C]4915390.6737[/C][C]2217.068[/C][/ROW]
[ROW][C]51[/C][C]0.0543[/C][C]-0.2252[/C][C]0.2072[/C][C]6238434.0356[/C][C]5356405.1277[/C][C]2314.3909[/C][/ROW]
[ROW][C]52[/C][C]0.063[/C][C]-0.2414[/C][C]0.2158[/C][C]7139744.9528[/C][C]5802240.0839[/C][C]2408.7839[/C][/ROW]
[ROW][C]53[/C][C]0.0705[/C][C]-0.3049[/C][C]0.2336[/C][C]11384336.7121[/C][C]6918659.4096[/C][C]2630.3345[/C][/ROW]
[ROW][C]54[/C][C]0.0774[/C][C]-0.3457[/C][C]0.2523[/C][C]14620706.6616[/C][C]8202333.9516[/C][C]2863.9717[/C][/ROW]
[ROW][C]55[/C][C]0.0836[/C][C]-0.2781[/C][C]0.256[/C][C]9479787.6309[/C][C]8384827.3343[/C][C]2895.6566[/C][/ROW]
[ROW][C]56[/C][C]0.0894[/C][C]-0.2416[/C][C]0.2542[/C][C]7157670.2258[/C][C]8231432.6958[/C][C]2869.0473[/C][/ROW]
[ROW][C]57[/C][C]0.095[/C][C]-0.2225[/C][C]0.2507[/C][C]6046695.9792[/C][C]7988684.1717[/C][C]2826.426[/C][/ROW]
[ROW][C]58[/C][C]0.1004[/C][C]-0.2131[/C][C]0.2469[/C][C]5526769.5453[/C][C]7742492.7091[/C][C]2782.5335[/C][/ROW]
[ROW][C]59[/C][C]0.1053[/C][C]-0.1507[/C][C]0.2382[/C][C]2766087.5627[/C][C]7290092.2412[/C][C]2700.0171[/C][/ROW]
[ROW][C]60[/C][C]0.1101[/C][C]-0.1261[/C][C]0.2288[/C][C]1932676.1408[/C][C]6843640.8995[/C][C]2616.0353[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71271&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71271&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.0306-0.173503713385.30400
500.0441-0.22310.19836117396.04344915390.67372217.068
510.0543-0.22520.20726238434.03565356405.12772314.3909
520.063-0.24140.21587139744.95285802240.08392408.7839
530.0705-0.30490.233611384336.71216918659.40962630.3345
540.0774-0.34570.252314620706.66168202333.95162863.9717
550.0836-0.27810.2569479787.63098384827.33432895.6566
560.0894-0.24160.25427157670.22588231432.69582869.0473
570.095-0.22250.25076046695.97927988684.17172826.426
580.1004-0.21310.24695526769.54537742492.70912782.5335
590.1053-0.15070.23822766087.56277290092.24122700.0171
600.1101-0.12610.22881932676.14086843640.89952616.0353



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