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, 04 Dec 2012 14:18:22 -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/2012/Dec/04/t135464879704b9qvt3t7xq019.htm/, Retrieved Wed, 24 Apr 2024 11:31:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=196535, Retrieved Wed, 24 Apr 2024 11:31:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact135
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Monthly US soldie...] [2010-11-02 12:07:39] [b98453cac15ba1066b407e146608df68]
- RMP   [Variance Reduction Matrix] [Soldiers] [2010-11-29 09:51:25] [b98453cac15ba1066b407e146608df68]
- RM      [Standard Deviation-Mean Plot] [Soldiers] [2010-11-29 11:02:42] [b98453cac15ba1066b407e146608df68]
- RMP       [ARIMA Forecasting] [Soldiers] [2010-11-29 21:04:02] [b98453cac15ba1066b407e146608df68]
- R  D          [ARIMA Forecasting] [ARIMA forecast] [2012-12-04 19:18:22] [eef9f4a55a40721b371cf4577ce601c1] [Current]
Feedback Forum

Post a new message
Dataseries X:
655362
873127
1107897
1555964
1671159
1493308
2957796
2638691
1305669
1280496
921900
867888
652586
913831
1108544
1555827
1699283
1509458
3268975
2425016
1312703
1365498
934453
775019
651142
843192
1146766
1652601
1465906
1652734
2922334
2702805
1458956
1410363
1019279
936574
708917
885295
1099663
1576220
1487870
1488635
2882530
2677026
1404398
1344370
936865
872705
628151
953712
1160384
1400618
1661511
1495347
2918786
2775677
1407026
1370199
964526
850851
683118
847224
1073256
1514326
1503734
1507712
2865698
2788128
1391596
1366378
946295
859626




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.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 & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=196535&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]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=196535&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=196535&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'Sir Ronald Aylmer Fisher' @ fisher.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[60])
48872705-------
49628151-------
50953712-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526-------
60850851-------
61683118853675.3422-359611.59042066962.27480.39150.50180.64220.5018
62847224853675.3422-842589.98142549940.66580.4970.57810.4540.5013
631073256853675.3422-1215761.03412923111.71850.41760.50240.38570.5011
641514326853675.3422-1531239.28583238589.97020.29360.42840.32650.5009
651503734853675.3422-1809606.21443516956.89890.31620.31340.27610.5008
661507712853675.3422-2061512.39063768863.0750.33010.3310.33310.5008
672865698853675.3422-2293318.52254000669.20690.10510.34190.09920.5007
682788128853675.3422-2509183.74674216534.43110.12980.12050.13130.5007
691391596853675.3422-2712004.41334419355.09780.38370.14380.38050.5006
701366378853675.3422-2903893.41784611244.10230.39460.38950.39380.5006
71946295853675.3422-3086448.24144793798.92580.48160.39930.4780.5006
72859626853675.3422-3260911.48044968262.16490.49890.48240.50050.5005

