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 computationMon, 21 Dec 2009 02:54:02 -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/21/t1261390468wtk289vr1nuvgu6.htm/, Retrieved Sun, 05 May 2024 20:20:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70086, Retrieved Sun, 05 May 2024 20:20:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact130
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ARIMA forecasting] [2009-12-06 10:32:23] [d46757a0a8c9b00540ab7e7e0c34bfc4]
-   P   [ARIMA Forecasting] [ARIMA Forecasting] [2009-12-08 20:43:55] [d46757a0a8c9b00540ab7e7e0c34bfc4]
-   PD      [ARIMA Forecasting] [] [2009-12-21 09:54:02] [aa8eb70c35ea8a87edcd21d6427e653e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2849.27
2921.44
2981.85
3080.58
3106.22
3119.31
3061.26
3097.31
3161.69
3257.16
3277.01
3295.32
3363.99
3494.17
3667.03
3813.06
3917.96
3895.51
3801.06
3570.12
3701.61
3862.27
3970.1
4138.52
4199.75
4290.89
4443.91
4502.64
4356.98
4591.27
4696.96
4621.4
4562.84
4202.52
4296.49
4435.23
4105.18
4116.68
3844.49
3720.98
3674.4
3857.62
3801.06
3504.37
3032.6
3047.03
2962.34
2197.82
2014.45
1862.83
1905.41
1810.99
1670.07
1864.44
2052.02
2029.6
2070.83
2293.41
2443.27
2513.17




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70086&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])
364435.23-------
374105.18-------
384116.68-------
393844.49-------
403720.98-------
413674.4-------
423857.62-------
433801.06-------
443504.37-------
453032.6-------
463047.03-------
472962.34-------
482197.82-------
492014.452049.42551697.222401.6310.42280.204500.2045
501862.832030.14721443.0092617.28540.28820.520900.2878
511905.412020.77771281.28062760.27480.37990.662300.3194
521810.992023.61641143.1072904.12570.3180.60381e-040.3491
531670.072020.62851027.95613013.3010.24440.66055e-040.3632
541864.442022.7909922.7963122.78570.38890.73525e-040.3776
552052.022021.0954828.02313214.16770.47970.60150.00170.3858
562029.62022.3996739.64643305.15270.49560.4820.01180.3943
572070.832021.3919657.26693385.51680.47170.49530.07310.3999
582293.412022.1697579.48263464.85670.35620.47360.08190.4057
592443.272021.5692505.68963537.44880.29280.36260.11190.4099
602513.172022.0328435.37183608.69370.2720.30140.4140.414

