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, 20 Dec 2016 17:24:36 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/20/t1482251120eb8d5dj494qsshu.htm/, Retrieved Sun, 28 Apr 2024 18:51:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301738, Retrieved Sun, 28 Apr 2024 18:51:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact55
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-20 16:24:36] [672675941468e072e71d9fb024f2b817] [Current]
Feedback Forum

Post a new message
Dataseries X:
5133
5155
5174
5201
5221
5205
5235
5255
5272
5299
5318
5340
5385
5430
5454
5493
5536
5565
5586
5594
5576
5544
5530
5536
5544
5564
5596
5596
5599
5591
5566
5532
5498
5484
5442
5447
5490
5544
5583
5628
5679
5691
5707
5724
5726
5745
5767
5789
5785
5785
5806
5827
5856
5896
5914
5938




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301738&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=301738&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301738&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[44])
325532-------
335498-------
345484-------
355442-------
365447-------
375490-------
385544-------
395583-------
405628-------
415679-------
425691-------
435707-------
445724-------
45572657415703.15225778.84780.21860.810710.8107
46574557585673.36965842.63040.38170.770710.7845
47576757755633.38635916.61370.45590.66110.7599
48578957925584.69885999.30120.48870.59340.99940.7399
49578558095528.31296089.68710.43350.55550.9870.7236
50578558265464.95466187.04540.41190.58810.93710.7101
51580658435395.17826290.82180.43570.60020.87240.6988
52582758605319.42466400.57540.45240.57760.79990.689
53585658775238.05486515.94520.47430.56090.72820.6806
54589658945151.37166636.62840.49790.53990.70390.6732
55591459115059.63386762.36620.49720.51380.68070.6666
56593859284963.06556892.93450.49190.51130.66070.6607

