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 computationTue, 14 Dec 2010 14:12:08 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/14/t1292335814k67wthn6qizujpz.htm/, Retrieved Thu, 02 May 2024 18:22:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=109670, Retrieved Thu, 02 May 2024 18:22:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact144
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMPD  [ARIMA Backward Selection] [] [2010-12-14 13:44:15] [42a441ca3193af442aa2201743dfb347]
- RM        [ARIMA Forecasting] [] [2010-12-14 14:12:08] [ef8aba939446289dd59b403ac33ef077] [Current]
-   P         [ARIMA Forecasting] [] [2010-12-21 11:45:21] [07fa8844ca5618cd0482008937d9acea]
Feedback Forum

Post a new message
Dataseries X:
19876
45335
48674
156392
100837
101605
532850
294189
80763
105995
25045
90474
48481
50730
68694
207716
99132
104012
422632
364974
82687
66834
28408
97073
40284
24421
116346
72120
108751
91738
402216
390070
106045
110070
70668
167841
28607
95371
30605
131063
81214
85451
455196
454570
63114
74287
42350
113375




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109670&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109670&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109670&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'George Udny Yule' @ 72.249.76.132







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[36])
2497073-------
2540284-------
2624421-------
27116346-------
2872120-------
29108751-------
3091738-------
31402216-------
32390070-------
33106045-------
34110070-------
3570668-------
36167841-------
372860731581.9225-58845.5113122009.35630.47430.00160.42520.0016
389537135485.4166-56450.8825127421.71570.10090.55830.59320.0024
3930605107468.666514990.5245199946.80850.05160.60120.42540.1004
4013106392347.6566-182.7381184878.05130.20610.90450.66580.0549
4181214107047.68914507.6067199587.77140.29210.30550.48560.0989
428545193617.63711076.2854186158.98880.43130.60360.51590.058
43455196405068.2293312526.6786497609.77990.144210.52411
44454570386521.4895293979.9105479063.06850.07480.07290.471
4563114102716.509810174.9266195258.09310.200800.47190.0839
4674287103925.639811384.0559196467.22370.26510.80630.44820.0879
474235064658.4232-27883.1608157200.00720.31830.41920.44940.0144
48113375157779.718965238.1349250321.3030.17350.99280.41560.4156

