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, 14 Dec 2008 03:47:50 -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/2008/Dec/14/t1229252072c47e7fq3i8frhgl.htm/, Retrieved Wed, 15 May 2024 12:01:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33275, Retrieved Wed, 15 May 2024 12:01:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsARIMA forecasting paper
Estimated Impact178
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-14 10:47:50] [0cdfeda4aa2f9e551c2e529c44a404df] [Current]
Feedback Forum

Post a new message
Dataseries X:
14929387,5
14717825,3
15826281,2
16301309,6
15033016,9
16998460,6
14066462,7
13328937,3
17319718,2
17586426,8
15887037,4
17935679,1
15869489
15892510,9
17556558,1
16791643
15953688,5
18144913,6
14390881
13885708,7
17332571,5
17152595,8
16003877,1
16841467,1
14783398,1
14667847,5
17714362,2
16282088
15014866,2
17722582,4
13876509,4
15495489,6
17799521,1
17920079,1
17248022,4
18813782,4
16249688,3
17823358,5
20424438,3
17814218,7
19699959,6
19776328,1
15679833,1
17119266,5
20092613
20863688,3
20925203,1
21032593




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33275&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[36])
2416841467.1-------
2514783398.1-------
2614667847.5-------
2717714362.2-------
2816282088-------
2915014866.2-------
3017722582.4-------
3113876509.4-------
3215495489.6-------
3317799521.1-------
3417920079.1-------
3517248022.4-------
3618813782.4-------
3716249688.316384023.678214956086.273217811961.08320.42694e-040.9864e-04
3817823358.516268473.078214598594.574117938351.58220.0340.50880.96990.0014
3920424438.319314987.778217434035.039921195940.51650.12380.93990.95230.6993
4017814218.717882713.578215812092.369619953334.78670.47420.00810.93510.1891
4119699959.616615491.778214371174.248318859809.3080.00350.14760.91890.0274
4219776328.119323207.978216917703.839721728712.11670.3560.37940.90390.661
4315679833.115477134.978212920586.690718033683.26560.43835e-040.89010.0053
4417119266.517096115.178214396961.953319795268.40310.49330.84810.87740.1061
452009261319400146.678216565553.741422234739.61490.3160.94260.86580.6574
4620863688.319520704.678216556854.799622484554.55670.18720.35260.85510.6799
4720925203.118848647.978215760947.363121936348.59320.09370.10040.84520.5088
482103259320414407.978217207636.381423621179.57490.35280.37740.8360.836

