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, 28 Dec 2010 17:28:42 +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/28/t1293557214vryxif6d6cyjcao.htm/, Retrieved Fri, 03 May 2024 12:33:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116439, Retrieved Fri, 03 May 2024 12:33:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact140
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Q1 The Seatbeltlaw] [2007-11-14 19:27:43] [8cd6641b921d30ebe00b648d1481bba0]
- RM D  [Multiple Regression] [Seatbelt] [2009-11-12 14:06:21] [b98453cac15ba1066b407e146608df68]
- R PD    [Multiple Regression] [] [2009-11-19 08:06:13] [639dd97b6eeebe46a3c92d62cb04fb95]
- RMPD      [ARIMA Forecasting] [] [2009-12-14 08:41:55] [639dd97b6eeebe46a3c92d62cb04fb95]
-   PD        [ARIMA Forecasting] [] [2009-12-19 10:06:44] [ea26ab7ea3bba830cfeb08d06278d52c]
- R PD          [ARIMA Forecasting] [Arima forecast 6 ...] [2009-12-21 17:12:24] [9dbb467a28ad600d808a4e47d5e0774e]
-   P             [ARIMA Forecasting] [Arima forecast 12...] [2009-12-21 17:19:37] [9dbb467a28ad600d808a4e47d5e0774e]
-                     [ARIMA Forecasting] [paper] [2010-12-28 17:28:42] [a4671b53c9c003ef222bf9d29c2203ca] [Current]
Feedback Forum

Post a new message
Dataseries X:
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time8 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 & 8 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116439&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]8 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=116439&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116439&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 time8 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[48])
3613807-------
3729743-------
3825591-------
3929096-------
4026482-------
4122405-------
4227044-------
4317970-------
4418730-------
4519684-------
4619785-------
4718479-------
4810698-------
493195625996.16420111.697933602.36160.062310.16711
502950622367.206916943.045129527.86470.02530.00430.18880.9993
513450625430.66918889.734334236.52860.02170.18220.20730.9995
522716523145.964316879.479431738.87360.17960.00480.22330.9977
532673619582.559114034.887427323.09930.0350.02740.23740.9878
542369123637.167116663.454233529.40270.49570.26960.24980.9948
551815715706.252510899.233322633.36880.2440.01190.26090.9218
561732816370.512511189.81323949.79070.40220.3220.27090.9288
571820517204.333611590.080925538.13870.4070.48840.27990.937
582099517292.610211487.389926031.53290.20320.41890.28810.9304
591738216151.131910584.681624644.96050.38820.13180.29560.8959
6093679350.33336047.821314456.23610.49740.0010.30250.3025