\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 & 4435.23 & - & - & - & - & - & - & - \tabularnewline
37 & 4105.18 & - & - & - & - & - & - & - \tabularnewline
38 & 4116.68 & - & - & - & - & - & - & - \tabularnewline
39 & 3844.49 & - & - & - & - & - & - & - \tabularnewline
40 & 3720.98 & - & - & - & - & - & - & - \tabularnewline
41 & 3674.4 & - & - & - & - & - & - & - \tabularnewline
42 & 3857.62 & - & - & - & - & - & - & - \tabularnewline
43 & 3801.06 & - & - & - & - & - & - & - \tabularnewline
44 & 3504.37 & - & - & - & - & - & - & - \tabularnewline
45 & 3032.6 & - & - & - & - & - & - & - \tabularnewline
46 & 3047.03 & - & - & - & - & - & - & - \tabularnewline
47 & 2962.34 & - & - & - & - & - & - & - \tabularnewline
48 & 2197.82 & - & - & - & - & - & - & - \tabularnewline
49 & 2014.45 & 2049.4255 & 1697.22 & 2401.631 & 0.4228 & 0.2045 & 0 & 0.2045 \tabularnewline
50 & 1862.83 & 2030.1472 & 1443.009 & 2617.2854 & 0.2882 & 0.5209 & 0 & 0.2878 \tabularnewline
51 & 1905.41 & 2020.7777 & 1281.2806 & 2760.2748 & 0.3799 & 0.6623 & 0 & 0.3194 \tabularnewline
52 & 1810.99 & 2023.6164 & 1143.107 & 2904.1257 & 0.318 & 0.6038 & 1e-04 & 0.3491 \tabularnewline
53 & 1670.07 & 2020.6285 & 1027.9561 & 3013.301 & 0.2444 & 0.6605 & 5e-04 & 0.3632 \tabularnewline
54 & 1864.44 & 2022.7909 & 922.796 & 3122.7857 & 0.3889 & 0.7352 & 5e-04 & 0.3776 \tabularnewline
55 & 2052.02 & 2021.0954 & 828.0231 & 3214.1677 & 0.4797 & 0.6015 & 0.0017 & 0.3858 \tabularnewline
56 & 2029.6 & 2022.3996 & 739.6464 & 3305.1527 & 0.4956 & 0.482 & 0.0118 & 0.3943 \tabularnewline
57 & 2070.83 & 2021.3919 & 657.2669 & 3385.5168 & 0.4717 & 0.4953 & 0.0731 & 0.3999 \tabularnewline
58 & 2293.41 & 2022.1697 & 579.4826 & 3464.8567 & 0.3562 & 0.4736 & 0.0819 & 0.4057 \tabularnewline
59 & 2443.27 & 2021.5692 & 505.6896 & 3537.4488 & 0.2928 & 0.3626 & 0.1119 & 0.4099 \tabularnewline
60 & 2513.17 & 2022.0328 & 435.3718 & 3608.6937 & 0.272 & 0.3014 & 0.414 & 0.414 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70086&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]4435.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4105.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4116.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3844.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3720.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3674.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3857.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3801.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3504.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]3032.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3047.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2962.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2197.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2014.45[/C][C]2049.4255[/C][C]1697.22[/C][C]2401.631[/C][C]0.4228[/C][C]0.2045[/C][C]0[/C][C]0.2045[/C][/ROW]
[ROW][C]50[/C][C]1862.83[/C][C]2030.1472[/C][C]1443.009[/C][C]2617.2854[/C][C]0.2882[/C][C]0.5209[/C][C]0[/C][C]0.2878[/C][/ROW]
[ROW][C]51[/C][C]1905.41[/C][C]2020.7777[/C][C]1281.2806[/C][C]2760.2748[/C][C]0.3799[/C][C]0.6623[/C][C]0[/C][C]0.3194[/C][/ROW]
[ROW][C]52[/C][C]1810.99[/C][C]2023.6164[/C][C]1143.107[/C][C]2904.1257[/C][C]0.318[/C][C]0.6038[/C][C]1e-04[/C][C]0.3491[/C][/ROW]
[ROW][C]53[/C][C]1670.07[/C][C]2020.6285[/C][C]1027.9561[/C][C]3013.301[/C][C]0.2444[/C][C]0.6605[/C][C]5e-04[/C][C]0.3632[/C][/ROW]
[ROW][C]54[/C][C]1864.44[/C][C]2022.7909[/C][C]922.796[/C][C]3122.7857[/C][C]0.3889[/C][C]0.7352[/C][C]5e-04[/C][C]0.3776[/C][/ROW]
[ROW][C]55[/C][C]2052.02[/C][C]2021.0954[/C][C]828.0231[/C][C]3214.1677[/C][C]0.4797[/C][C]0.6015[/C][C]0.0017[/C][C]0.3858[/C][/ROW]
[ROW][C]56[/C][C]2029.6[/C][C]2022.3996[/C][C]739.6464[/C][C]3305.1527[/C][C]0.4956[/C][C]0.482[/C][C]0.0118[/C][C]0.3943[/C][/ROW]
[ROW][C]57[/C][C]2070.83[/C][C]2021.3919[/C][C]657.2669[/C][C]3385.5168[/C][C]0.4717[/C][C]0.4953[/C][C]0.0731[/C][C]0.3999[/C][/ROW]
[ROW][C]58[/C][C]2293.41[/C][C]2022.1697[/C][C]579.4826[/C][C]3464.8567[/C][C]0.3562[/C][C]0.4736[/C][C]0.0819[/C][C]0.4057[/C][/ROW]
[ROW][C]59[/C][C]2443.27[/C][C]2021.5692[/C][C]505.6896[/C][C]3537.4488[/C][C]0.2928[/C][C]0.3626[/C][C]0.1119[/C][C]0.4099[/C][/ROW]
[ROW][C]60[/C][C]2513.17[/C][C]2022.0328[/C][C]435.3718[/C][C]3608.6937[/C][C]0.272[/C][C]0.3014[/C][C]0.414[/C][C]0.414[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70086&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70086&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])
364435.23-------
374105.18-------
384116.68-------
393844.49-------
403720.98-------
413674.4-------
423857.62-------
433801.06-------
443504.37-------
453032.6-------
463047.03-------
472962.34-------
482197.82-------
492014.452049.42551697.222401.6310.42280.204500.2045
501862.832030.14721443.0092617.28540.28820.520900.2878
511905.412020.77771281.28062760.27480.37990.662300.3194
521810.992023.61641143.1072904.12570.3180.60381e-040.3491
531670.072020.62851027.95613013.3010.24440.66055e-040.3632
541864.442022.7909922.7963122.78570.38890.73525e-040.3776
552052.022021.0954828.02313214.16770.47970.60150.00170.3858
562029.62022.3996739.64643305.15270.49560.4820.01180.3943
572070.832021.3919657.26693385.51680.47170.49530.07310.3999
582293.412022.1697579.48263464.85670.35620.47360.08190.4057
592443.272021.5692505.68963537.44880.29280.36260.11190.4099
602513.172022.0328435.37183608.69370.2720.30140.4140.414







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0877-0.01710.00141223.2856101.940510.0966
500.1476-0.08240.006927995.05392332.921248.3003
510.1867-0.05710.004813309.70451109.14233.3038
520.222-0.10510.008845209.97113767.497661.3799
530.2506-0.17350.0145122891.294910240.9412101.1975
540.2774-0.07830.006525074.99682089.583145.712
550.30120.01530.0013956.331579.69438.9272
560.32360.00363e-0451.84614.32052.0786
570.34430.02450.0022444.1282203.677414.2716
580.3640.13410.011273571.31636130.94378.3003
590.38260.20860.0174177831.583714819.2986121.7345
600.40040.24290.0202241215.790620101.3159141.7791

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0877 & -0.0171 & 0.0014 & 1223.2856 & 101.9405 & 10.0966 \tabularnewline
50 & 0.1476 & -0.0824 & 0.0069 & 27995.0539 & 2332.9212 & 48.3003 \tabularnewline
51 & 0.1867 & -0.0571 & 0.0048 & 13309.7045 & 1109.142 & 33.3038 \tabularnewline
52 & 0.222 & -0.1051 & 0.0088 & 45209.9711 & 3767.4976 & 61.3799 \tabularnewline
53 & 0.2506 & -0.1735 & 0.0145 & 122891.2949 & 10240.9412 & 101.1975 \tabularnewline
54 & 0.2774 & -0.0783 & 0.0065 & 25074.9968 & 2089.5831 & 45.712 \tabularnewline
55 & 0.3012 & 0.0153 & 0.0013 & 956.3315 & 79.6943 & 8.9272 \tabularnewline
56 & 0.3236 & 0.0036 & 3e-04 & 51.8461 & 4.3205 & 2.0786 \tabularnewline
57 & 0.3443 & 0.0245 & 0.002 & 2444.1282 & 203.6774 & 14.2716 \tabularnewline
58 & 0.364 & 0.1341 & 0.0112 & 73571.3163 & 6130.943 & 78.3003 \tabularnewline
59 & 0.3826 & 0.2086 & 0.0174 & 177831.5837 & 14819.2986 & 121.7345 \tabularnewline
60 & 0.4004 & 0.2429 & 0.0202 & 241215.7906 & 20101.3159 & 141.7791 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70086&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.0877[/C][C]-0.0171[/C][C]0.0014[/C][C]1223.2856[/C][C]101.9405[/C][C]10.0966[/C][/ROW]
[ROW][C]50[/C][C]0.1476[/C][C]-0.0824[/C][C]0.0069[/C][C]27995.0539[/C][C]2332.9212[/C][C]48.3003[/C][/ROW]
[ROW][C]51[/C][C]0.1867[/C][C]-0.0571[/C][C]0.0048[/C][C]13309.7045[/C][C]1109.142[/C][C]33.3038[/C][/ROW]
[ROW][C]52[/C][C]0.222[/C][C]-0.1051[/C][C]0.0088[/C][C]45209.9711[/C][C]3767.4976[/C][C]61.3799[/C][/ROW]
[ROW][C]53[/C][C]0.2506[/C][C]-0.1735[/C][C]0.0145[/C][C]122891.2949[/C][C]10240.9412[/C][C]101.1975[/C][/ROW]
[ROW][C]54[/C][C]0.2774[/C][C]-0.0783[/C][C]0.0065[/C][C]25074.9968[/C][C]2089.5831[/C][C]45.712[/C][/ROW]
[ROW][C]55[/C][C]0.3012[/C][C]0.0153[/C][C]0.0013[/C][C]956.3315[/C][C]79.6943[/C][C]8.9272[/C][/ROW]
[ROW][C]56[/C][C]0.3236[/C][C]0.0036[/C][C]3e-04[/C][C]51.8461[/C][C]4.3205[/C][C]2.0786[/C][/ROW]
[ROW][C]57[/C][C]0.3443[/C][C]0.0245[/C][C]0.002[/C][C]2444.1282[/C][C]203.6774[/C][C]14.2716[/C][/ROW]
[ROW][C]58[/C][C]0.364[/C][C]0.1341[/C][C]0.0112[/C][C]73571.3163[/C][C]6130.943[/C][C]78.3003[/C][/ROW]
[ROW][C]59[/C][C]0.3826[/C][C]0.2086[/C][C]0.0174[/C][C]177831.5837[/C][C]14819.2986[/C][C]121.7345[/C][/ROW]
[ROW][C]60[/C][C]0.4004[/C][C]0.2429[/C][C]0.0202[/C][C]241215.7906[/C][C]20101.3159[/C][C]141.7791[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70086&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70086&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.0877-0.01710.00141223.2856101.940510.0966
500.1476-0.08240.006927995.05392332.921248.3003
510.1867-0.05710.004813309.70451109.14233.3038
520.222-0.10510.008845209.97113767.497661.3799
530.2506-0.17350.0145122891.294910240.9412101.1975
540.2774-0.07830.006525074.99682089.583145.712
550.30120.01530.0013956.331579.69438.9272
560.32360.00363e-0451.84614.32052.0786
570.34430.02450.0022444.1282203.677414.2716
580.3640.13410.011273571.31636130.94378.3003
590.38260.20860.0174177831.583714819.2986121.7345
600.40040.24290.0202241215.790620101.3159141.7791



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