\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[60]) \tabularnewline
48 & 872705 & - & - & - & - & - & - & - \tabularnewline
49 & 628151 & - & - & - & - & - & - & - \tabularnewline
50 & 953712 & - & - & - & - & - & - & - \tabularnewline
51 & 1160384 & - & - & - & - & - & - & - \tabularnewline
52 & 1400618 & - & - & - & - & - & - & - \tabularnewline
53 & 1661511 & - & - & - & - & - & - & - \tabularnewline
54 & 1495347 & - & - & - & - & - & - & - \tabularnewline
55 & 2918786 & - & - & - & - & - & - & - \tabularnewline
56 & 2775677 & - & - & - & - & - & - & - \tabularnewline
57 & 1407026 & - & - & - & - & - & - & - \tabularnewline
58 & 1370199 & - & - & - & - & - & - & - \tabularnewline
59 & 964526 & - & - & - & - & - & - & - \tabularnewline
60 & 850851 & - & - & - & - & - & - & - \tabularnewline
61 & 683118 & 853675.3422 & -359611.5904 & 2066962.2748 & 0.3915 & 0.5018 & 0.6422 & 0.5018 \tabularnewline
62 & 847224 & 853675.3422 & -842589.9814 & 2549940.6658 & 0.497 & 0.5781 & 0.454 & 0.5013 \tabularnewline
63 & 1073256 & 853675.3422 & -1215761.0341 & 2923111.7185 & 0.4176 & 0.5024 & 0.3857 & 0.5011 \tabularnewline
64 & 1514326 & 853675.3422 & -1531239.2858 & 3238589.9702 & 0.2936 & 0.4284 & 0.3265 & 0.5009 \tabularnewline
65 & 1503734 & 853675.3422 & -1809606.2144 & 3516956.8989 & 0.3162 & 0.3134 & 0.2761 & 0.5008 \tabularnewline
66 & 1507712 & 853675.3422 & -2061512.3906 & 3768863.075 & 0.3301 & 0.331 & 0.3331 & 0.5008 \tabularnewline
67 & 2865698 & 853675.3422 & -2293318.5225 & 4000669.2069 & 0.1051 & 0.3419 & 0.0992 & 0.5007 \tabularnewline
68 & 2788128 & 853675.3422 & -2509183.7467 & 4216534.4311 & 0.1298 & 0.1205 & 0.1313 & 0.5007 \tabularnewline
69 & 1391596 & 853675.3422 & -2712004.4133 & 4419355.0978 & 0.3837 & 0.1438 & 0.3805 & 0.5006 \tabularnewline
70 & 1366378 & 853675.3422 & -2903893.4178 & 4611244.1023 & 0.3946 & 0.3895 & 0.3938 & 0.5006 \tabularnewline
71 & 946295 & 853675.3422 & -3086448.2414 & 4793798.9258 & 0.4816 & 0.3993 & 0.478 & 0.5006 \tabularnewline
72 & 859626 & 853675.3422 & -3260911.4804 & 4968262.1649 & 0.4989 & 0.4824 & 0.5005 & 0.5005 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=196535&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[60])[/C][/ROW]
[ROW][C]48[/C][C]872705[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]628151[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]953712[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]1160384[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]1400618[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]1661511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]1495347[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]2918786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]2775677[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]1407026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]1370199[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]964526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]850851[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]683118[/C][C]853675.3422[/C][C]-359611.5904[/C][C]2066962.2748[/C][C]0.3915[/C][C]0.5018[/C][C]0.6422[/C][C]0.5018[/C][/ROW]
[ROW][C]62[/C][C]847224[/C][C]853675.3422[/C][C]-842589.9814[/C][C]2549940.6658[/C][C]0.497[/C][C]0.5781[/C][C]0.454[/C][C]0.5013[/C][/ROW]
[ROW][C]63[/C][C]1073256[/C][C]853675.3422[/C][C]-1215761.0341[/C][C]2923111.7185[/C][C]0.4176[/C][C]0.5024[/C][C]0.3857[/C][C]0.5011[/C][/ROW]
[ROW][C]64[/C][C]1514326[/C][C]853675.3422[/C][C]-1531239.2858[/C][C]3238589.9702[/C][C]0.2936[/C][C]0.4284[/C][C]0.3265[/C][C]0.5009[/C][/ROW]
[ROW][C]65[/C][C]1503734[/C][C]853675.3422[/C][C]-1809606.2144[/C][C]3516956.8989[/C][C]0.3162[/C][C]0.3134[/C][C]0.2761[/C][C]0.5008[/C][/ROW]
[ROW][C]66[/C][C]1507712[/C][C]853675.3422[/C][C]-2061512.3906[/C][C]3768863.075[/C][C]0.3301[/C][C]0.331[/C][C]0.3331[/C][C]0.5008[/C][/ROW]
[ROW][C]67[/C][C]2865698[/C][C]853675.3422[/C][C]-2293318.5225[/C][C]4000669.2069[/C][C]0.1051[/C][C]0.3419[/C][C]0.0992[/C][C]0.5007[/C][/ROW]
[ROW][C]68[/C][C]2788128[/C][C]853675.3422[/C][C]-2509183.7467[/C][C]4216534.4311[/C][C]0.1298[/C][C]0.1205[/C][C]0.1313[/C][C]0.5007[/C][/ROW]
[ROW][C]69[/C][C]1391596[/C][C]853675.3422[/C][C]-2712004.4133[/C][C]4419355.0978[/C][C]0.3837[/C][C]0.1438[/C][C]0.3805[/C][C]0.5006[/C][/ROW]
[ROW][C]70[/C][C]1366378[/C][C]853675.3422[/C][C]-2903893.4178[/C][C]4611244.1023[/C][C]0.3946[/C][C]0.3895[/C][C]0.3938[/C][C]0.5006[/C][/ROW]
[ROW][C]71[/C][C]946295[/C][C]853675.3422[/C][C]-3086448.2414[/C][C]4793798.9258[/C][C]0.4816[/C][C]0.3993[/C][C]0.478[/C][C]0.5006[/C][/ROW]
[ROW][C]72[/C][C]859626[/C][C]853675.3422[/C][C]-3260911.4804[/C][C]4968262.1649[/C][C]0.4989[/C][C]0.4824[/C][C]0.5005[/C][C]0.5005[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=196535&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=196535&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[60])
48872705-------
49628151-------
50953712-------
511160384-------
521400618-------
531661511-------
541495347-------
552918786-------
562775677-------
571407026-------
581370199-------
59964526-------
60850851-------
61683118853675.3422-359611.59042066962.27480.39150.50180.64220.5018
62847224853675.3422-842589.98142549940.66580.4970.57810.4540.5013
631073256853675.3422-1215761.03412923111.71850.41760.50240.38570.5011
641514326853675.3422-1531239.28583238589.97020.29360.42840.32650.5009
651503734853675.3422-1809606.21443516956.89890.31620.31340.27610.5008
661507712853675.3422-2061512.39063768863.0750.33010.3310.33310.5008
672865698853675.3422-2293318.52254000669.20690.10510.34190.09920.5007
682788128853675.3422-2509183.74674216534.43110.12980.12050.13130.5007
691391596853675.3422-2712004.41334419355.09780.38370.14380.38050.5006
701366378853675.3422-2903893.41784611244.10230.39460.38950.39380.5006
71946295853675.3422-3086448.24144793798.92580.48160.39930.4780.5006
72859626853675.3422-3260911.48044968262.16490.49890.48240.50050.5005







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.7251-0.1998029089806982.136900
621.0138-0.00760.103741619816.325614565713399.2312120688.4974
631.23680.25720.154948215665274.976925782364024.4798160568.8763
641.42540.77390.3096436459291636.818128451595927.564358401.4452
651.59170.76150.4422576258566.22187276528455.296432754.5822
661.74230.76610.461427763949731.588227357765334.678476820.475
671.88082.35690.73194048235175455.64773197395351.958879316.4364
682.00982.2660.92363742107085226.281144311106586.251069724.7808
692.1310.63010.891289358634075.9711049316387418.441024361.4535
702.24570.60060.862262864015303.734970671150206.969985226.4462
712.35480.10850.79358578401008.9206883208173007.147939791.5583
722.45910.0070.727935410328.1198809610442783.894899783.5533

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.7251 & -0.1998 & 0 & 29089806982.1369 & 0 & 0 \tabularnewline
62 & 1.0138 & -0.0076 & 0.1037 & 41619816.3256 & 14565713399.2312 & 120688.4974 \tabularnewline
63 & 1.2368 & 0.2572 & 0.1549 & 48215665274.9769 & 25782364024.4798 & 160568.8763 \tabularnewline
64 & 1.4254 & 0.7739 & 0.3096 & 436459291636.818 & 128451595927.564 & 358401.4452 \tabularnewline
65 & 1.5917 & 0.7615 & 0.4 & 422576258566.22 & 187276528455.296 & 432754.5822 \tabularnewline
66 & 1.7423 & 0.7661 & 0.461 & 427763949731.588 & 227357765334.678 & 476820.475 \tabularnewline
67 & 1.8808 & 2.3569 & 0.7319 & 4048235175455.64 & 773197395351.958 & 879316.4364 \tabularnewline
68 & 2.0098 & 2.266 & 0.9236 & 3742107085226.28 & 1144311106586.25 & 1069724.7808 \tabularnewline
69 & 2.131 & 0.6301 & 0.891 & 289358634075.971 & 1049316387418.44 & 1024361.4535 \tabularnewline
70 & 2.2457 & 0.6006 & 0.862 & 262864015303.734 & 970671150206.969 & 985226.4462 \tabularnewline
71 & 2.3548 & 0.1085 & 0.7935 & 8578401008.9206 & 883208173007.147 & 939791.5583 \tabularnewline
72 & 2.4591 & 0.007 & 0.7279 & 35410328.1198 & 809610442783.894 & 899783.5533 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=196535&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]61[/C][C]0.7251[/C][C]-0.1998[/C][C]0[/C][C]29089806982.1369[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]1.0138[/C][C]-0.0076[/C][C]0.1037[/C][C]41619816.3256[/C][C]14565713399.2312[/C][C]120688.4974[/C][/ROW]
[ROW][C]63[/C][C]1.2368[/C][C]0.2572[/C][C]0.1549[/C][C]48215665274.9769[/C][C]25782364024.4798[/C][C]160568.8763[/C][/ROW]
[ROW][C]64[/C][C]1.4254[/C][C]0.7739[/C][C]0.3096[/C][C]436459291636.818[/C][C]128451595927.564[/C][C]358401.4452[/C][/ROW]
[ROW][C]65[/C][C]1.5917[/C][C]0.7615[/C][C]0.4[/C][C]422576258566.22[/C][C]187276528455.296[/C][C]432754.5822[/C][/ROW]
[ROW][C]66[/C][C]1.7423[/C][C]0.7661[/C][C]0.461[/C][C]427763949731.588[/C][C]227357765334.678[/C][C]476820.475[/C][/ROW]
[ROW][C]67[/C][C]1.8808[/C][C]2.3569[/C][C]0.7319[/C][C]4048235175455.64[/C][C]773197395351.958[/C][C]879316.4364[/C][/ROW]
[ROW][C]68[/C][C]2.0098[/C][C]2.266[/C][C]0.9236[/C][C]3742107085226.28[/C][C]1144311106586.25[/C][C]1069724.7808[/C][/ROW]
[ROW][C]69[/C][C]2.131[/C][C]0.6301[/C][C]0.891[/C][C]289358634075.971[/C][C]1049316387418.44[/C][C]1024361.4535[/C][/ROW]
[ROW][C]70[/C][C]2.2457[/C][C]0.6006[/C][C]0.862[/C][C]262864015303.734[/C][C]970671150206.969[/C][C]985226.4462[/C][/ROW]
[ROW][C]71[/C][C]2.3548[/C][C]0.1085[/C][C]0.7935[/C][C]8578401008.9206[/C][C]883208173007.147[/C][C]939791.5583[/C][/ROW]
[ROW][C]72[/C][C]2.4591[/C][C]0.007[/C][C]0.7279[/C][C]35410328.1198[/C][C]809610442783.894[/C][C]899783.5533[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=196535&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=196535&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
610.7251-0.1998029089806982.136900
621.0138-0.00760.103741619816.325614565713399.2312120688.4974
631.23680.25720.154948215665274.976925782364024.4798160568.8763
641.42540.77390.3096436459291636.818128451595927.564358401.4452
651.59170.76150.4422576258566.22187276528455.296432754.5822
661.74230.76610.461427763949731.588227357765334.678476820.475
671.88082.35690.73194048235175455.64773197395351.958879316.4364
682.00982.2660.92363742107085226.281144311106586.251069724.7808
692.1310.63010.891289358634075.9711049316387418.441024361.4535
702.24570.60060.862262864015303.734970671150206.969985226.4462
712.35480.10850.79358578401008.9206883208173007.147939791.5583
722.45910.0070.727935410328.1198809610442783.894899783.5533



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