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, 16 Dec 2008 11:52:54 -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/16/t1229453600su6yixw3tutaagw.htm/, Retrieved Wed, 15 May 2024 12:46:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34107, Retrieved Wed, 15 May 2024 12:46:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact180
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [Uitvoer.Nederland] [2008-12-03 15:11:10] [988ab43f527fc78aae41c84649095267]
-   P   [Univariate Data Series] [Export From Belgi...] [2008-12-03 15:52:29] [988ab43f527fc78aae41c84649095267]
- RMP     [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-11 16:07:50] [988ab43f527fc78aae41c84649095267]
-   P       [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 16:40:55] [988ab43f527fc78aae41c84649095267]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:52:54] [5d823194959040fa9b19b8c8302177e6] [Current]
Feedback Forum

Post a new message
Dataseries X:
3258.1
3140.1
3627.4
3279.4
3204
3515.6
3146.6
2271.7
3627.9
3553.4
3018.3
3355.4
3242
3311.1
4125.2
3423
3120.3
3863
3240.8
2837.4
3945
3684.1
3659.6
3769.6
3592.7
3754
4507.8
3853.2
3817.2
3958.4
3428.9
3125.7
3977
3983.3
4299.6
4306.9
4259.5
3986
4755.6
3925.6
4206.5
4323.4
3816.1
3410.7
4227.4
4296.9
4351.7
3800
4277
4100.2
4672.5
4189.9
4231.9
4654.9
4298.5
3635.9
4505.1
4891.9
4894.2
4093.2




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34107&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34107&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34107&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'George Udny Yule' @ 72.249.76.132







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])
364306.9-------
374259.5-------
383986-------
394755.6-------
403925.6-------
414206.5-------
424323.4-------
433816.1-------
443410.7-------
454227.4-------
464296.9-------
474351.7-------
483800-------
4942774097.30233628.76934565.83540.22610.89320.24870.8932
504100.23832.06643312.87954351.25340.15570.04650.28060.5482
514672.54510.74263966.29885055.18650.28020.93030.1890.9947
524189.93803.27573203.60844402.9430.10320.00220.34460.5043
534231.94064.72073447.01134682.43020.29790.34560.32640.7995
544654.94187.12113551.70634822.53580.07450.44510.33710.8838
554298.53718.28013065.99344370.56680.04060.00240.38440.403
563635.93309.772648.24893971.29120.1670.00170.38250.0732
574505.14140.70783470.45814810.95740.14330.93010.39990.8405
584891.94223.95163546.98994900.91340.02660.20780.41640.8902
594894.24282.99623601.31034964.68210.03940.040.42170.9175
604093.23741.13613055.41124426.86110.15715e-040.43320.4332

