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, 18 Dec 2016 23:55:26 +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/18/t1482101760d4p18b9h3yais89.htm/, Retrieved Thu, 09 May 2024 00:40:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301263, Retrieved Thu, 09 May 2024 00:40:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact70
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2016-12-16 13:36:55] [683f400e1b95307fc738e729f07c4fce]
- RM    [Exponential Smoothing] [] [2016-12-16 13:42:25] [683f400e1b95307fc738e729f07c4fce]
- RMP     [ARIMA Backward Selection] [] [2016-12-18 22:30:58] [683f400e1b95307fc738e729f07c4fce]
- RM          [ARIMA Forecasting] [] [2016-12-18 22:55:26] [404ac5ee4f7301873f6a96ef36861981] [Current]
- R P           [ARIMA Forecasting] [] [2016-12-19 19:52:13] [683f400e1b95307fc738e729f07c4fce]
Feedback Forum

Post a new message
Dataseries X:
6086
6090.5
6103.5
6144
6190.5
6225
6272
6294
6366
6426
6477
6500
6538
6581
6615.5
6639.5
6651
6665
6684
6684.5
6666.5
6666.5
6651
6652
6647
6618.5
6604.5
6572
6556
6535
6515.5
6515
6489
6491
6483.5
6486.5
6486.5
6478.5
6461
6458.5
6446
6420
6397.5
6408
6408.5
6401.5
6408.5
6417.5
6406.5
6426.5
6431.5
6441.5
6446
6450
6468
6488.5
6512
6525
6551
6567.5
6560.5
6572
6574.5
6583.5
6589.5
6600
6601
6586
6590
6616
6641.5
6647
6662
6663.5
6663
6653.5
6642.5
6624.5
6605.5
6604.5
6575
6566
6562.5
6560.5
6502
6552.5
6542.5
6536
6516.5
6506.5
6491.5
6469.5
6445
6426
6355.5
6340
6307.5
6254.5
6230.5
6213
6212.5
6203
6204
6220.5
6205
6199.5
6184.5
6169
6140.5
6144.5
6145.5
6148.5
6145
6133
6138
6104.5
6090.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301263&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[105])
1046220.5-------
1056205-------
1066199.56207.05696173.90696240.20690.32750.54840.54840.5484
1076184.56205.38946152.65616258.12280.21880.58660.58660.5058
10861696205.94956130.47086281.42810.16870.71120.71120.5098
1096140.56201.73096099.97226303.48970.11910.73580.73580.4749
1106144.56202.60936070.67826334.54030.1940.82190.82190.4858
1116145.56199.54876036.03296363.06440.25850.74530.74530.474
1126148.56199.77316001.9596397.58730.30570.70460.70460.4793
11361456196.70215962.71156430.69270.33250.65680.65680.4723
11461336196.98275924.5086469.45750.32270.64580.64580.477
11561386194.02835881.50066506.5560.36270.6490.6490.4726
1166104.56194.14975839.46726548.83230.31020.62180.62180.4761
1176090.56191.30285792.97846589.62720.30990.66540.66540.4731

