Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 20 Dec 2012 15:11:23 -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/2012/Dec/20/t1356034303x1oui5dqjhxwnqm.htm/, Retrieved Thu, 18 Apr 2024 18:16:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=203090, Retrieved Thu, 18 Apr 2024 18:16:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact110
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2012-11-24 13:06:47] [391561951b5d7f721cfaa4f5575ab127]
- R  D  [ARIMA Backward Selection] [] [2012-11-24 13:21:16] [391561951b5d7f721cfaa4f5575ab127]
- RMP     [ARIMA Forecasting] [Forcast Faillisse...] [2012-11-24 14:13:34] [391561951b5d7f721cfaa4f5575ab127]
- R P         [ARIMA Forecasting] [] [2012-12-20 20:11:23] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
617
614
647
580
614
636
388
356
639
753
611
639
630
586
695
552
619
681
421
307
754
690
644
643
608
651
691
627
634
731
475
337
803
722
590
724
627
696
825
677
656
785
412
352
839
729
696
641
695
638
762
635
721
854
418
367
824
687
601
676
740
691
683
594
729
731
386
331
706
715
657
653
642
643
718
654
632
731
392
344
792
852
649
629
685
617
715
715
629
916
531
357
917
828
708
858
775
785
1006
789
734
906
532
387
991
841
892
782
811
792
978
773
796
946
594
438
1023
868
791
760
779
852
1001
734
996
869
599
426
1138
1091
830
909




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gertrude Mary Cox' @ cox.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 & 2 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203090&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203090&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203090&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 time2 seconds
R Server'Gertrude Mary Cox' @ cox.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[120])
108782-------
109811-------
110792-------
111978-------
112773-------
113796-------
114946-------
115594-------
116438-------
1171023-------
118868-------
119791-------
120760-------
121779831.2793711.406978.79410.24360.82820.60620.8282
122852816.1943697.0026963.30040.31670.68990.62640.773
1231001939.0292794.19741120.16010.25120.82680.33660.9736
124734799.2081679.2484948.23230.19550.0040.63480.697
125996823.814697.1813982.05110.01650.8670.63480.7854
126869967.9643810.24971168.03140.16610.39180.58520.9792
127599535.886460.3266628.39510.090600.10910
128426419.8802363.6831487.90960.4300.30080
12911381014.6468840.06011239.4960.141110.4710.9868
1301091943.6423782.26281151.11850.0820.03320.76260.9586
131830828.9174690.1961006.17970.49520.00190.66250.777
132909853.3821707.66181040.64460.28020.59670.83580.8358