\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 & 4306.9 & - & - & - & - & - & - & - \tabularnewline
37 & 4259.5 & - & - & - & - & - & - & - \tabularnewline
38 & 3986 & - & - & - & - & - & - & - \tabularnewline
39 & 4755.6 & - & - & - & - & - & - & - \tabularnewline
40 & 3925.6 & - & - & - & - & - & - & - \tabularnewline
41 & 4206.5 & - & - & - & - & - & - & - \tabularnewline
42 & 4323.4 & - & - & - & - & - & - & - \tabularnewline
43 & 3816.1 & - & - & - & - & - & - & - \tabularnewline
44 & 3410.7 & - & - & - & - & - & - & - \tabularnewline
45 & 4227.4 & - & - & - & - & - & - & - \tabularnewline
46 & 4296.9 & - & - & - & - & - & - & - \tabularnewline
47 & 4351.7 & - & - & - & - & - & - & - \tabularnewline
48 & 3800 & - & - & - & - & - & - & - \tabularnewline
49 & 4277 & 4097.3023 & 3628.7693 & 4565.8354 & 0.2261 & 0.8932 & 0.2487 & 0.8932 \tabularnewline
50 & 4100.2 & 3832.0664 & 3312.8795 & 4351.2534 & 0.1557 & 0.0465 & 0.2806 & 0.5482 \tabularnewline
51 & 4672.5 & 4510.7426 & 3966.2988 & 5055.1865 & 0.2802 & 0.9303 & 0.189 & 0.9947 \tabularnewline
52 & 4189.9 & 3803.2757 & 3203.6084 & 4402.943 & 0.1032 & 0.0022 & 0.3446 & 0.5043 \tabularnewline
53 & 4231.9 & 4064.7207 & 3447.0113 & 4682.4302 & 0.2979 & 0.3456 & 0.3264 & 0.7995 \tabularnewline
54 & 4654.9 & 4187.1211 & 3551.7063 & 4822.5358 & 0.0745 & 0.4451 & 0.3371 & 0.8838 \tabularnewline
55 & 4298.5 & 3718.2801 & 3065.9934 & 4370.5668 & 0.0406 & 0.0024 & 0.3844 & 0.403 \tabularnewline
56 & 3635.9 & 3309.77 & 2648.2489 & 3971.2912 & 0.167 & 0.0017 & 0.3825 & 0.0732 \tabularnewline
57 & 4505.1 & 4140.7078 & 3470.4581 & 4810.9574 & 0.1433 & 0.9301 & 0.3999 & 0.8405 \tabularnewline
58 & 4891.9 & 4223.9516 & 3546.9899 & 4900.9134 & 0.0266 & 0.2078 & 0.4164 & 0.8902 \tabularnewline
59 & 4894.2 & 4282.9962 & 3601.3103 & 4964.6821 & 0.0394 & 0.04 & 0.4217 & 0.9175 \tabularnewline
60 & 4093.2 & 3741.1361 & 3055.4112 & 4426.8611 & 0.1571 & 5e-04 & 0.4332 & 0.4332 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34107&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]4306.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4259.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3986[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4755.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3925.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4206.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4323.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3816.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3410.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4227.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4296.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4351.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4277[/C][C]4097.3023[/C][C]3628.7693[/C][C]4565.8354[/C][C]0.2261[/C][C]0.8932[/C][C]0.2487[/C][C]0.8932[/C][/ROW]
[ROW][C]50[/C][C]4100.2[/C][C]3832.0664[/C][C]3312.8795[/C][C]4351.2534[/C][C]0.1557[/C][C]0.0465[/C][C]0.2806[/C][C]0.5482[/C][/ROW]
[ROW][C]51[/C][C]4672.5[/C][C]4510.7426[/C][C]3966.2988[/C][C]5055.1865[/C][C]0.2802[/C][C]0.9303[/C][C]0.189[/C][C]0.9947[/C][/ROW]
[ROW][C]52[/C][C]4189.9[/C][C]3803.2757[/C][C]3203.6084[/C][C]4402.943[/C][C]0.1032[/C][C]0.0022[/C][C]0.3446[/C][C]0.5043[/C][/ROW]
[ROW][C]53[/C][C]4231.9[/C][C]4064.7207[/C][C]3447.0113[/C][C]4682.4302[/C][C]0.2979[/C][C]0.3456[/C][C]0.3264[/C][C]0.7995[/C][/ROW]
[ROW][C]54[/C][C]4654.9[/C][C]4187.1211[/C][C]3551.7063[/C][C]4822.5358[/C][C]0.0745[/C][C]0.4451[/C][C]0.3371[/C][C]0.8838[/C][/ROW]
[ROW][C]55[/C][C]4298.5[/C][C]3718.2801[/C][C]3065.9934[/C][C]4370.5668[/C][C]0.0406[/C][C]0.0024[/C][C]0.3844[/C][C]0.403[/C][/ROW]
[ROW][C]56[/C][C]3635.9[/C][C]3309.77[/C][C]2648.2489[/C][C]3971.2912[/C][C]0.167[/C][C]0.0017[/C][C]0.3825[/C][C]0.0732[/C][/ROW]
[ROW][C]57[/C][C]4505.1[/C][C]4140.7078[/C][C]3470.4581[/C][C]4810.9574[/C][C]0.1433[/C][C]0.9301[/C][C]0.3999[/C][C]0.8405[/C][/ROW]
[ROW][C]58[/C][C]4891.9[/C][C]4223.9516[/C][C]3546.9899[/C][C]4900.9134[/C][C]0.0266[/C][C]0.2078[/C][C]0.4164[/C][C]0.8902[/C][/ROW]
[ROW][C]59[/C][C]4894.2[/C][C]4282.9962[/C][C]3601.3103[/C][C]4964.6821[/C][C]0.0394[/C][C]0.04[/C][C]0.4217[/C][C]0.9175[/C][/ROW]
[ROW][C]60[/C][C]4093.2[/C][C]3741.1361[/C][C]3055.4112[/C][C]4426.8611[/C][C]0.1571[/C][C]5e-04[/C][C]0.4332[/C][C]0.4332[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34107&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34107&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])
364306.9-------
374259.5-------
383986-------
394755.6-------
403925.6-------
414206.5-------
424323.4-------
433816.1-------
443410.7-------
454227.4-------
464296.9-------
474351.7-------
483800-------
4942774097.30233628.76934565.83540.22610.89320.24870.8932
504100.23832.06643312.87954351.25340.15570.04650.28060.5482
514672.54510.74263966.29885055.18650.28020.93030.1890.9947
524189.93803.27573203.60844402.9430.10320.00220.34460.5043
534231.94064.72073447.01134682.43020.29790.34560.32640.7995
544654.94187.12113551.70634822.53580.07450.44510.33710.8838
554298.53718.28013065.99344370.56680.04060.00240.38440.403
563635.93309.772648.24893971.29120.1670.00170.38250.0732
574505.14140.70783470.45814810.95740.14330.93010.39990.8405
584891.94223.95163546.98994900.91340.02660.20780.41640.8902
594894.24282.99623601.31034964.68210.03940.040.42170.9175
604093.23741.13613055.41124426.86110.15715e-040.43320.4332







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.05830.04390.003732291.24772690.937351.8742
500.06910.070.005871895.60695991.300677.4035
510.06160.03590.00326165.44372180.453646.6953
520.08040.10170.0085149478.356712456.5297111.6088
530.07750.04110.003427948.91112329.075948.2605
540.07740.11170.0093218817.113318234.7594135.0361
550.08950.1560.013336655.102828054.5919167.4951
560.1020.09850.0082106360.76178863.396894.1456
570.08260.0880.0073132781.694211065.1412105.191
580.08180.15810.0132446155.018137179.5848192.8201
590.08120.14270.0119373570.080331130.84176.4393
600.09350.09410.0078123948.954810329.0796101.6321

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0583 & 0.0439 & 0.0037 & 32291.2477 & 2690.9373 & 51.8742 \tabularnewline
50 & 0.0691 & 0.07 & 0.0058 & 71895.6069 & 5991.3006 & 77.4035 \tabularnewline
51 & 0.0616 & 0.0359 & 0.003 & 26165.4437 & 2180.4536 & 46.6953 \tabularnewline
52 & 0.0804 & 0.1017 & 0.0085 & 149478.3567 & 12456.5297 & 111.6088 \tabularnewline
53 & 0.0775 & 0.0411 & 0.0034 & 27948.9111 & 2329.0759 & 48.2605 \tabularnewline
54 & 0.0774 & 0.1117 & 0.0093 & 218817.1133 & 18234.7594 & 135.0361 \tabularnewline
55 & 0.0895 & 0.156 & 0.013 & 336655.1028 & 28054.5919 & 167.4951 \tabularnewline
56 & 0.102 & 0.0985 & 0.0082 & 106360.7617 & 8863.3968 & 94.1456 \tabularnewline
57 & 0.0826 & 0.088 & 0.0073 & 132781.6942 & 11065.1412 & 105.191 \tabularnewline
58 & 0.0818 & 0.1581 & 0.0132 & 446155.0181 & 37179.5848 & 192.8201 \tabularnewline
59 & 0.0812 & 0.1427 & 0.0119 & 373570.0803 & 31130.84 & 176.4393 \tabularnewline
60 & 0.0935 & 0.0941 & 0.0078 & 123948.9548 & 10329.0796 & 101.6321 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34107&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.0583[/C][C]0.0439[/C][C]0.0037[/C][C]32291.2477[/C][C]2690.9373[/C][C]51.8742[/C][/ROW]
[ROW][C]50[/C][C]0.0691[/C][C]0.07[/C][C]0.0058[/C][C]71895.6069[/C][C]5991.3006[/C][C]77.4035[/C][/ROW]
[ROW][C]51[/C][C]0.0616[/C][C]0.0359[/C][C]0.003[/C][C]26165.4437[/C][C]2180.4536[/C][C]46.6953[/C][/ROW]
[ROW][C]52[/C][C]0.0804[/C][C]0.1017[/C][C]0.0085[/C][C]149478.3567[/C][C]12456.5297[/C][C]111.6088[/C][/ROW]
[ROW][C]53[/C][C]0.0775[/C][C]0.0411[/C][C]0.0034[/C][C]27948.9111[/C][C]2329.0759[/C][C]48.2605[/C][/ROW]
[ROW][C]54[/C][C]0.0774[/C][C]0.1117[/C][C]0.0093[/C][C]218817.1133[/C][C]18234.7594[/C][C]135.0361[/C][/ROW]
[ROW][C]55[/C][C]0.0895[/C][C]0.156[/C][C]0.013[/C][C]336655.1028[/C][C]28054.5919[/C][C]167.4951[/C][/ROW]
[ROW][C]56[/C][C]0.102[/C][C]0.0985[/C][C]0.0082[/C][C]106360.7617[/C][C]8863.3968[/C][C]94.1456[/C][/ROW]
[ROW][C]57[/C][C]0.0826[/C][C]0.088[/C][C]0.0073[/C][C]132781.6942[/C][C]11065.1412[/C][C]105.191[/C][/ROW]
[ROW][C]58[/C][C]0.0818[/C][C]0.1581[/C][C]0.0132[/C][C]446155.0181[/C][C]37179.5848[/C][C]192.8201[/C][/ROW]
[ROW][C]59[/C][C]0.0812[/C][C]0.1427[/C][C]0.0119[/C][C]373570.0803[/C][C]31130.84[/C][C]176.4393[/C][/ROW]
[ROW][C]60[/C][C]0.0935[/C][C]0.0941[/C][C]0.0078[/C][C]123948.9548[/C][C]10329.0796[/C][C]101.6321[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34107&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34107&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.05830.04390.003732291.24772690.937351.8742
500.06910.070.005871895.60695991.300677.4035
510.06160.03590.00326165.44372180.453646.6953
520.08040.10170.0085149478.356712456.5297111.6088
530.07750.04110.003427948.91112329.075948.2605
540.07740.11170.0093218817.113318234.7594135.0361
550.08950.1560.013336655.102828054.5919167.4951
560.1020.09850.0082106360.76178863.396894.1456
570.08260.0880.0073132781.694211065.1412105.191
580.08180.15810.0132446155.018137179.5848192.8201
590.08120.14270.0119373570.080331130.84176.4393
600.09350.09410.0078123948.954810329.0796101.6321



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