\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[105]) \tabularnewline
104 & 6220.5 & - & - & - & - & - & - & - \tabularnewline
105 & 6205 & - & - & - & - & - & - & - \tabularnewline
106 & 6199.5 & 6207.0569 & 6173.9069 & 6240.2069 & 0.3275 & 0.5484 & 0.5484 & 0.5484 \tabularnewline
107 & 6184.5 & 6205.3894 & 6152.6561 & 6258.1228 & 0.2188 & 0.5866 & 0.5866 & 0.5058 \tabularnewline
108 & 6169 & 6205.9495 & 6130.4708 & 6281.4281 & 0.1687 & 0.7112 & 0.7112 & 0.5098 \tabularnewline
109 & 6140.5 & 6201.7309 & 6099.9722 & 6303.4897 & 0.1191 & 0.7358 & 0.7358 & 0.4749 \tabularnewline
110 & 6144.5 & 6202.6093 & 6070.6782 & 6334.5403 & 0.194 & 0.8219 & 0.8219 & 0.4858 \tabularnewline
111 & 6145.5 & 6199.5487 & 6036.0329 & 6363.0644 & 0.2585 & 0.7453 & 0.7453 & 0.474 \tabularnewline
112 & 6148.5 & 6199.7731 & 6001.959 & 6397.5873 & 0.3057 & 0.7046 & 0.7046 & 0.4793 \tabularnewline
113 & 6145 & 6196.7021 & 5962.7115 & 6430.6927 & 0.3325 & 0.6568 & 0.6568 & 0.4723 \tabularnewline
114 & 6133 & 6196.9827 & 5924.508 & 6469.4575 & 0.3227 & 0.6458 & 0.6458 & 0.477 \tabularnewline
115 & 6138 & 6194.0283 & 5881.5006 & 6506.556 & 0.3627 & 0.649 & 0.649 & 0.4726 \tabularnewline
116 & 6104.5 & 6194.1497 & 5839.4672 & 6548.8323 & 0.3102 & 0.6218 & 0.6218 & 0.4761 \tabularnewline
117 & 6090.5 & 6191.3028 & 5792.9784 & 6589.6272 & 0.3099 & 0.6654 & 0.6654 & 0.4731 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301263&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[105])[/C][/ROW]
[ROW][C]104[/C][C]6220.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6199.5[/C][C]6207.0569[/C][C]6173.9069[/C][C]6240.2069[/C][C]0.3275[/C][C]0.5484[/C][C]0.5484[/C][C]0.5484[/C][/ROW]
[ROW][C]107[/C][C]6184.5[/C][C]6205.3894[/C][C]6152.6561[/C][C]6258.1228[/C][C]0.2188[/C][C]0.5866[/C][C]0.5866[/C][C]0.5058[/C][/ROW]
[ROW][C]108[/C][C]6169[/C][C]6205.9495[/C][C]6130.4708[/C][C]6281.4281[/C][C]0.1687[/C][C]0.7112[/C][C]0.7112[/C][C]0.5098[/C][/ROW]
[ROW][C]109[/C][C]6140.5[/C][C]6201.7309[/C][C]6099.9722[/C][C]6303.4897[/C][C]0.1191[/C][C]0.7358[/C][C]0.7358[/C][C]0.4749[/C][/ROW]
[ROW][C]110[/C][C]6144.5[/C][C]6202.6093[/C][C]6070.6782[/C][C]6334.5403[/C][C]0.194[/C][C]0.8219[/C][C]0.8219[/C][C]0.4858[/C][/ROW]
[ROW][C]111[/C][C]6145.5[/C][C]6199.5487[/C][C]6036.0329[/C][C]6363.0644[/C][C]0.2585[/C][C]0.7453[/C][C]0.7453[/C][C]0.474[/C][/ROW]
[ROW][C]112[/C][C]6148.5[/C][C]6199.7731[/C][C]6001.959[/C][C]6397.5873[/C][C]0.3057[/C][C]0.7046[/C][C]0.7046[/C][C]0.4793[/C][/ROW]
[ROW][C]113[/C][C]6145[/C][C]6196.7021[/C][C]5962.7115[/C][C]6430.6927[/C][C]0.3325[/C][C]0.6568[/C][C]0.6568[/C][C]0.4723[/C][/ROW]
[ROW][C]114[/C][C]6133[/C][C]6196.9827[/C][C]5924.508[/C][C]6469.4575[/C][C]0.3227[/C][C]0.6458[/C][C]0.6458[/C][C]0.477[/C][/ROW]
[ROW][C]115[/C][C]6138[/C][C]6194.0283[/C][C]5881.5006[/C][C]6506.556[/C][C]0.3627[/C][C]0.649[/C][C]0.649[/C][C]0.4726[/C][/ROW]
[ROW][C]116[/C][C]6104.5[/C][C]6194.1497[/C][C]5839.4672[/C][C]6548.8323[/C][C]0.3102[/C][C]0.6218[/C][C]0.6218[/C][C]0.4761[/C][/ROW]
[ROW][C]117[/C][C]6090.5[/C][C]6191.3028[/C][C]5792.9784[/C][C]6589.6272[/C][C]0.3099[/C][C]0.6654[/C][C]0.6654[/C][C]0.4731[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301263&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301263&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[105])
1046220.5-------
1056205-------
1066199.56207.05696173.90696240.20690.32750.54840.54840.5484
1076184.56205.38946152.65616258.12280.21880.58660.58660.5058
10861696205.94956130.47086281.42810.16870.71120.71120.5098
1096140.56201.73096099.97226303.48970.11910.73580.73580.4749
1106144.56202.60936070.67826334.54030.1940.82190.82190.4858
1116145.56199.54876036.03296363.06440.25850.74530.74530.474
1126148.56199.77316001.9596397.58730.30570.70460.70460.4793
11361456196.70215962.71156430.69270.33250.65680.65680.4723
11461336196.98275924.5086469.45750.32270.64580.64580.477
11561386194.02835881.50066506.5560.36270.6490.6490.4726
1166104.56194.14975839.46726548.83230.31020.62180.62180.4761
1176090.56191.30285792.97846589.62720.30990.66540.66540.4731







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1060.0027-0.00120.00120.001257.106600-0.61570.6157
1070.0043-0.00340.00230.0023436.3687246.737715.7079-1.70211.1589
1080.0062-0.0060.00350.00351365.2619619.579124.8913-3.01071.7762
1090.0084-0.010.00510.00513749.22821401.991437.4432-4.98922.5794
1100.0109-0.00950.0060.0063376.69041796.931242.3902-4.73483.0105
1110.0135-0.00880.00650.00642921.25781984.318944.5457-4.4043.2428
1120.0163-0.00830.00670.00672628.93552076.40745.5676-4.17783.3763
1130.0193-0.00840.00690.00692673.1052150.994346.3788-4.21283.4809
1140.0224-0.01040.00730.00734093.79022366.860548.6504-5.21343.6734
1150.0257-0.00910.00750.00753139.17212444.091649.4378-4.56533.7626
1160.0292-0.01470.00820.00818037.07592952.544854.3373-7.30484.0846
1170.0328-0.01660.00890.008810161.20493553.266459.6093-8.21364.4287

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
106 & 0.0027 & -0.0012 & 0.0012 & 0.0012 & 57.1066 & 0 & 0 & -0.6157 & 0.6157 \tabularnewline
107 & 0.0043 & -0.0034 & 0.0023 & 0.0023 & 436.3687 & 246.7377 & 15.7079 & -1.7021 & 1.1589 \tabularnewline
108 & 0.0062 & -0.006 & 0.0035 & 0.0035 & 1365.2619 & 619.5791 & 24.8913 & -3.0107 & 1.7762 \tabularnewline
109 & 0.0084 & -0.01 & 0.0051 & 0.0051 & 3749.2282 & 1401.9914 & 37.4432 & -4.9892 & 2.5794 \tabularnewline
110 & 0.0109 & -0.0095 & 0.006 & 0.006 & 3376.6904 & 1796.9312 & 42.3902 & -4.7348 & 3.0105 \tabularnewline
111 & 0.0135 & -0.0088 & 0.0065 & 0.0064 & 2921.2578 & 1984.3189 & 44.5457 & -4.404 & 3.2428 \tabularnewline
112 & 0.0163 & -0.0083 & 0.0067 & 0.0067 & 2628.9355 & 2076.407 & 45.5676 & -4.1778 & 3.3763 \tabularnewline
113 & 0.0193 & -0.0084 & 0.0069 & 0.0069 & 2673.105 & 2150.9943 & 46.3788 & -4.2128 & 3.4809 \tabularnewline
114 & 0.0224 & -0.0104 & 0.0073 & 0.0073 & 4093.7902 & 2366.8605 & 48.6504 & -5.2134 & 3.6734 \tabularnewline
115 & 0.0257 & -0.0091 & 0.0075 & 0.0075 & 3139.1721 & 2444.0916 & 49.4378 & -4.5653 & 3.7626 \tabularnewline
116 & 0.0292 & -0.0147 & 0.0082 & 0.0081 & 8037.0759 & 2952.5448 & 54.3373 & -7.3048 & 4.0846 \tabularnewline
117 & 0.0328 & -0.0166 & 0.0089 & 0.0088 & 10161.2049 & 3553.2664 & 59.6093 & -8.2136 & 4.4287 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301263&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]106[/C][C]0.0027[/C][C]-0.0012[/C][C]0.0012[/C][C]0.0012[/C][C]57.1066[/C][C]0[/C][C]0[/C][C]-0.6157[/C][C]0.6157[/C][/ROW]
[ROW][C]107[/C][C]0.0043[/C][C]-0.0034[/C][C]0.0023[/C][C]0.0023[/C][C]436.3687[/C][C]246.7377[/C][C]15.7079[/C][C]-1.7021[/C][C]1.1589[/C][/ROW]
[ROW][C]108[/C][C]0.0062[/C][C]-0.006[/C][C]0.0035[/C][C]0.0035[/C][C]1365.2619[/C][C]619.5791[/C][C]24.8913[/C][C]-3.0107[/C][C]1.7762[/C][/ROW]
[ROW][C]109[/C][C]0.0084[/C][C]-0.01[/C][C]0.0051[/C][C]0.0051[/C][C]3749.2282[/C][C]1401.9914[/C][C]37.4432[/C][C]-4.9892[/C][C]2.5794[/C][/ROW]
[ROW][C]110[/C][C]0.0109[/C][C]-0.0095[/C][C]0.006[/C][C]0.006[/C][C]3376.6904[/C][C]1796.9312[/C][C]42.3902[/C][C]-4.7348[/C][C]3.0105[/C][/ROW]
[ROW][C]111[/C][C]0.0135[/C][C]-0.0088[/C][C]0.0065[/C][C]0.0064[/C][C]2921.2578[/C][C]1984.3189[/C][C]44.5457[/C][C]-4.404[/C][C]3.2428[/C][/ROW]
[ROW][C]112[/C][C]0.0163[/C][C]-0.0083[/C][C]0.0067[/C][C]0.0067[/C][C]2628.9355[/C][C]2076.407[/C][C]45.5676[/C][C]-4.1778[/C][C]3.3763[/C][/ROW]
[ROW][C]113[/C][C]0.0193[/C][C]-0.0084[/C][C]0.0069[/C][C]0.0069[/C][C]2673.105[/C][C]2150.9943[/C][C]46.3788[/C][C]-4.2128[/C][C]3.4809[/C][/ROW]
[ROW][C]114[/C][C]0.0224[/C][C]-0.0104[/C][C]0.0073[/C][C]0.0073[/C][C]4093.7902[/C][C]2366.8605[/C][C]48.6504[/C][C]-5.2134[/C][C]3.6734[/C][/ROW]
[ROW][C]115[/C][C]0.0257[/C][C]-0.0091[/C][C]0.0075[/C][C]0.0075[/C][C]3139.1721[/C][C]2444.0916[/C][C]49.4378[/C][C]-4.5653[/C][C]3.7626[/C][/ROW]
[ROW][C]116[/C][C]0.0292[/C][C]-0.0147[/C][C]0.0082[/C][C]0.0081[/C][C]8037.0759[/C][C]2952.5448[/C][C]54.3373[/C][C]-7.3048[/C][C]4.0846[/C][/ROW]
[ROW][C]117[/C][C]0.0328[/C][C]-0.0166[/C][C]0.0089[/C][C]0.0088[/C][C]10161.2049[/C][C]3553.2664[/C][C]59.6093[/C][C]-8.2136[/C][C]4.4287[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301263&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301263&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
1060.0027-0.00120.00120.001257.106600-0.61570.6157
1070.0043-0.00340.00230.0023436.3687246.737715.7079-1.70211.1589
1080.0062-0.0060.00350.00351365.2619619.579124.8913-3.01071.7762
1090.0084-0.010.00510.00513749.22821401.991437.4432-4.98922.5794
1100.0109-0.00950.0060.0063376.69041796.931242.3902-4.73483.0105
1110.0135-0.00880.00650.00642921.25781984.318944.5457-4.4043.2428
1120.0163-0.00830.00670.00672628.93552076.40745.5676-4.17783.3763
1130.0193-0.00840.00690.00692673.1052150.994346.3788-4.21283.4809
1140.0224-0.01040.00730.00734093.79022366.860548.6504-5.21343.6734
1150.0257-0.00910.00750.00753139.17212444.091649.4378-4.56533.7626
1160.0292-0.01470.00820.00818037.07592952.544854.3373-7.30484.0846
1170.0328-0.01660.00890.008810161.20493553.266459.6093-8.21364.4287



Parameters (Session):
par1 = 60 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 1 ; par6 = 3 ; par7 = 1 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '2'
par7 <- '1'
par6 <- '3'
par5 <- '1'
par4 <- '0'
par3 <- '2'
par2 <- '1'
par1 <- '12'
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')