\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 & 16841467.1 & - & - & - & - & - & - & - \tabularnewline
25 & 14783398.1 & - & - & - & - & - & - & - \tabularnewline
26 & 14667847.5 & - & - & - & - & - & - & - \tabularnewline
27 & 17714362.2 & - & - & - & - & - & - & - \tabularnewline
28 & 16282088 & - & - & - & - & - & - & - \tabularnewline
29 & 15014866.2 & - & - & - & - & - & - & - \tabularnewline
30 & 17722582.4 & - & - & - & - & - & - & - \tabularnewline
31 & 13876509.4 & - & - & - & - & - & - & - \tabularnewline
32 & 15495489.6 & - & - & - & - & - & - & - \tabularnewline
33 & 17799521.1 & - & - & - & - & - & - & - \tabularnewline
34 & 17920079.1 & - & - & - & - & - & - & - \tabularnewline
35 & 17248022.4 & - & - & - & - & - & - & - \tabularnewline
36 & 18813782.4 & - & - & - & - & - & - & - \tabularnewline
37 & 16249688.3 & 16384023.6782 & 14956086.2732 & 17811961.0832 & 0.4269 & 4e-04 & 0.986 & 4e-04 \tabularnewline
38 & 17823358.5 & 16268473.0782 & 14598594.5741 & 17938351.5822 & 0.034 & 0.5088 & 0.9699 & 0.0014 \tabularnewline
39 & 20424438.3 & 19314987.7782 & 17434035.0399 & 21195940.5165 & 0.1238 & 0.9399 & 0.9523 & 0.6993 \tabularnewline
40 & 17814218.7 & 17882713.5782 & 15812092.3696 & 19953334.7867 & 0.4742 & 0.0081 & 0.9351 & 0.1891 \tabularnewline
41 & 19699959.6 & 16615491.7782 & 14371174.2483 & 18859809.308 & 0.0035 & 0.1476 & 0.9189 & 0.0274 \tabularnewline
42 & 19776328.1 & 19323207.9782 & 16917703.8397 & 21728712.1167 & 0.356 & 0.3794 & 0.9039 & 0.661 \tabularnewline
43 & 15679833.1 & 15477134.9782 & 12920586.6907 & 18033683.2656 & 0.4383 & 5e-04 & 0.8901 & 0.0053 \tabularnewline
44 & 17119266.5 & 17096115.1782 & 14396961.9533 & 19795268.4031 & 0.4933 & 0.8481 & 0.8774 & 0.1061 \tabularnewline
45 & 20092613 & 19400146.6782 & 16565553.7414 & 22234739.6149 & 0.316 & 0.9426 & 0.8658 & 0.6574 \tabularnewline
46 & 20863688.3 & 19520704.6782 & 16556854.7996 & 22484554.5567 & 0.1872 & 0.3526 & 0.8551 & 0.6799 \tabularnewline
47 & 20925203.1 & 18848647.9782 & 15760947.3631 & 21936348.5932 & 0.0937 & 0.1004 & 0.8452 & 0.5088 \tabularnewline
48 & 21032593 & 20414407.9782 & 17207636.3814 & 23621179.5749 & 0.3528 & 0.3774 & 0.836 & 0.836 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33275&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]16841467.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]14783398.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]14667847.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]17714362.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]16282088[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]15014866.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]17722582.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]13876509.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]15495489.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]17799521.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]17920079.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]17248022.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]18813782.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]16249688.3[/C][C]16384023.6782[/C][C]14956086.2732[/C][C]17811961.0832[/C][C]0.4269[/C][C]4e-04[/C][C]0.986[/C][C]4e-04[/C][/ROW]
[ROW][C]38[/C][C]17823358.5[/C][C]16268473.0782[/C][C]14598594.5741[/C][C]17938351.5822[/C][C]0.034[/C][C]0.5088[/C][C]0.9699[/C][C]0.0014[/C][/ROW]
[ROW][C]39[/C][C]20424438.3[/C][C]19314987.7782[/C][C]17434035.0399[/C][C]21195940.5165[/C][C]0.1238[/C][C]0.9399[/C][C]0.9523[/C][C]0.6993[/C][/ROW]
[ROW][C]40[/C][C]17814218.7[/C][C]17882713.5782[/C][C]15812092.3696[/C][C]19953334.7867[/C][C]0.4742[/C][C]0.0081[/C][C]0.9351[/C][C]0.1891[/C][/ROW]
[ROW][C]41[/C][C]19699959.6[/C][C]16615491.7782[/C][C]14371174.2483[/C][C]18859809.308[/C][C]0.0035[/C][C]0.1476[/C][C]0.9189[/C][C]0.0274[/C][/ROW]
[ROW][C]42[/C][C]19776328.1[/C][C]19323207.9782[/C][C]16917703.8397[/C][C]21728712.1167[/C][C]0.356[/C][C]0.3794[/C][C]0.9039[/C][C]0.661[/C][/ROW]
[ROW][C]43[/C][C]15679833.1[/C][C]15477134.9782[/C][C]12920586.6907[/C][C]18033683.2656[/C][C]0.4383[/C][C]5e-04[/C][C]0.8901[/C][C]0.0053[/C][/ROW]
[ROW][C]44[/C][C]17119266.5[/C][C]17096115.1782[/C][C]14396961.9533[/C][C]19795268.4031[/C][C]0.4933[/C][C]0.8481[/C][C]0.8774[/C][C]0.1061[/C][/ROW]
[ROW][C]45[/C][C]20092613[/C][C]19400146.6782[/C][C]16565553.7414[/C][C]22234739.6149[/C][C]0.316[/C][C]0.9426[/C][C]0.8658[/C][C]0.6574[/C][/ROW]
[ROW][C]46[/C][C]20863688.3[/C][C]19520704.6782[/C][C]16556854.7996[/C][C]22484554.5567[/C][C]0.1872[/C][C]0.3526[/C][C]0.8551[/C][C]0.6799[/C][/ROW]
[ROW][C]47[/C][C]20925203.1[/C][C]18848647.9782[/C][C]15760947.3631[/C][C]21936348.5932[/C][C]0.0937[/C][C]0.1004[/C][C]0.8452[/C][C]0.5088[/C][/ROW]
[ROW][C]48[/C][C]21032593[/C][C]20414407.9782[/C][C]17207636.3814[/C][C]23621179.5749[/C][C]0.3528[/C][C]0.3774[/C][C]0.836[/C][C]0.836[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33275&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33275&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])
2416841467.1-------
2514783398.1-------
2614667847.5-------
2717714362.2-------
2816282088-------
2915014866.2-------
3017722582.4-------
3113876509.4-------
3215495489.6-------
3317799521.1-------
3417920079.1-------
3517248022.4-------
3618813782.4-------
3716249688.316384023.678214956086.273217811961.08320.42694e-040.9864e-04
3817823358.516268473.078214598594.574117938351.58220.0340.50880.96990.0014
3920424438.319314987.778217434035.039921195940.51650.12380.93990.95230.6993
4017814218.717882713.578215812092.369619953334.78670.47420.00810.93510.1891
4119699959.616615491.778214371174.248318859809.3080.00350.14760.91890.0274
4219776328.119323207.978216917703.839721728712.11670.3560.37940.90390.661
4315679833.115477134.978212920586.690718033683.26560.43835e-040.89010.0053
4417119266.517096115.178214396961.953319795268.40310.49330.84810.87740.1061
452009261319400146.678216565553.741422234739.61490.3160.94260.86580.6574
4620863688.319520704.678216556854.799622484554.55670.18720.35260.85510.6799
4720925203.118848647.978215760947.363121936348.59320.09370.10040.84520.5088
482103259320414407.978217207636.381423621179.57490.35280.37740.8360.836







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
370.0445-0.00827e-0418045993825.57331503832818.797838779.2834
380.05240.09560.0082417668675048.44201472389587.370448856.7584
390.04970.05740.00481230880460409.52102573371700.794320270.7787
400.0591-0.00383e-044691548334.2476390962361.187319772.7682
410.06890.18560.01559513941743962.16792828478663.514890409.1636
420.06350.02340.002205317844815.67917109820401.3066130804.5122
430.08430.01310.001141086528597.18643423877383.098958513.9076
440.08060.00141e-04535983702.907744665308.57566683.2109
450.07450.03570.003479509606881.66839959133906.8057199897.8087
460.07750.06880.00571803605008528.63150300417377.386387685.9778
470.08360.11020.00924312081174037.09359340097836.424599449.8293
480.08010.03030.0025382152721226.47731846060102.2064178454.6444

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
37 & 0.0445 & -0.0082 & 7e-04 & 18045993825.5733 & 1503832818.7978 & 38779.2834 \tabularnewline
38 & 0.0524 & 0.0956 & 0.008 & 2417668675048.44 & 201472389587.370 & 448856.7584 \tabularnewline
39 & 0.0497 & 0.0574 & 0.0048 & 1230880460409.52 & 102573371700.794 & 320270.7787 \tabularnewline
40 & 0.0591 & -0.0038 & 3e-04 & 4691548334.2476 & 390962361.1873 & 19772.7682 \tabularnewline
41 & 0.0689 & 0.1856 & 0.0155 & 9513941743962.16 & 792828478663.514 & 890409.1636 \tabularnewline
42 & 0.0635 & 0.0234 & 0.002 & 205317844815.679 & 17109820401.3066 & 130804.5122 \tabularnewline
43 & 0.0843 & 0.0131 & 0.0011 & 41086528597.1864 & 3423877383.0989 & 58513.9076 \tabularnewline
44 & 0.0806 & 0.0014 & 1e-04 & 535983702.9077 & 44665308.5756 & 6683.2109 \tabularnewline
45 & 0.0745 & 0.0357 & 0.003 & 479509606881.668 & 39959133906.8057 & 199897.8087 \tabularnewline
46 & 0.0775 & 0.0688 & 0.0057 & 1803605008528.63 & 150300417377.386 & 387685.9778 \tabularnewline
47 & 0.0836 & 0.1102 & 0.0092 & 4312081174037.09 & 359340097836.424 & 599449.8293 \tabularnewline
48 & 0.0801 & 0.0303 & 0.0025 & 382152721226.477 & 31846060102.2064 & 178454.6444 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33275&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]0.0445[/C][C]-0.0082[/C][C]7e-04[/C][C]18045993825.5733[/C][C]1503832818.7978[/C][C]38779.2834[/C][/ROW]
[ROW][C]38[/C][C]0.0524[/C][C]0.0956[/C][C]0.008[/C][C]2417668675048.44[/C][C]201472389587.370[/C][C]448856.7584[/C][/ROW]
[ROW][C]39[/C][C]0.0497[/C][C]0.0574[/C][C]0.0048[/C][C]1230880460409.52[/C][C]102573371700.794[/C][C]320270.7787[/C][/ROW]
[ROW][C]40[/C][C]0.0591[/C][C]-0.0038[/C][C]3e-04[/C][C]4691548334.2476[/C][C]390962361.1873[/C][C]19772.7682[/C][/ROW]
[ROW][C]41[/C][C]0.0689[/C][C]0.1856[/C][C]0.0155[/C][C]9513941743962.16[/C][C]792828478663.514[/C][C]890409.1636[/C][/ROW]
[ROW][C]42[/C][C]0.0635[/C][C]0.0234[/C][C]0.002[/C][C]205317844815.679[/C][C]17109820401.3066[/C][C]130804.5122[/C][/ROW]
[ROW][C]43[/C][C]0.0843[/C][C]0.0131[/C][C]0.0011[/C][C]41086528597.1864[/C][C]3423877383.0989[/C][C]58513.9076[/C][/ROW]
[ROW][C]44[/C][C]0.0806[/C][C]0.0014[/C][C]1e-04[/C][C]535983702.9077[/C][C]44665308.5756[/C][C]6683.2109[/C][/ROW]
[ROW][C]45[/C][C]0.0745[/C][C]0.0357[/C][C]0.003[/C][C]479509606881.668[/C][C]39959133906.8057[/C][C]199897.8087[/C][/ROW]
[ROW][C]46[/C][C]0.0775[/C][C]0.0688[/C][C]0.0057[/C][C]1803605008528.63[/C][C]150300417377.386[/C][C]387685.9778[/C][/ROW]
[ROW][C]47[/C][C]0.0836[/C][C]0.1102[/C][C]0.0092[/C][C]4312081174037.09[/C][C]359340097836.424[/C][C]599449.8293[/C][/ROW]
[ROW][C]48[/C][C]0.0801[/C][C]0.0303[/C][C]0.0025[/C][C]382152721226.477[/C][C]31846060102.2064[/C][C]178454.6444[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33275&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33275&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
370.0445-0.00827e-0418045993825.57331503832818.797838779.2834
380.05240.09560.0082417668675048.44201472389587.370448856.7584
390.04970.05740.00481230880460409.52102573371700.794320270.7787
400.0591-0.00383e-044691548334.2476390962361.187319772.7682
410.06890.18560.01559513941743962.16792828478663.514890409.1636
420.06350.02340.002205317844815.67917109820401.3066130804.5122
430.08430.01310.001141086528597.18643423877383.098958513.9076
440.08060.00141e-04535983702.907744665308.57566683.2109
450.07450.03570.003479509606881.66839959133906.8057199897.8087
460.07750.06880.00571803605008528.63150300417377.386387685.9778
470.08360.11020.00924312081174037.09359340097836.424599449.8293
480.08010.03030.0025382152721226.47731846060102.2064178454.6444



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')