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 computationWed, 04 Dec 2013 12:22:25 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Dec/04/t1386177759xcp0z2ay0wawnix.htm/, Retrieved Thu, 28 Mar 2024 16:34:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=230697, Retrieved Thu, 28 Mar 2024 16:34:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact108
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [HS9 T6] [2012-12-01 11:17:30] [8eb8d17c2ec8c4c2abfbcde955accee7]
- R       [ARIMA Forecasting] [Arima] [2013-12-04 17:22:25] [46d3d8bfbaf7691f7408e38ca0da8f78] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230697&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230697&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230697&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 time4 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







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[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979656.22089027.240910285.20080.08480.30490.44450.3049
6591159033.08598365.5669700.60590.4059e-040.48140.0104
661041110184.34439512.113810856.57480.25440.99910.49340.856
6796789703.999031.166910376.81310.46980.01970.49770.3677
68104089764.28579091.387810437.18360.03040.59920.49920.4355
69101539892.74619219.838810565.65350.22420.06670.49970.5839
70103689993.90989321.001210666.81830.13790.32150.49990.6938
711058110432.96799760.059211105.87660.33320.5750.50.9629
721059710072.98869400.079910745.89730.06350.06950.50.7694
731068010111.9969439.087210784.90470.0490.07890.50.8025
7497389265.99868593.08989938.90730.084600.50.0533
7595569819.99959147.090810492.90820.2210.59440.50.5

\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[63]) \tabularnewline
51 & 9946 & - & - & - & - & - & - & - \tabularnewline
52 & 9701 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9706 & - & - & - & - & - & - & - \tabularnewline
56 & 9765 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9994 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266 & - & - & - & - & - & - & - \tabularnewline
63 & 9820 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9656.2208 & 9027.2409 & 10285.2008 & 0.0848 & 0.3049 & 0.4445 & 0.3049 \tabularnewline
65 & 9115 & 9033.0859 & 8365.566 & 9700.6059 & 0.405 & 9e-04 & 0.4814 & 0.0104 \tabularnewline
66 & 10411 & 10184.3443 & 9512.1138 & 10856.5748 & 0.2544 & 0.9991 & 0.4934 & 0.856 \tabularnewline
67 & 9678 & 9703.99 & 9031.1669 & 10376.8131 & 0.4698 & 0.0197 & 0.4977 & 0.3677 \tabularnewline
68 & 10408 & 9764.2857 & 9091.3878 & 10437.1836 & 0.0304 & 0.5992 & 0.4992 & 0.4355 \tabularnewline
69 & 10153 & 9892.7461 & 9219.8388 & 10565.6535 & 0.2242 & 0.0667 & 0.4997 & 0.5839 \tabularnewline
70 & 10368 & 9993.9098 & 9321.0012 & 10666.8183 & 0.1379 & 0.3215 & 0.4999 & 0.6938 \tabularnewline
71 & 10581 & 10432.9679 & 9760.0592 & 11105.8766 & 0.3332 & 0.575 & 0.5 & 0.9629 \tabularnewline
72 & 10597 & 10072.9886 & 9400.0799 & 10745.8973 & 0.0635 & 0.0695 & 0.5 & 0.7694 \tabularnewline
73 & 10680 & 10111.996 & 9439.0872 & 10784.9047 & 0.049 & 0.0789 & 0.5 & 0.8025 \tabularnewline
74 & 9738 & 9265.9986 & 8593.0898 & 9938.9073 & 0.0846 & 0 & 0.5 & 0.0533 \tabularnewline
75 & 9556 & 9819.9995 & 9147.0908 & 10492.9082 & 0.221 & 0.5944 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230697&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[63])[/C][/ROW]
[ROW][C]51[/C][C]9946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9765[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9656.2208[/C][C]9027.2409[/C][C]10285.2008[/C][C]0.0848[/C][C]0.3049[/C][C]0.4445[/C][C]0.3049[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9033.0859[/C][C]8365.566[/C][C]9700.6059[/C][C]0.405[/C][C]9e-04[/C][C]0.4814[/C][C]0.0104[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10184.3443[/C][C]9512.1138[/C][C]10856.5748[/C][C]0.2544[/C][C]0.9991[/C][C]0.4934[/C][C]0.856[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9703.99[/C][C]9031.1669[/C][C]10376.8131[/C][C]0.4698[/C][C]0.0197[/C][C]0.4977[/C][C]0.3677[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9764.2857[/C][C]9091.3878[/C][C]10437.1836[/C][C]0.0304[/C][C]0.5992[/C][C]0.4992[/C][C]0.4355[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9892.7461[/C][C]9219.8388[/C][C]10565.6535[/C][C]0.2242[/C][C]0.0667[/C][C]0.4997[/C][C]0.5839[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]9993.9098[/C][C]9321.0012[/C][C]10666.8183[/C][C]0.1379[/C][C]0.3215[/C][C]0.4999[/C][C]0.6938[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10432.9679[/C][C]9760.0592[/C][C]11105.8766[/C][C]0.3332[/C][C]0.575[/C][C]0.5[/C][C]0.9629[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10072.9886[/C][C]9400.0799[/C][C]10745.8973[/C][C]0.0635[/C][C]0.0695[/C][C]0.5[/C][C]0.7694[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10111.996[/C][C]9439.0872[/C][C]10784.9047[/C][C]0.049[/C][C]0.0789[/C][C]0.5[/C][C]0.8025[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9265.9986[/C][C]8593.0898[/C][C]9938.9073[/C][C]0.0846[/C][C]0[/C][C]0.5[/C][C]0.0533[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9819.9995[/C][C]9147.0908[/C][C]10492.9082[/C][C]0.221[/C][C]0.5944[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230697&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230697&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[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979656.22089027.240910285.20080.08480.30490.44450.3049
6591159033.08598365.5669700.60590.4059e-040.48140.0104
661041110184.34439512.113810856.57480.25440.99910.49340.856
6796789703.999031.166910376.81310.46980.01970.49770.3677
68104089764.28579091.387810437.18360.03040.59920.49920.4355
69101539892.74619219.838810565.65350.22420.06670.49970.5839
70103689993.90989321.001210666.81830.13790.32150.49990.6938
711058110432.96799760.059211105.87660.33320.5750.50.9629
721059710072.98869400.079910745.89730.06350.06950.50.7694
731068010111.9969439.087210784.90470.0490.07890.50.8025
7497389265.99868593.08989938.90730.084600.50.0533
7595569819.99959147.090810492.90820.2210.59440.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.03320.04560194286.263400
650.03770.00910.02746709.9147100498.0891317.0143
660.03370.02230.025751372.807784122.9953290.0396
670.0354-0.00270.0199675.481163261.1167251.5176
680.03520.06590.0291414368.1352133482.5204365.3526
690.03470.02630.028667732.0742122524.1127350.0344
700.03440.03740.0299139943.4935125012.5957353.5712
710.03290.01420.027921913.4919112125.2077334.851
720.03410.0520.0306274587.9422130176.6227360.8
730.0340.05620.0332322628.6005149421.8204386.5512
740.03710.05090.0348222785.3586156091.233395.0838
750.035-0.02690.034169695.7299148891.6077385.8648

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0332 & 0.0456 & 0 & 194286.2634 & 0 & 0 \tabularnewline
65 & 0.0377 & 0.0091 & 0.0274 & 6709.9147 & 100498.0891 & 317.0143 \tabularnewline
66 & 0.0337 & 0.0223 & 0.0257 & 51372.8077 & 84122.9953 & 290.0396 \tabularnewline
67 & 0.0354 & -0.0027 & 0.0199 & 675.4811 & 63261.1167 & 251.5176 \tabularnewline
68 & 0.0352 & 0.0659 & 0.0291 & 414368.1352 & 133482.5204 & 365.3526 \tabularnewline
69 & 0.0347 & 0.0263 & 0.0286 & 67732.0742 & 122524.1127 & 350.0344 \tabularnewline
70 & 0.0344 & 0.0374 & 0.0299 & 139943.4935 & 125012.5957 & 353.5712 \tabularnewline
71 & 0.0329 & 0.0142 & 0.0279 & 21913.4919 & 112125.2077 & 334.851 \tabularnewline
72 & 0.0341 & 0.052 & 0.0306 & 274587.9422 & 130176.6227 & 360.8 \tabularnewline
73 & 0.034 & 0.0562 & 0.0332 & 322628.6005 & 149421.8204 & 386.5512 \tabularnewline
74 & 0.0371 & 0.0509 & 0.0348 & 222785.3586 & 156091.233 & 395.0838 \tabularnewline
75 & 0.035 & -0.0269 & 0.0341 & 69695.7299 & 148891.6077 & 385.8648 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230697&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]64[/C][C]0.0332[/C][C]0.0456[/C][C]0[/C][C]194286.2634[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]65[/C][C]0.0377[/C][C]0.0091[/C][C]0.0274[/C][C]6709.9147[/C][C]100498.0891[/C][C]317.0143[/C][/ROW]
[ROW][C]66[/C][C]0.0337[/C][C]0.0223[/C][C]0.0257[/C][C]51372.8077[/C][C]84122.9953[/C][C]290.0396[/C][/ROW]
[ROW][C]67[/C][C]0.0354[/C][C]-0.0027[/C][C]0.0199[/C][C]675.4811[/C][C]63261.1167[/C][C]251.5176[/C][/ROW]
[ROW][C]68[/C][C]0.0352[/C][C]0.0659[/C][C]0.0291[/C][C]414368.1352[/C][C]133482.5204[/C][C]365.3526[/C][/ROW]
[ROW][C]69[/C][C]0.0347[/C][C]0.0263[/C][C]0.0286[/C][C]67732.0742[/C][C]122524.1127[/C][C]350.0344[/C][/ROW]
[ROW][C]70[/C][C]0.0344[/C][C]0.0374[/C][C]0.0299[/C][C]139943.4935[/C][C]125012.5957[/C][C]353.5712[/C][/ROW]
[ROW][C]71[/C][C]0.0329[/C][C]0.0142[/C][C]0.0279[/C][C]21913.4919[/C][C]112125.2077[/C][C]334.851[/C][/ROW]
[ROW][C]72[/C][C]0.0341[/C][C]0.052[/C][C]0.0306[/C][C]274587.9422[/C][C]130176.6227[/C][C]360.8[/C][/ROW]
[ROW][C]73[/C][C]0.034[/C][C]0.0562[/C][C]0.0332[/C][C]322628.6005[/C][C]149421.8204[/C][C]386.5512[/C][/ROW]
[ROW][C]74[/C][C]0.0371[/C][C]0.0509[/C][C]0.0348[/C][C]222785.3586[/C][C]156091.233[/C][C]395.0838[/C][/ROW]
[ROW][C]75[/C][C]0.035[/C][C]-0.0269[/C][C]0.0341[/C][C]69695.7299[/C][C]148891.6077[/C][C]385.8648[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230697&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230697&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
640.03320.04560194286.263400
650.03770.00910.02746709.9147100498.0891317.0143
660.03370.02230.025751372.807784122.9953290.0396
670.0354-0.00270.0199675.481163261.1167251.5176
680.03520.06590.0291414368.1352133482.5204365.3526
690.03470.02630.028667732.0742122524.1127350.0344
700.03440.03740.0299139943.4935125012.5957353.5712
710.03290.01420.027921913.4919112125.2077334.851
720.03410.0520.0306274587.9422130176.6227360.8
730.0340.05620.0332322628.6005149421.8204386.5512
740.03710.05090.0348222785.3586156091.233395.0838
750.035-0.02690.034169695.7299148891.6077385.8648



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