\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[36]) \tabularnewline
24 & 97073 & - & - & - & - & - & - & - \tabularnewline
25 & 40284 & - & - & - & - & - & - & - \tabularnewline
26 & 24421 & - & - & - & - & - & - & - \tabularnewline
27 & 116346 & - & - & - & - & - & - & - \tabularnewline
28 & 72120 & - & - & - & - & - & - & - \tabularnewline
29 & 108751 & - & - & - & - & - & - & - \tabularnewline
30 & 91738 & - & - & - & - & - & - & - \tabularnewline
31 & 402216 & - & - & - & - & - & - & - \tabularnewline
32 & 390070 & - & - & - & - & - & - & - \tabularnewline
33 & 106045 & - & - & - & - & - & - & - \tabularnewline
34 & 110070 & - & - & - & - & - & - & - \tabularnewline
35 & 70668 & - & - & - & - & - & - & - \tabularnewline
36 & 167841 & - & - & - & - & - & - & - \tabularnewline
37 & 28607 & 31581.9225 & -58845.5113 & 122009.3563 & 0.4743 & 0.0016 & 0.4252 & 0.0016 \tabularnewline
38 & 95371 & 35485.4166 & -56450.8825 & 127421.7157 & 0.1009 & 0.5583 & 0.5932 & 0.0024 \tabularnewline
39 & 30605 & 107468.6665 & 14990.5245 & 199946.8085 & 0.0516 & 0.6012 & 0.4254 & 0.1004 \tabularnewline
40 & 131063 & 92347.6566 & -182.7381 & 184878.0513 & 0.2061 & 0.9045 & 0.6658 & 0.0549 \tabularnewline
41 & 81214 & 107047.689 & 14507.6067 & 199587.7714 & 0.2921 & 0.3055 & 0.4856 & 0.0989 \tabularnewline
42 & 85451 & 93617.6371 & 1076.2854 & 186158.9888 & 0.4313 & 0.6036 & 0.5159 & 0.058 \tabularnewline
43 & 455196 & 405068.2293 & 312526.6786 & 497609.7799 & 0.1442 & 1 & 0.5241 & 1 \tabularnewline
44 & 454570 & 386521.4895 & 293979.9105 & 479063.0685 & 0.0748 & 0.0729 & 0.47 & 1 \tabularnewline
45 & 63114 & 102716.5098 & 10174.9266 & 195258.0931 & 0.2008 & 0 & 0.4719 & 0.0839 \tabularnewline
46 & 74287 & 103925.6398 & 11384.0559 & 196467.2237 & 0.2651 & 0.8063 & 0.4482 & 0.0879 \tabularnewline
47 & 42350 & 64658.4232 & -27883.1608 & 157200.0072 & 0.3183 & 0.4192 & 0.4494 & 0.0144 \tabularnewline
48 & 113375 & 157779.7189 & 65238.1349 & 250321.303 & 0.1735 & 0.9928 & 0.4156 & 0.4156 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109670&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[36])[/C][/ROW]
[ROW][C]24[/C][C]97073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]40284[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]24421[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]116346[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]72120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]108751[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]91738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]402216[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]390070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]106045[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]110070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]70668[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]167841[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]28607[/C][C]31581.9225[/C][C]-58845.5113[/C][C]122009.3563[/C][C]0.4743[/C][C]0.0016[/C][C]0.4252[/C][C]0.0016[/C][/ROW]
[ROW][C]38[/C][C]95371[/C][C]35485.4166[/C][C]-56450.8825[/C][C]127421.7157[/C][C]0.1009[/C][C]0.5583[/C][C]0.5932[/C][C]0.0024[/C][/ROW]
[ROW][C]39[/C][C]30605[/C][C]107468.6665[/C][C]14990.5245[/C][C]199946.8085[/C][C]0.0516[/C][C]0.6012[/C][C]0.4254[/C][C]0.1004[/C][/ROW]
[ROW][C]40[/C][C]131063[/C][C]92347.6566[/C][C]-182.7381[/C][C]184878.0513[/C][C]0.2061[/C][C]0.9045[/C][C]0.6658[/C][C]0.0549[/C][/ROW]
[ROW][C]41[/C][C]81214[/C][C]107047.689[/C][C]14507.6067[/C][C]199587.7714[/C][C]0.2921[/C][C]0.3055[/C][C]0.4856[/C][C]0.0989[/C][/ROW]
[ROW][C]42[/C][C]85451[/C][C]93617.6371[/C][C]1076.2854[/C][C]186158.9888[/C][C]0.4313[/C][C]0.6036[/C][C]0.5159[/C][C]0.058[/C][/ROW]
[ROW][C]43[/C][C]455196[/C][C]405068.2293[/C][C]312526.6786[/C][C]497609.7799[/C][C]0.1442[/C][C]1[/C][C]0.5241[/C][C]1[/C][/ROW]
[ROW][C]44[/C][C]454570[/C][C]386521.4895[/C][C]293979.9105[/C][C]479063.0685[/C][C]0.0748[/C][C]0.0729[/C][C]0.47[/C][C]1[/C][/ROW]
[ROW][C]45[/C][C]63114[/C][C]102716.5098[/C][C]10174.9266[/C][C]195258.0931[/C][C]0.2008[/C][C]0[/C][C]0.4719[/C][C]0.0839[/C][/ROW]
[ROW][C]46[/C][C]74287[/C][C]103925.6398[/C][C]11384.0559[/C][C]196467.2237[/C][C]0.2651[/C][C]0.8063[/C][C]0.4482[/C][C]0.0879[/C][/ROW]
[ROW][C]47[/C][C]42350[/C][C]64658.4232[/C][C]-27883.1608[/C][C]157200.0072[/C][C]0.3183[/C][C]0.4192[/C][C]0.4494[/C][C]0.0144[/C][/ROW]
[ROW][C]48[/C][C]113375[/C][C]157779.7189[/C][C]65238.1349[/C][C]250321.303[/C][C]0.1735[/C][C]0.9928[/C][C]0.4156[/C][C]0.4156[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109670&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109670&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[36])
2497073-------
2540284-------
2624421-------
27116346-------
2872120-------
29108751-------
3091738-------
31402216-------
32390070-------
33106045-------
34110070-------
3570668-------
36167841-------
372860731581.9225-58845.5113122009.35630.47430.00160.42520.0016
389537135485.4166-56450.8825127421.71570.10090.55830.59320.0024
3930605107468.666514990.5245199946.80850.05160.60120.42540.1004
4013106392347.6566-182.7381184878.05130.20610.90450.66580.0549
4181214107047.68914507.6067199587.77140.29210.30550.48560.0989
428545193617.63711076.2854186158.98880.43130.60360.51590.058
43455196405068.2293312526.6786497609.77990.144210.52411
44454570386521.4895293979.9105479063.06850.07480.07290.471
4563114102716.509810174.9266195258.09310.200800.47190.0839
4674287103925.639811384.0559196467.22370.26510.80630.44820.0879
474235064658.4232-27883.1608157200.00720.31830.41920.44940.0144
48113375157779.718965238.1349250321.3030.17350.99280.41560.4156







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
371.4608-0.094208850163.731800
381.32181.68760.89093586283098.53081797566631.131342397.7196
390.439-0.71520.83235908023224.22363167718828.828756282.4913
400.51120.41920.72911498877815.80192750508575.57252445.2913
410.4411-0.24130.6315667379488.82582333882758.222848310.2759
420.5043-0.08720.540866693961.55711956017958.778544226.8918
430.11660.12380.48122512793395.66692035557306.905445117.1509
440.12220.17610.44314630599779.90842359937616.030848579.1891
450.4597-0.38560.43671568358785.65882271984412.656147665.3376
460.4543-0.28520.4215878448966.97622132630868.088146180.4165
470.7302-0.3450.4146497665746.57491983997675.223344542.0888
480.2992-0.28140.40351971779064.84291982979457.691644530.6575

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
37 & 1.4608 & -0.0942 & 0 & 8850163.7318 & 0 & 0 \tabularnewline
38 & 1.3218 & 1.6876 & 0.8909 & 3586283098.5308 & 1797566631.1313 & 42397.7196 \tabularnewline
39 & 0.439 & -0.7152 & 0.8323 & 5908023224.2236 & 3167718828.8287 & 56282.4913 \tabularnewline
40 & 0.5112 & 0.4192 & 0.7291 & 1498877815.8019 & 2750508575.572 & 52445.2913 \tabularnewline
41 & 0.4411 & -0.2413 & 0.6315 & 667379488.8258 & 2333882758.2228 & 48310.2759 \tabularnewline
42 & 0.5043 & -0.0872 & 0.5408 & 66693961.5571 & 1956017958.7785 & 44226.8918 \tabularnewline
43 & 0.1166 & 0.1238 & 0.4812 & 2512793395.6669 & 2035557306.9054 & 45117.1509 \tabularnewline
44 & 0.1222 & 0.1761 & 0.4431 & 4630599779.9084 & 2359937616.0308 & 48579.1891 \tabularnewline
45 & 0.4597 & -0.3856 & 0.4367 & 1568358785.6588 & 2271984412.6561 & 47665.3376 \tabularnewline
46 & 0.4543 & -0.2852 & 0.4215 & 878448966.9762 & 2132630868.0881 & 46180.4165 \tabularnewline
47 & 0.7302 & -0.345 & 0.4146 & 497665746.5749 & 1983997675.2233 & 44542.0888 \tabularnewline
48 & 0.2992 & -0.2814 & 0.4035 & 1971779064.8429 & 1982979457.6916 & 44530.6575 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109670&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]37[/C][C]1.4608[/C][C]-0.0942[/C][C]0[/C][C]8850163.7318[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]38[/C][C]1.3218[/C][C]1.6876[/C][C]0.8909[/C][C]3586283098.5308[/C][C]1797566631.1313[/C][C]42397.7196[/C][/ROW]
[ROW][C]39[/C][C]0.439[/C][C]-0.7152[/C][C]0.8323[/C][C]5908023224.2236[/C][C]3167718828.8287[/C][C]56282.4913[/C][/ROW]
[ROW][C]40[/C][C]0.5112[/C][C]0.4192[/C][C]0.7291[/C][C]1498877815.8019[/C][C]2750508575.572[/C][C]52445.2913[/C][/ROW]
[ROW][C]41[/C][C]0.4411[/C][C]-0.2413[/C][C]0.6315[/C][C]667379488.8258[/C][C]2333882758.2228[/C][C]48310.2759[/C][/ROW]
[ROW][C]42[/C][C]0.5043[/C][C]-0.0872[/C][C]0.5408[/C][C]66693961.5571[/C][C]1956017958.7785[/C][C]44226.8918[/C][/ROW]
[ROW][C]43[/C][C]0.1166[/C][C]0.1238[/C][C]0.4812[/C][C]2512793395.6669[/C][C]2035557306.9054[/C][C]45117.1509[/C][/ROW]
[ROW][C]44[/C][C]0.1222[/C][C]0.1761[/C][C]0.4431[/C][C]4630599779.9084[/C][C]2359937616.0308[/C][C]48579.1891[/C][/ROW]
[ROW][C]45[/C][C]0.4597[/C][C]-0.3856[/C][C]0.4367[/C][C]1568358785.6588[/C][C]2271984412.6561[/C][C]47665.3376[/C][/ROW]
[ROW][C]46[/C][C]0.4543[/C][C]-0.2852[/C][C]0.4215[/C][C]878448966.9762[/C][C]2132630868.0881[/C][C]46180.4165[/C][/ROW]
[ROW][C]47[/C][C]0.7302[/C][C]-0.345[/C][C]0.4146[/C][C]497665746.5749[/C][C]1983997675.2233[/C][C]44542.0888[/C][/ROW]
[ROW][C]48[/C][C]0.2992[/C][C]-0.2814[/C][C]0.4035[/C][C]1971779064.8429[/C][C]1982979457.6916[/C][C]44530.6575[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109670&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109670&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
371.4608-0.094208850163.731800
381.32181.68760.89093586283098.53081797566631.131342397.7196
390.439-0.71520.83235908023224.22363167718828.828756282.4913
400.51120.41920.72911498877815.80192750508575.57252445.2913
410.4411-0.24130.6315667379488.82582333882758.222848310.2759
420.5043-0.08720.540866693961.55711956017958.778544226.8918
430.11660.12380.48122512793395.66692035557306.905445117.1509
440.12220.17610.44314630599779.90842359937616.030848579.1891
450.4597-0.38560.43671568358785.65882271984412.656147665.3376
460.4543-0.28520.4215878448966.97622132630868.088146180.4165
470.7302-0.3450.4146497665746.57491983997675.223344542.0888
480.2992-0.28140.40351971779064.84291982979457.691644530.6575



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