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 computationFri, 11 Dec 2009 09:53:15 -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/11/t126055043436kcgiqpm5iukvk.htm/, Retrieved Sun, 28 Apr 2024 21:27:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66544, Retrieved Sun, 28 Apr 2024 21:27:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact145
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [] [2009-12-10 14:42:46] [d181e5359f7da6c8509e4702d1229fb0]
-    D      [ARIMA Forecasting] [] [2009-12-11 16:53:15] [a1151e037da67acc5ce4bbcb8804d7f1] [Current]
Feedback Forum

Post a new message
Dataseries X:
3353
3186
3902
4164
3499
4145
3796
3711
3949
3740
3243
4407
4814
3908
5250
3937
4004
5560
3922
3759
4138
4634
3996
4308
4143
4429
5219
4929
5755
5592
4163
4962
5208
4755
4491
5732
5731
5040
6102
4904
5369
5578
4619
4731
5011
5299
4146
4625
4736
4219
5116
4205
4121
5103
4300
4578
3809
5526
4247
3830
4394




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66544&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]1 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=66544&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66544&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 time1 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[49])
375731-------
385040-------
396102-------
404904-------
415369-------
425578-------
434619-------
444731-------
455011-------
465299-------
474146-------
484625-------
494736-------
5042194015.80432840.34725191.26150.36740.11490.04380.1149
5151164512.41832847.08096177.75570.23870.63510.03070.3962
5242053642.69191488.35035797.03360.30450.09010.12560.1599
5341213560.7204636.2216485.21990.35360.33290.11280.2154
5451033714.532-53.69397482.75780.23510.41630.16620.2976
5543002302.5641-2251.17616856.30440.1950.1140.15940.1475
5645782195.9358-3255.56067647.43210.19590.22470.1810.1806
5738092141.0979-4299.11668581.31250.30590.22920.19120.2148
5855261844.9104-5589.40569279.22650.16590.30230.18120.223
594247884.182-7590.98299359.3470.21840.14150.22530.1865
6038301374.5843-8213.831410963.00010.30790.27850.25320.246
6143941128.0983-9602.80211858.99870.27540.31080.2550.255