\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 & 13807 & - & - & - & - & - & - & - \tabularnewline
37 & 29743 & - & - & - & - & - & - & - \tabularnewline
38 & 25591 & - & - & - & - & - & - & - \tabularnewline
39 & 29096 & - & - & - & - & - & - & - \tabularnewline
40 & 26482 & - & - & - & - & - & - & - \tabularnewline
41 & 22405 & - & - & - & - & - & - & - \tabularnewline
42 & 27044 & - & - & - & - & - & - & - \tabularnewline
43 & 17970 & - & - & - & - & - & - & - \tabularnewline
44 & 18730 & - & - & - & - & - & - & - \tabularnewline
45 & 19684 & - & - & - & - & - & - & - \tabularnewline
46 & 19785 & - & - & - & - & - & - & - \tabularnewline
47 & 18479 & - & - & - & - & - & - & - \tabularnewline
48 & 10698 & - & - & - & - & - & - & - \tabularnewline
49 & 31956 & 25996.164 & 20111.6979 & 33602.3616 & 0.0623 & 1 & 0.1671 & 1 \tabularnewline
50 & 29506 & 22367.2069 & 16943.0451 & 29527.8647 & 0.0253 & 0.0043 & 0.1888 & 0.9993 \tabularnewline
51 & 34506 & 25430.669 & 18889.7343 & 34236.5286 & 0.0217 & 0.1822 & 0.2073 & 0.9995 \tabularnewline
52 & 27165 & 23145.9643 & 16879.4794 & 31738.8736 & 0.1796 & 0.0048 & 0.2233 & 0.9977 \tabularnewline
53 & 26736 & 19582.5591 & 14034.8874 & 27323.0993 & 0.035 & 0.0274 & 0.2374 & 0.9878 \tabularnewline
54 & 23691 & 23637.1671 & 16663.4542 & 33529.4027 & 0.4957 & 0.2696 & 0.2498 & 0.9948 \tabularnewline
55 & 18157 & 15706.2525 & 10899.2333 & 22633.3688 & 0.244 & 0.0119 & 0.2609 & 0.9218 \tabularnewline
56 & 17328 & 16370.5125 & 11189.813 & 23949.7907 & 0.4022 & 0.322 & 0.2709 & 0.9288 \tabularnewline
57 & 18205 & 17204.3336 & 11590.0809 & 25538.1387 & 0.407 & 0.4884 & 0.2799 & 0.937 \tabularnewline
58 & 20995 & 17292.6102 & 11487.3899 & 26031.5329 & 0.2032 & 0.4189 & 0.2881 & 0.9304 \tabularnewline
59 & 17382 & 16151.1319 & 10584.6816 & 24644.9605 & 0.3882 & 0.1318 & 0.2956 & 0.8959 \tabularnewline
60 & 9367 & 9350.3333 & 6047.8213 & 14456.2361 & 0.4974 & 0.001 & 0.3025 & 0.3025 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116439&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]13807[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]29743[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]25591[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]29096[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]26482[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]22405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]27044[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17970[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]18730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]19684[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]19785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]18479[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]10698[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]31956[/C][C]25996.164[/C][C]20111.6979[/C][C]33602.3616[/C][C]0.0623[/C][C]1[/C][C]0.1671[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]29506[/C][C]22367.2069[/C][C]16943.0451[/C][C]29527.8647[/C][C]0.0253[/C][C]0.0043[/C][C]0.1888[/C][C]0.9993[/C][/ROW]
[ROW][C]51[/C][C]34506[/C][C]25430.669[/C][C]18889.7343[/C][C]34236.5286[/C][C]0.0217[/C][C]0.1822[/C][C]0.2073[/C][C]0.9995[/C][/ROW]
[ROW][C]52[/C][C]27165[/C][C]23145.9643[/C][C]16879.4794[/C][C]31738.8736[/C][C]0.1796[/C][C]0.0048[/C][C]0.2233[/C][C]0.9977[/C][/ROW]
[ROW][C]53[/C][C]26736[/C][C]19582.5591[/C][C]14034.8874[/C][C]27323.0993[/C][C]0.035[/C][C]0.0274[/C][C]0.2374[/C][C]0.9878[/C][/ROW]
[ROW][C]54[/C][C]23691[/C][C]23637.1671[/C][C]16663.4542[/C][C]33529.4027[/C][C]0.4957[/C][C]0.2696[/C][C]0.2498[/C][C]0.9948[/C][/ROW]
[ROW][C]55[/C][C]18157[/C][C]15706.2525[/C][C]10899.2333[/C][C]22633.3688[/C][C]0.244[/C][C]0.0119[/C][C]0.2609[/C][C]0.9218[/C][/ROW]
[ROW][C]56[/C][C]17328[/C][C]16370.5125[/C][C]11189.813[/C][C]23949.7907[/C][C]0.4022[/C][C]0.322[/C][C]0.2709[/C][C]0.9288[/C][/ROW]
[ROW][C]57[/C][C]18205[/C][C]17204.3336[/C][C]11590.0809[/C][C]25538.1387[/C][C]0.407[/C][C]0.4884[/C][C]0.2799[/C][C]0.937[/C][/ROW]
[ROW][C]58[/C][C]20995[/C][C]17292.6102[/C][C]11487.3899[/C][C]26031.5329[/C][C]0.2032[/C][C]0.4189[/C][C]0.2881[/C][C]0.9304[/C][/ROW]
[ROW][C]59[/C][C]17382[/C][C]16151.1319[/C][C]10584.6816[/C][C]24644.9605[/C][C]0.3882[/C][C]0.1318[/C][C]0.2956[/C][C]0.8959[/C][/ROW]
[ROW][C]60[/C][C]9367[/C][C]9350.3333[/C][C]6047.8213[/C][C]14456.2361[/C][C]0.4974[/C][C]0.001[/C][C]0.3025[/C][C]0.3025[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116439&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116439&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])
3613807-------
3729743-------
3825591-------
3929096-------
4026482-------
4122405-------
4227044-------
4317970-------
4418730-------
4519684-------
4619785-------
4718479-------
4810698-------
493195625996.16420111.697933602.36160.062310.16711
502950622367.206916943.045129527.86470.02530.00430.18880.9993
513450625430.66918889.734334236.52860.02170.18220.20730.9995
522716523145.964316879.479431738.87360.17960.00480.22330.9977
532673619582.559114034.887427323.09930.0350.02740.23740.9878
542369123637.167116663.454233529.40270.49570.26960.24980.9948
551815715706.252510899.233322633.36880.2440.01190.26090.9218
561732816370.512511189.81323949.79070.40220.3220.27090.9288
571820517204.333611590.080925538.13870.4070.48840.27990.937
582099517292.610211487.389926031.53290.20320.41890.28810.9304
591738216151.131910584.681624644.96050.38820.13180.29560.8959
6093679350.33336047.821314456.23610.49740.0010.30250.3025







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.14930.2293035519644.780400
500.16330.31920.274250962367.460243241006.12036575.7894
510.17670.35690.301882361632.410756281214.88387502.0807
520.18940.17360.269716152648.042446249073.17346800.6671
530.20170.36530.288851171716.807147233601.90026872.6707
540.21350.00230.24112897.984839361817.91436273.8997
550.2250.1560.22896006163.38734596724.41045881.898
560.23620.05850.2076916782.376530386731.65615512.4161
570.24710.05820.1911001333.343927121687.39925207.8486
580.25780.21410.193313707690.188925780287.67825077.4292
590.26830.07620.18271515036.360523574355.74024855.343
600.27860.00180.1676277.779521609849.24354648.6395

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1493 & 0.2293 & 0 & 35519644.7804 & 0 & 0 \tabularnewline
50 & 0.1633 & 0.3192 & 0.2742 & 50962367.4602 & 43241006.1203 & 6575.7894 \tabularnewline
51 & 0.1767 & 0.3569 & 0.3018 & 82361632.4107 & 56281214.8838 & 7502.0807 \tabularnewline
52 & 0.1894 & 0.1736 & 0.2697 & 16152648.0424 & 46249073.1734 & 6800.6671 \tabularnewline
53 & 0.2017 & 0.3653 & 0.2888 & 51171716.8071 & 47233601.9002 & 6872.6707 \tabularnewline
54 & 0.2135 & 0.0023 & 0.2411 & 2897.9848 & 39361817.9143 & 6273.8997 \tabularnewline
55 & 0.225 & 0.156 & 0.2289 & 6006163.387 & 34596724.4104 & 5881.898 \tabularnewline
56 & 0.2362 & 0.0585 & 0.2076 & 916782.3765 & 30386731.6561 & 5512.4161 \tabularnewline
57 & 0.2471 & 0.0582 & 0.191 & 1001333.3439 & 27121687.3992 & 5207.8486 \tabularnewline
58 & 0.2578 & 0.2141 & 0.1933 & 13707690.1889 & 25780287.6782 & 5077.4292 \tabularnewline
59 & 0.2683 & 0.0762 & 0.1827 & 1515036.3605 & 23574355.7402 & 4855.343 \tabularnewline
60 & 0.2786 & 0.0018 & 0.1676 & 277.7795 & 21609849.2435 & 4648.6395 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116439&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.1493[/C][C]0.2293[/C][C]0[/C][C]35519644.7804[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1633[/C][C]0.3192[/C][C]0.2742[/C][C]50962367.4602[/C][C]43241006.1203[/C][C]6575.7894[/C][/ROW]
[ROW][C]51[/C][C]0.1767[/C][C]0.3569[/C][C]0.3018[/C][C]82361632.4107[/C][C]56281214.8838[/C][C]7502.0807[/C][/ROW]
[ROW][C]52[/C][C]0.1894[/C][C]0.1736[/C][C]0.2697[/C][C]16152648.0424[/C][C]46249073.1734[/C][C]6800.6671[/C][/ROW]
[ROW][C]53[/C][C]0.2017[/C][C]0.3653[/C][C]0.2888[/C][C]51171716.8071[/C][C]47233601.9002[/C][C]6872.6707[/C][/ROW]
[ROW][C]54[/C][C]0.2135[/C][C]0.0023[/C][C]0.2411[/C][C]2897.9848[/C][C]39361817.9143[/C][C]6273.8997[/C][/ROW]
[ROW][C]55[/C][C]0.225[/C][C]0.156[/C][C]0.2289[/C][C]6006163.387[/C][C]34596724.4104[/C][C]5881.898[/C][/ROW]
[ROW][C]56[/C][C]0.2362[/C][C]0.0585[/C][C]0.2076[/C][C]916782.3765[/C][C]30386731.6561[/C][C]5512.4161[/C][/ROW]
[ROW][C]57[/C][C]0.2471[/C][C]0.0582[/C][C]0.191[/C][C]1001333.3439[/C][C]27121687.3992[/C][C]5207.8486[/C][/ROW]
[ROW][C]58[/C][C]0.2578[/C][C]0.2141[/C][C]0.1933[/C][C]13707690.1889[/C][C]25780287.6782[/C][C]5077.4292[/C][/ROW]
[ROW][C]59[/C][C]0.2683[/C][C]0.0762[/C][C]0.1827[/C][C]1515036.3605[/C][C]23574355.7402[/C][C]4855.343[/C][/ROW]
[ROW][C]60[/C][C]0.2786[/C][C]0.0018[/C][C]0.1676[/C][C]277.7795[/C][C]21609849.2435[/C][C]4648.6395[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116439&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116439&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.14930.2293035519644.780400
500.16330.31920.274250962367.460243241006.12036575.7894
510.17670.35690.301882361632.410756281214.88387502.0807
520.18940.17360.269716152648.042446249073.17346800.6671
530.20170.36530.288851171716.807147233601.90026872.6707
540.21350.00230.24112897.984839361817.91436273.8997
550.2250.1560.22896006163.38734596724.41045881.898
560.23620.05850.2076916782.376530386731.65615512.4161
570.24710.05820.1911001333.343927121687.39925207.8486
580.25780.21410.193313707690.188925780287.67825077.4292
590.26830.07620.18271515036.360523574355.74024855.343
600.27860.00180.1676277.779521609849.24354648.6395



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