\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[120]) \tabularnewline
108 & 782 & - & - & - & - & - & - & - \tabularnewline
109 & 811 & - & - & - & - & - & - & - \tabularnewline
110 & 792 & - & - & - & - & - & - & - \tabularnewline
111 & 978 & - & - & - & - & - & - & - \tabularnewline
112 & 773 & - & - & - & - & - & - & - \tabularnewline
113 & 796 & - & - & - & - & - & - & - \tabularnewline
114 & 946 & - & - & - & - & - & - & - \tabularnewline
115 & 594 & - & - & - & - & - & - & - \tabularnewline
116 & 438 & - & - & - & - & - & - & - \tabularnewline
117 & 1023 & - & - & - & - & - & - & - \tabularnewline
118 & 868 & - & - & - & - & - & - & - \tabularnewline
119 & 791 & - & - & - & - & - & - & - \tabularnewline
120 & 760 & - & - & - & - & - & - & - \tabularnewline
121 & 779 & 831.2793 & 711.406 & 978.7941 & 0.2436 & 0.8282 & 0.6062 & 0.8282 \tabularnewline
122 & 852 & 816.1943 & 697.0026 & 963.3004 & 0.3167 & 0.6899 & 0.6264 & 0.773 \tabularnewline
123 & 1001 & 939.0292 & 794.1974 & 1120.1601 & 0.2512 & 0.8268 & 0.3366 & 0.9736 \tabularnewline
124 & 734 & 799.2081 & 679.2484 & 948.2323 & 0.1955 & 0.004 & 0.6348 & 0.697 \tabularnewline
125 & 996 & 823.814 & 697.1813 & 982.0511 & 0.0165 & 0.867 & 0.6348 & 0.7854 \tabularnewline
126 & 869 & 967.9643 & 810.2497 & 1168.0314 & 0.1661 & 0.3918 & 0.5852 & 0.9792 \tabularnewline
127 & 599 & 535.886 & 460.3266 & 628.3951 & 0.0906 & 0 & 0.1091 & 0 \tabularnewline
128 & 426 & 419.8802 & 363.6831 & 487.9096 & 0.43 & 0 & 0.3008 & 0 \tabularnewline
129 & 1138 & 1014.6468 & 840.0601 & 1239.496 & 0.1411 & 1 & 0.471 & 0.9868 \tabularnewline
130 & 1091 & 943.6423 & 782.2628 & 1151.1185 & 0.082 & 0.0332 & 0.7626 & 0.9586 \tabularnewline
131 & 830 & 828.9174 & 690.196 & 1006.1797 & 0.4952 & 0.0019 & 0.6625 & 0.777 \tabularnewline
132 & 909 & 853.3821 & 707.6618 & 1040.6446 & 0.2802 & 0.5967 & 0.8358 & 0.8358 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203090&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[120])[/C][/ROW]
[ROW][C]108[/C][C]782[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]811[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]792[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]978[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]773[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]796[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]1023[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]868[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]791[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]760[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]779[/C][C]831.2793[/C][C]711.406[/C][C]978.7941[/C][C]0.2436[/C][C]0.8282[/C][C]0.6062[/C][C]0.8282[/C][/ROW]
[ROW][C]122[/C][C]852[/C][C]816.1943[/C][C]697.0026[/C][C]963.3004[/C][C]0.3167[/C][C]0.6899[/C][C]0.6264[/C][C]0.773[/C][/ROW]
[ROW][C]123[/C][C]1001[/C][C]939.0292[/C][C]794.1974[/C][C]1120.1601[/C][C]0.2512[/C][C]0.8268[/C][C]0.3366[/C][C]0.9736[/C][/ROW]
[ROW][C]124[/C][C]734[/C][C]799.2081[/C][C]679.2484[/C][C]948.2323[/C][C]0.1955[/C][C]0.004[/C][C]0.6348[/C][C]0.697[/C][/ROW]
[ROW][C]125[/C][C]996[/C][C]823.814[/C][C]697.1813[/C][C]982.0511[/C][C]0.0165[/C][C]0.867[/C][C]0.6348[/C][C]0.7854[/C][/ROW]
[ROW][C]126[/C][C]869[/C][C]967.9643[/C][C]810.2497[/C][C]1168.0314[/C][C]0.1661[/C][C]0.3918[/C][C]0.5852[/C][C]0.9792[/C][/ROW]
[ROW][C]127[/C][C]599[/C][C]535.886[/C][C]460.3266[/C][C]628.3951[/C][C]0.0906[/C][C]0[/C][C]0.1091[/C][C]0[/C][/ROW]
[ROW][C]128[/C][C]426[/C][C]419.8802[/C][C]363.6831[/C][C]487.9096[/C][C]0.43[/C][C]0[/C][C]0.3008[/C][C]0[/C][/ROW]
[ROW][C]129[/C][C]1138[/C][C]1014.6468[/C][C]840.0601[/C][C]1239.496[/C][C]0.1411[/C][C]1[/C][C]0.471[/C][C]0.9868[/C][/ROW]
[ROW][C]130[/C][C]1091[/C][C]943.6423[/C][C]782.2628[/C][C]1151.1185[/C][C]0.082[/C][C]0.0332[/C][C]0.7626[/C][C]0.9586[/C][/ROW]
[ROW][C]131[/C][C]830[/C][C]828.9174[/C][C]690.196[/C][C]1006.1797[/C][C]0.4952[/C][C]0.0019[/C][C]0.6625[/C][C]0.777[/C][/ROW]
[ROW][C]132[/C][C]909[/C][C]853.3821[/C][C]707.6618[/C][C]1040.6446[/C][C]0.2802[/C][C]0.5967[/C][C]0.8358[/C][C]0.8358[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203090&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203090&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[120])
108782-------
109811-------
110792-------
111978-------
112773-------
113796-------
114946-------
115594-------
116438-------
1171023-------
118868-------
119791-------
120760-------
121779831.2793711.406978.79410.24360.82820.60620.8282
122852816.1943697.0026963.30040.31670.68990.62640.773
1231001939.0292794.19741120.16010.25120.82680.33660.9736
124734799.2081679.2484948.23230.19550.0040.63480.697
125996823.814697.1813982.05110.01650.8670.63480.7854
126869967.9643810.24971168.03140.16610.39180.58520.9792
127599535.886460.3266628.39510.090600.10910
128426419.8802363.6831487.90960.4300.30080
12911381014.6468840.06011239.4960.141110.4710.9868
1301091943.6423782.26281151.11850.0820.03320.76260.9586
131830828.9174690.1961006.17970.49520.00190.66250.777
132909853.3821707.66181040.64460.28020.59670.83580.8358







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1210.0905-0.062902733.125100
1220.0920.04390.05341282.04792007.586544.8061
1230.09840.0660.05763840.38452618.519251.1715
1240.0951-0.08160.06364252.09123026.912255.0174
1250.0980.2090.092729648.00588351.130991.3845
1260.1055-0.10220.09439793.94188591.599492.6909
1270.08810.11780.09763983.37487933.281689.069
1280.08270.01460.087237.45166946.302883.3445
1290.11310.12160.091115216.0077865.158888.6857
1300.11220.15620.097621714.29629250.072696.1773
1310.10910.00130.08881.1728409.263491.702
1320.1120.06520.08683093.34547966.270389.254

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
121 & 0.0905 & -0.0629 & 0 & 2733.1251 & 0 & 0 \tabularnewline
122 & 0.092 & 0.0439 & 0.0534 & 1282.0479 & 2007.5865 & 44.8061 \tabularnewline
123 & 0.0984 & 0.066 & 0.0576 & 3840.3845 & 2618.5192 & 51.1715 \tabularnewline
124 & 0.0951 & -0.0816 & 0.0636 & 4252.0912 & 3026.9122 & 55.0174 \tabularnewline
125 & 0.098 & 0.209 & 0.0927 & 29648.0058 & 8351.1309 & 91.3845 \tabularnewline
126 & 0.1055 & -0.1022 & 0.0943 & 9793.9418 & 8591.5994 & 92.6909 \tabularnewline
127 & 0.0881 & 0.1178 & 0.0976 & 3983.3748 & 7933.2816 & 89.069 \tabularnewline
128 & 0.0827 & 0.0146 & 0.0872 & 37.4516 & 6946.3028 & 83.3445 \tabularnewline
129 & 0.1131 & 0.1216 & 0.0911 & 15216.007 & 7865.1588 & 88.6857 \tabularnewline
130 & 0.1122 & 0.1562 & 0.0976 & 21714.2962 & 9250.0726 & 96.1773 \tabularnewline
131 & 0.1091 & 0.0013 & 0.0888 & 1.172 & 8409.2634 & 91.702 \tabularnewline
132 & 0.112 & 0.0652 & 0.0868 & 3093.3454 & 7966.2703 & 89.254 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=203090&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]121[/C][C]0.0905[/C][C]-0.0629[/C][C]0[/C][C]2733.1251[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]0.092[/C][C]0.0439[/C][C]0.0534[/C][C]1282.0479[/C][C]2007.5865[/C][C]44.8061[/C][/ROW]
[ROW][C]123[/C][C]0.0984[/C][C]0.066[/C][C]0.0576[/C][C]3840.3845[/C][C]2618.5192[/C][C]51.1715[/C][/ROW]
[ROW][C]124[/C][C]0.0951[/C][C]-0.0816[/C][C]0.0636[/C][C]4252.0912[/C][C]3026.9122[/C][C]55.0174[/C][/ROW]
[ROW][C]125[/C][C]0.098[/C][C]0.209[/C][C]0.0927[/C][C]29648.0058[/C][C]8351.1309[/C][C]91.3845[/C][/ROW]
[ROW][C]126[/C][C]0.1055[/C][C]-0.1022[/C][C]0.0943[/C][C]9793.9418[/C][C]8591.5994[/C][C]92.6909[/C][/ROW]
[ROW][C]127[/C][C]0.0881[/C][C]0.1178[/C][C]0.0976[/C][C]3983.3748[/C][C]7933.2816[/C][C]89.069[/C][/ROW]
[ROW][C]128[/C][C]0.0827[/C][C]0.0146[/C][C]0.0872[/C][C]37.4516[/C][C]6946.3028[/C][C]83.3445[/C][/ROW]
[ROW][C]129[/C][C]0.1131[/C][C]0.1216[/C][C]0.0911[/C][C]15216.007[/C][C]7865.1588[/C][C]88.6857[/C][/ROW]
[ROW][C]130[/C][C]0.1122[/C][C]0.1562[/C][C]0.0976[/C][C]21714.2962[/C][C]9250.0726[/C][C]96.1773[/C][/ROW]
[ROW][C]131[/C][C]0.1091[/C][C]0.0013[/C][C]0.0888[/C][C]1.172[/C][C]8409.2634[/C][C]91.702[/C][/ROW]
[ROW][C]132[/C][C]0.112[/C][C]0.0652[/C][C]0.0868[/C][C]3093.3454[/C][C]7966.2703[/C][C]89.254[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=203090&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=203090&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
1210.0905-0.062902733.125100
1220.0920.04390.05341282.04792007.586544.8061
1230.09840.0660.05763840.38452618.519251.1715
1240.0951-0.08160.06364252.09123026.912255.0174
1250.0980.2090.092729648.00588351.130991.3845
1260.1055-0.10220.09439793.94188591.599492.6909
1270.08810.11780.09763983.37487933.281689.069
1280.08270.01460.087237.45166946.302883.3445
1290.11310.12160.091115216.0077865.158888.6857
1300.11220.15620.097621714.29629250.072696.1773
1310.10910.00130.08881.1728409.263491.702
1320.1120.06520.08683093.34547966.270389.254



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