\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[49]) \tabularnewline
37 & 5731 & - & - & - & - & - & - & - \tabularnewline
38 & 5040 & - & - & - & - & - & - & - \tabularnewline
39 & 6102 & - & - & - & - & - & - & - \tabularnewline
40 & 4904 & - & - & - & - & - & - & - \tabularnewline
41 & 5369 & - & - & - & - & - & - & - \tabularnewline
42 & 5578 & - & - & - & - & - & - & - \tabularnewline
43 & 4619 & - & - & - & - & - & - & - \tabularnewline
44 & 4731 & - & - & - & - & - & - & - \tabularnewline
45 & 5011 & - & - & - & - & - & - & - \tabularnewline
46 & 5299 & - & - & - & - & - & - & - \tabularnewline
47 & 4146 & - & - & - & - & - & - & - \tabularnewline
48 & 4625 & - & - & - & - & - & - & - \tabularnewline
49 & 4736 & - & - & - & - & - & - & - \tabularnewline
50 & 4219 & 4015.8043 & 2840.3472 & 5191.2615 & 0.3674 & 0.1149 & 0.0438 & 0.1149 \tabularnewline
51 & 5116 & 4512.4183 & 2847.0809 & 6177.7557 & 0.2387 & 0.6351 & 0.0307 & 0.3962 \tabularnewline
52 & 4205 & 3642.6919 & 1488.3503 & 5797.0336 & 0.3045 & 0.0901 & 0.1256 & 0.1599 \tabularnewline
53 & 4121 & 3560.7204 & 636.221 & 6485.2199 & 0.3536 & 0.3329 & 0.1128 & 0.2154 \tabularnewline
54 & 5103 & 3714.532 & -53.6939 & 7482.7578 & 0.2351 & 0.4163 & 0.1662 & 0.2976 \tabularnewline
55 & 4300 & 2302.5641 & -2251.1761 & 6856.3044 & 0.195 & 0.114 & 0.1594 & 0.1475 \tabularnewline
56 & 4578 & 2195.9358 & -3255.5606 & 7647.4321 & 0.1959 & 0.2247 & 0.181 & 0.1806 \tabularnewline
57 & 3809 & 2141.0979 & -4299.1166 & 8581.3125 & 0.3059 & 0.2292 & 0.1912 & 0.2148 \tabularnewline
58 & 5526 & 1844.9104 & -5589.4056 & 9279.2265 & 0.1659 & 0.3023 & 0.1812 & 0.223 \tabularnewline
59 & 4247 & 884.182 & -7590.9829 & 9359.347 & 0.2184 & 0.1415 & 0.2253 & 0.1865 \tabularnewline
60 & 3830 & 1374.5843 & -8213.8314 & 10963.0001 & 0.3079 & 0.2785 & 0.2532 & 0.246 \tabularnewline
61 & 4394 & 1128.0983 & -9602.802 & 11858.9987 & 0.2754 & 0.3108 & 0.255 & 0.255 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66544&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[49])[/C][/ROW]
[ROW][C]37[/C][C]5731[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]5040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]6102[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4904[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]5369[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]5578[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4619[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4731[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5011[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]5299[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4146[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4625[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4736[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]4219[/C][C]4015.8043[/C][C]2840.3472[/C][C]5191.2615[/C][C]0.3674[/C][C]0.1149[/C][C]0.0438[/C][C]0.1149[/C][/ROW]
[ROW][C]51[/C][C]5116[/C][C]4512.4183[/C][C]2847.0809[/C][C]6177.7557[/C][C]0.2387[/C][C]0.6351[/C][C]0.0307[/C][C]0.3962[/C][/ROW]
[ROW][C]52[/C][C]4205[/C][C]3642.6919[/C][C]1488.3503[/C][C]5797.0336[/C][C]0.3045[/C][C]0.0901[/C][C]0.1256[/C][C]0.1599[/C][/ROW]
[ROW][C]53[/C][C]4121[/C][C]3560.7204[/C][C]636.221[/C][C]6485.2199[/C][C]0.3536[/C][C]0.3329[/C][C]0.1128[/C][C]0.2154[/C][/ROW]
[ROW][C]54[/C][C]5103[/C][C]3714.532[/C][C]-53.6939[/C][C]7482.7578[/C][C]0.2351[/C][C]0.4163[/C][C]0.1662[/C][C]0.2976[/C][/ROW]
[ROW][C]55[/C][C]4300[/C][C]2302.5641[/C][C]-2251.1761[/C][C]6856.3044[/C][C]0.195[/C][C]0.114[/C][C]0.1594[/C][C]0.1475[/C][/ROW]
[ROW][C]56[/C][C]4578[/C][C]2195.9358[/C][C]-3255.5606[/C][C]7647.4321[/C][C]0.1959[/C][C]0.2247[/C][C]0.181[/C][C]0.1806[/C][/ROW]
[ROW][C]57[/C][C]3809[/C][C]2141.0979[/C][C]-4299.1166[/C][C]8581.3125[/C][C]0.3059[/C][C]0.2292[/C][C]0.1912[/C][C]0.2148[/C][/ROW]
[ROW][C]58[/C][C]5526[/C][C]1844.9104[/C][C]-5589.4056[/C][C]9279.2265[/C][C]0.1659[/C][C]0.3023[/C][C]0.1812[/C][C]0.223[/C][/ROW]
[ROW][C]59[/C][C]4247[/C][C]884.182[/C][C]-7590.9829[/C][C]9359.347[/C][C]0.2184[/C][C]0.1415[/C][C]0.2253[/C][C]0.1865[/C][/ROW]
[ROW][C]60[/C][C]3830[/C][C]1374.5843[/C][C]-8213.8314[/C][C]10963.0001[/C][C]0.3079[/C][C]0.2785[/C][C]0.2532[/C][C]0.246[/C][/ROW]
[ROW][C]61[/C][C]4394[/C][C]1128.0983[/C][C]-9602.802[/C][C]11858.9987[/C][C]0.2754[/C][C]0.3108[/C][C]0.255[/C][C]0.255[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66544&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66544&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[49])
375731-------
385040-------
396102-------
404904-------
415369-------
425578-------
434619-------
444731-------
455011-------
465299-------
474146-------
484625-------
494736-------
5042194015.80432840.34725191.26150.36740.11490.04380.1149
5151164512.41832847.08096177.75570.23870.63510.03070.3962
5242053642.69191488.35035797.03360.30450.09010.12560.1599
5341213560.7204636.2216485.21990.35360.33290.11280.2154
5451033714.532-53.69397482.75780.23510.41630.16620.2976
5543002302.5641-2251.17616856.30440.1950.1140.15940.1475
5645782195.9358-3255.56067647.43210.19590.22470.1810.1806
5738092141.0979-4299.11668581.31250.30590.22920.19120.2148
5855261844.9104-5589.40569279.22650.16590.30230.18120.223
594247884.182-7590.98299359.3470.21840.14150.22530.1865
6038301374.5843-8213.831410963.00010.30790.27850.25320.246
6143941128.0983-9602.80211858.99870.27540.31080.2550.255







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.14930.0506041288.478100
510.18830.13380.0922364310.8984202799.6882450.3329
520.30170.15440.1129316190.3433240596.5732490.5064
530.4190.15740.124313913.1971258925.7292508.8475
540.51760.37380.1741927843.5092592709.2852769.8761
551.0090.86750.28963989750.02021158882.74111076.5142
561.26661.08480.40325674229.91081803932.33671343.1055
571.53460.7790.45012781897.33071926177.9611387.8681
582.05591.99530.621813550420.47673217760.46271793.8117
594.89053.80330.9411308544.67914026838.88442006.6985
603.55891.78631.01696029066.11454208859.54162051.5505
614.85332.89511.173410666113.78464746964.06192178.7529

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.1493 & 0.0506 & 0 & 41288.4781 & 0 & 0 \tabularnewline
51 & 0.1883 & 0.1338 & 0.0922 & 364310.8984 & 202799.6882 & 450.3329 \tabularnewline
52 & 0.3017 & 0.1544 & 0.1129 & 316190.3433 & 240596.5732 & 490.5064 \tabularnewline
53 & 0.419 & 0.1574 & 0.124 & 313913.1971 & 258925.7292 & 508.8475 \tabularnewline
54 & 0.5176 & 0.3738 & 0.174 & 1927843.5092 & 592709.2852 & 769.8761 \tabularnewline
55 & 1.009 & 0.8675 & 0.2896 & 3989750.0202 & 1158882.7411 & 1076.5142 \tabularnewline
56 & 1.2666 & 1.0848 & 0.4032 & 5674229.9108 & 1803932.3367 & 1343.1055 \tabularnewline
57 & 1.5346 & 0.779 & 0.4501 & 2781897.3307 & 1926177.961 & 1387.8681 \tabularnewline
58 & 2.0559 & 1.9953 & 0.6218 & 13550420.4767 & 3217760.4627 & 1793.8117 \tabularnewline
59 & 4.8905 & 3.8033 & 0.94 & 11308544.6791 & 4026838.8844 & 2006.6985 \tabularnewline
60 & 3.5589 & 1.7863 & 1.0169 & 6029066.1145 & 4208859.5416 & 2051.5505 \tabularnewline
61 & 4.8533 & 2.8951 & 1.1734 & 10666113.7846 & 4746964.0619 & 2178.7529 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66544&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]50[/C][C]0.1493[/C][C]0.0506[/C][C]0[/C][C]41288.4781[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.1883[/C][C]0.1338[/C][C]0.0922[/C][C]364310.8984[/C][C]202799.6882[/C][C]450.3329[/C][/ROW]
[ROW][C]52[/C][C]0.3017[/C][C]0.1544[/C][C]0.1129[/C][C]316190.3433[/C][C]240596.5732[/C][C]490.5064[/C][/ROW]
[ROW][C]53[/C][C]0.419[/C][C]0.1574[/C][C]0.124[/C][C]313913.1971[/C][C]258925.7292[/C][C]508.8475[/C][/ROW]
[ROW][C]54[/C][C]0.5176[/C][C]0.3738[/C][C]0.174[/C][C]1927843.5092[/C][C]592709.2852[/C][C]769.8761[/C][/ROW]
[ROW][C]55[/C][C]1.009[/C][C]0.8675[/C][C]0.2896[/C][C]3989750.0202[/C][C]1158882.7411[/C][C]1076.5142[/C][/ROW]
[ROW][C]56[/C][C]1.2666[/C][C]1.0848[/C][C]0.4032[/C][C]5674229.9108[/C][C]1803932.3367[/C][C]1343.1055[/C][/ROW]
[ROW][C]57[/C][C]1.5346[/C][C]0.779[/C][C]0.4501[/C][C]2781897.3307[/C][C]1926177.961[/C][C]1387.8681[/C][/ROW]
[ROW][C]58[/C][C]2.0559[/C][C]1.9953[/C][C]0.6218[/C][C]13550420.4767[/C][C]3217760.4627[/C][C]1793.8117[/C][/ROW]
[ROW][C]59[/C][C]4.8905[/C][C]3.8033[/C][C]0.94[/C][C]11308544.6791[/C][C]4026838.8844[/C][C]2006.6985[/C][/ROW]
[ROW][C]60[/C][C]3.5589[/C][C]1.7863[/C][C]1.0169[/C][C]6029066.1145[/C][C]4208859.5416[/C][C]2051.5505[/C][/ROW]
[ROW][C]61[/C][C]4.8533[/C][C]2.8951[/C][C]1.1734[/C][C]10666113.7846[/C][C]4746964.0619[/C][C]2178.7529[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66544&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66544&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
500.14930.0506041288.478100
510.18830.13380.0922364310.8984202799.6882450.3329
520.30170.15440.1129316190.3433240596.5732490.5064
530.4190.15740.124313913.1971258925.7292508.8475
540.51760.37380.1741927843.5092592709.2852769.8761
551.0090.86750.28963989750.02021158882.74111076.5142
561.26661.08480.40325674229.91081803932.33671343.1055
571.53460.7790.45012781897.33071926177.9611387.8681
582.05591.99530.621813550420.47673217760.46271793.8117
594.89053.80330.9411308544.67914026838.88442006.6985
603.55891.78631.01696029066.11454208859.54162051.5505
614.85332.89511.173410666113.78464746964.06192178.7529



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