\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[44]) \tabularnewline
32 & 5532 & - & - & - & - & - & - & - \tabularnewline
33 & 5498 & - & - & - & - & - & - & - \tabularnewline
34 & 5484 & - & - & - & - & - & - & - \tabularnewline
35 & 5442 & - & - & - & - & - & - & - \tabularnewline
36 & 5447 & - & - & - & - & - & - & - \tabularnewline
37 & 5490 & - & - & - & - & - & - & - \tabularnewline
38 & 5544 & - & - & - & - & - & - & - \tabularnewline
39 & 5583 & - & - & - & - & - & - & - \tabularnewline
40 & 5628 & - & - & - & - & - & - & - \tabularnewline
41 & 5679 & - & - & - & - & - & - & - \tabularnewline
42 & 5691 & - & - & - & - & - & - & - \tabularnewline
43 & 5707 & - & - & - & - & - & - & - \tabularnewline
44 & 5724 & - & - & - & - & - & - & - \tabularnewline
45 & 5726 & 5741 & 5703.1522 & 5778.8478 & 0.2186 & 0.8107 & 1 & 0.8107 \tabularnewline
46 & 5745 & 5758 & 5673.3696 & 5842.6304 & 0.3817 & 0.7707 & 1 & 0.7845 \tabularnewline
47 & 5767 & 5775 & 5633.3863 & 5916.6137 & 0.4559 & 0.661 & 1 & 0.7599 \tabularnewline
48 & 5789 & 5792 & 5584.6988 & 5999.3012 & 0.4887 & 0.5934 & 0.9994 & 0.7399 \tabularnewline
49 & 5785 & 5809 & 5528.3129 & 6089.6871 & 0.4335 & 0.5555 & 0.987 & 0.7236 \tabularnewline
50 & 5785 & 5826 & 5464.9546 & 6187.0454 & 0.4119 & 0.5881 & 0.9371 & 0.7101 \tabularnewline
51 & 5806 & 5843 & 5395.1782 & 6290.8218 & 0.4357 & 0.6002 & 0.8724 & 0.6988 \tabularnewline
52 & 5827 & 5860 & 5319.4246 & 6400.5754 & 0.4524 & 0.5776 & 0.7999 & 0.689 \tabularnewline
53 & 5856 & 5877 & 5238.0548 & 6515.9452 & 0.4743 & 0.5609 & 0.7282 & 0.6806 \tabularnewline
54 & 5896 & 5894 & 5151.3716 & 6636.6284 & 0.4979 & 0.5399 & 0.7039 & 0.6732 \tabularnewline
55 & 5914 & 5911 & 5059.6338 & 6762.3662 & 0.4972 & 0.5138 & 0.6807 & 0.6666 \tabularnewline
56 & 5938 & 5928 & 4963.0655 & 6892.9345 & 0.4919 & 0.5113 & 0.6607 & 0.6607 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301738&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[44])[/C][/ROW]
[ROW][C]32[/C][C]5532[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]5498[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]5484[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]5442[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]5447[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]5490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]5544[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]5583[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]5628[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]5679[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]5691[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]5707[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]5724[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5726[/C][C]5741[/C][C]5703.1522[/C][C]5778.8478[/C][C]0.2186[/C][C]0.8107[/C][C]1[/C][C]0.8107[/C][/ROW]
[ROW][C]46[/C][C]5745[/C][C]5758[/C][C]5673.3696[/C][C]5842.6304[/C][C]0.3817[/C][C]0.7707[/C][C]1[/C][C]0.7845[/C][/ROW]
[ROW][C]47[/C][C]5767[/C][C]5775[/C][C]5633.3863[/C][C]5916.6137[/C][C]0.4559[/C][C]0.661[/C][C]1[/C][C]0.7599[/C][/ROW]
[ROW][C]48[/C][C]5789[/C][C]5792[/C][C]5584.6988[/C][C]5999.3012[/C][C]0.4887[/C][C]0.5934[/C][C]0.9994[/C][C]0.7399[/C][/ROW]
[ROW][C]49[/C][C]5785[/C][C]5809[/C][C]5528.3129[/C][C]6089.6871[/C][C]0.4335[/C][C]0.5555[/C][C]0.987[/C][C]0.7236[/C][/ROW]
[ROW][C]50[/C][C]5785[/C][C]5826[/C][C]5464.9546[/C][C]6187.0454[/C][C]0.4119[/C][C]0.5881[/C][C]0.9371[/C][C]0.7101[/C][/ROW]
[ROW][C]51[/C][C]5806[/C][C]5843[/C][C]5395.1782[/C][C]6290.8218[/C][C]0.4357[/C][C]0.6002[/C][C]0.8724[/C][C]0.6988[/C][/ROW]
[ROW][C]52[/C][C]5827[/C][C]5860[/C][C]5319.4246[/C][C]6400.5754[/C][C]0.4524[/C][C]0.5776[/C][C]0.7999[/C][C]0.689[/C][/ROW]
[ROW][C]53[/C][C]5856[/C][C]5877[/C][C]5238.0548[/C][C]6515.9452[/C][C]0.4743[/C][C]0.5609[/C][C]0.7282[/C][C]0.6806[/C][/ROW]
[ROW][C]54[/C][C]5896[/C][C]5894[/C][C]5151.3716[/C][C]6636.6284[/C][C]0.4979[/C][C]0.5399[/C][C]0.7039[/C][C]0.6732[/C][/ROW]
[ROW][C]55[/C][C]5914[/C][C]5911[/C][C]5059.6338[/C][C]6762.3662[/C][C]0.4972[/C][C]0.5138[/C][C]0.6807[/C][C]0.6666[/C][/ROW]
[ROW][C]56[/C][C]5938[/C][C]5928[/C][C]4963.0655[/C][C]6892.9345[/C][C]0.4919[/C][C]0.5113[/C][C]0.6607[/C][C]0.6607[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301738&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301738&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[44])
325532-------
335498-------
345484-------
355442-------
365447-------
375490-------
385544-------
395583-------
405628-------
415679-------
425691-------
435707-------
445724-------
45572657415703.15225778.84780.21860.810710.8107
46574557585673.36965842.63040.38170.770710.7845
47576757755633.38635916.61370.45590.66110.7599
48578957925584.69885999.30120.48870.59340.99940.7399
49578558095528.31296089.68710.43350.55550.9870.7236
50578558265464.95466187.04540.41190.58810.93710.7101
51580658435395.17826290.82180.43570.60020.87240.6988
52582758605319.42466400.57540.45240.57760.79990.689
53585658775238.05486515.94520.47430.56090.72820.6806
54589658945151.37166636.62840.49790.53990.70390.6732
55591459115059.63386762.36620.49720.51380.68070.6666
56593859284963.06556892.93450.49190.51130.66070.6607







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
450.0034-0.00260.00260.002622500-0.750.75
460.0075-0.00230.00240.002416919714.0357-0.650.7
470.0125-0.00140.00210.002164152.666712.3558-0.40.6
480.0183-5e-040.00170.00179116.7510.8051-0.150.4875
490.0247-0.00410.00220.0022576208.614.443-1.20.63
500.0316-0.00710.0030.003168145421.3073-2.050.8667
510.0391-0.00640.00350.00351369584.714324.1809-1.851.0071
520.0471-0.00570.00380.00371089647.7525.4509-1.651.0875
530.0555-0.00360.00370.0037441624.777824.9956-1.051.0833
540.06433e-040.00340.00344562.723.72130.10.985
550.07355e-040.00310.00319512.363622.63550.150.9091
560.0830.00170.0030.00310047821.86320.50.875

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
45 & 0.0034 & -0.0026 & 0.0026 & 0.0026 & 225 & 0 & 0 & -0.75 & 0.75 \tabularnewline
46 & 0.0075 & -0.0023 & 0.0024 & 0.0024 & 169 & 197 & 14.0357 & -0.65 & 0.7 \tabularnewline
47 & 0.0125 & -0.0014 & 0.0021 & 0.0021 & 64 & 152.6667 & 12.3558 & -0.4 & 0.6 \tabularnewline
48 & 0.0183 & -5e-04 & 0.0017 & 0.0017 & 9 & 116.75 & 10.8051 & -0.15 & 0.4875 \tabularnewline
49 & 0.0247 & -0.0041 & 0.0022 & 0.0022 & 576 & 208.6 & 14.443 & -1.2 & 0.63 \tabularnewline
50 & 0.0316 & -0.0071 & 0.003 & 0.003 & 1681 & 454 & 21.3073 & -2.05 & 0.8667 \tabularnewline
51 & 0.0391 & -0.0064 & 0.0035 & 0.0035 & 1369 & 584.7143 & 24.1809 & -1.85 & 1.0071 \tabularnewline
52 & 0.0471 & -0.0057 & 0.0038 & 0.0037 & 1089 & 647.75 & 25.4509 & -1.65 & 1.0875 \tabularnewline
53 & 0.0555 & -0.0036 & 0.0037 & 0.0037 & 441 & 624.7778 & 24.9956 & -1.05 & 1.0833 \tabularnewline
54 & 0.0643 & 3e-04 & 0.0034 & 0.0034 & 4 & 562.7 & 23.7213 & 0.1 & 0.985 \tabularnewline
55 & 0.0735 & 5e-04 & 0.0031 & 0.0031 & 9 & 512.3636 & 22.6355 & 0.15 & 0.9091 \tabularnewline
56 & 0.083 & 0.0017 & 0.003 & 0.003 & 100 & 478 & 21.8632 & 0.5 & 0.875 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301738&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]45[/C][C]0.0034[/C][C]-0.0026[/C][C]0.0026[/C][C]0.0026[/C][C]225[/C][C]0[/C][C]0[/C][C]-0.75[/C][C]0.75[/C][/ROW]
[ROW][C]46[/C][C]0.0075[/C][C]-0.0023[/C][C]0.0024[/C][C]0.0024[/C][C]169[/C][C]197[/C][C]14.0357[/C][C]-0.65[/C][C]0.7[/C][/ROW]
[ROW][C]47[/C][C]0.0125[/C][C]-0.0014[/C][C]0.0021[/C][C]0.0021[/C][C]64[/C][C]152.6667[/C][C]12.3558[/C][C]-0.4[/C][C]0.6[/C][/ROW]
[ROW][C]48[/C][C]0.0183[/C][C]-5e-04[/C][C]0.0017[/C][C]0.0017[/C][C]9[/C][C]116.75[/C][C]10.8051[/C][C]-0.15[/C][C]0.4875[/C][/ROW]
[ROW][C]49[/C][C]0.0247[/C][C]-0.0041[/C][C]0.0022[/C][C]0.0022[/C][C]576[/C][C]208.6[/C][C]14.443[/C][C]-1.2[/C][C]0.63[/C][/ROW]
[ROW][C]50[/C][C]0.0316[/C][C]-0.0071[/C][C]0.003[/C][C]0.003[/C][C]1681[/C][C]454[/C][C]21.3073[/C][C]-2.05[/C][C]0.8667[/C][/ROW]
[ROW][C]51[/C][C]0.0391[/C][C]-0.0064[/C][C]0.0035[/C][C]0.0035[/C][C]1369[/C][C]584.7143[/C][C]24.1809[/C][C]-1.85[/C][C]1.0071[/C][/ROW]
[ROW][C]52[/C][C]0.0471[/C][C]-0.0057[/C][C]0.0038[/C][C]0.0037[/C][C]1089[/C][C]647.75[/C][C]25.4509[/C][C]-1.65[/C][C]1.0875[/C][/ROW]
[ROW][C]53[/C][C]0.0555[/C][C]-0.0036[/C][C]0.0037[/C][C]0.0037[/C][C]441[/C][C]624.7778[/C][C]24.9956[/C][C]-1.05[/C][C]1.0833[/C][/ROW]
[ROW][C]54[/C][C]0.0643[/C][C]3e-04[/C][C]0.0034[/C][C]0.0034[/C][C]4[/C][C]562.7[/C][C]23.7213[/C][C]0.1[/C][C]0.985[/C][/ROW]
[ROW][C]55[/C][C]0.0735[/C][C]5e-04[/C][C]0.0031[/C][C]0.0031[/C][C]9[/C][C]512.3636[/C][C]22.6355[/C][C]0.15[/C][C]0.9091[/C][/ROW]
[ROW][C]56[/C][C]0.083[/C][C]0.0017[/C][C]0.003[/C][C]0.003[/C][C]100[/C][C]478[/C][C]21.8632[/C][C]0.5[/C][C]0.875[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301738&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301738&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
450.0034-0.00260.00260.002622500-0.750.75
460.0075-0.00230.00240.002416919714.0357-0.650.7
470.0125-0.00140.00210.002164152.666712.3558-0.40.6
480.0183-5e-040.00170.00179116.7510.8051-0.150.4875
490.0247-0.00410.00220.0022576208.614.443-1.20.63
500.0316-0.00710.0030.003168145421.3073-2.050.8667
510.0391-0.00640.00350.00351369584.714324.1809-1.851.0071
520.0471-0.00570.00380.00371089647.7525.4509-1.651.0875
530.0555-0.00360.00370.0037441624.777824.9956-1.051.0833
540.06433e-040.00340.00344562.723.72130.10.985
550.07355e-040.00310.00319512.363622.63550.150.9091
560.0830.00170.0030.00310047821.86320.50.875



Parameters (Session):
par1 = 12 ; par2 = Single ; par3 = multiplicative ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')