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 computationThu, 10 Dec 2009 06:21:08 -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/10/t1260451353suokkrsxc03n1gh.htm/, Retrieved Tue, 16 Apr 2024 12:50:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65340, Retrieved Tue, 16 Apr 2024 12:50:58 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact142
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  D    [ARIMA Forecasting] [Forecasting] [2009-12-10 13:21:08] [b1ac221d009d6e5c29a4ef1869874933] [Current]
Feedback Forum

Post a new message
Dataseries X:
89.6
92.8
107.6
104.6
103
106.9
56.3
93.4
109.1
113.8
97.4
72.5
82.7
88.9
105.9
100.8
94
105
58.5
87.6
113.1
112.5
89.6
74.5
82.7
90.1
109.4
96
89.2
109.1
49.1
92.9
107.7
103.5
91.1
79.8
71.9
82.9
90.1
100.7
90.7
108.8
44.1
93.6
107.4
96.5
93.6
76.5
76.7
84
103.3
88.5
99
105.9
44.7
94
107.1
104.8
102.5
77.7
85.2
91.3
106.5
92.4
97.5
107
51.1
98.6
102.2
114.3
99.4
72.5
92.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65340&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 time8 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[61])
4976.7-------
5084-------
51103.3-------
5288.5-------
5399-------
54105.9-------
5544.7-------
5694-------
57107.1-------
58104.8-------
59102.5-------
6077.7-------
6185.2-------
6291.385.145373.495296.79540.15020.49630.57640.4963
63106.5106.355494.598118.11290.49040.9940.69470.9998
6492.490.767778.8118102.72360.39450.0050.6450.8193
6597.5101.285789.2917113.27970.26810.92680.64560.9957
66107107.98295.9277120.03620.43660.95580.63250.9999
6751.146.656634.558358.75480.235800.62440
6898.695.820683.682107.95930.326810.61560.9568
69102.2108.799496.6264120.97240.1440.94970.60780.9999
70114.3106.384794.1818118.58770.10180.74930.60050.9997
7199.4103.978291.7493116.20720.23150.0490.59360.9987
7272.579.078866.827291.33030.14636e-040.58730.1637
7392.386.48674.214998.75720.17650.98730.58140.5814

\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[61]) \tabularnewline
49 & 76.7 & - & - & - & - & - & - & - \tabularnewline
50 & 84 & - & - & - & - & - & - & - \tabularnewline
51 & 103.3 & - & - & - & - & - & - & - \tabularnewline
52 & 88.5 & - & - & - & - & - & - & - \tabularnewline
53 & 99 & - & - & - & - & - & - & - \tabularnewline
54 & 105.9 & - & - & - & - & - & - & - \tabularnewline
55 & 44.7 & - & - & - & - & - & - & - \tabularnewline
56 & 94 & - & - & - & - & - & - & - \tabularnewline
57 & 107.1 & - & - & - & - & - & - & - \tabularnewline
58 & 104.8 & - & - & - & - & - & - & - \tabularnewline
59 & 102.5 & - & - & - & - & - & - & - \tabularnewline
60 & 77.7 & - & - & - & - & - & - & - \tabularnewline
61 & 85.2 & - & - & - & - & - & - & - \tabularnewline
62 & 91.3 & 85.1453 & 73.4952 & 96.7954 & 0.1502 & 0.4963 & 0.5764 & 0.4963 \tabularnewline
63 & 106.5 & 106.3554 & 94.598 & 118.1129 & 0.4904 & 0.994 & 0.6947 & 0.9998 \tabularnewline
64 & 92.4 & 90.7677 & 78.8118 & 102.7236 & 0.3945 & 0.005 & 0.645 & 0.8193 \tabularnewline
65 & 97.5 & 101.2857 & 89.2917 & 113.2797 & 0.2681 & 0.9268 & 0.6456 & 0.9957 \tabularnewline
66 & 107 & 107.982 & 95.9277 & 120.0362 & 0.4366 & 0.9558 & 0.6325 & 0.9999 \tabularnewline
67 & 51.1 & 46.6566 & 34.5583 & 58.7548 & 0.2358 & 0 & 0.6244 & 0 \tabularnewline
68 & 98.6 & 95.8206 & 83.682 & 107.9593 & 0.3268 & 1 & 0.6156 & 0.9568 \tabularnewline
69 & 102.2 & 108.7994 & 96.6264 & 120.9724 & 0.144 & 0.9497 & 0.6078 & 0.9999 \tabularnewline
70 & 114.3 & 106.3847 & 94.1818 & 118.5877 & 0.1018 & 0.7493 & 0.6005 & 0.9997 \tabularnewline
71 & 99.4 & 103.9782 & 91.7493 & 116.2072 & 0.2315 & 0.049 & 0.5936 & 0.9987 \tabularnewline
72 & 72.5 & 79.0788 & 66.8272 & 91.3303 & 0.1463 & 6e-04 & 0.5873 & 0.1637 \tabularnewline
73 & 92.3 & 86.486 & 74.2149 & 98.7572 & 0.1765 & 0.9873 & 0.5814 & 0.5814 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65340&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[61])[/C][/ROW]
[ROW][C]49[/C][C]76.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]103.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]88.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]105.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]44.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]107.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]104.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]102.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]77.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]85.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]91.3[/C][C]85.1453[/C][C]73.4952[/C][C]96.7954[/C][C]0.1502[/C][C]0.4963[/C][C]0.5764[/C][C]0.4963[/C][/ROW]
[ROW][C]63[/C][C]106.5[/C][C]106.3554[/C][C]94.598[/C][C]118.1129[/C][C]0.4904[/C][C]0.994[/C][C]0.6947[/C][C]0.9998[/C][/ROW]
[ROW][C]64[/C][C]92.4[/C][C]90.7677[/C][C]78.8118[/C][C]102.7236[/C][C]0.3945[/C][C]0.005[/C][C]0.645[/C][C]0.8193[/C][/ROW]
[ROW][C]65[/C][C]97.5[/C][C]101.2857[/C][C]89.2917[/C][C]113.2797[/C][C]0.2681[/C][C]0.9268[/C][C]0.6456[/C][C]0.9957[/C][/ROW]
[ROW][C]66[/C][C]107[/C][C]107.982[/C][C]95.9277[/C][C]120.0362[/C][C]0.4366[/C][C]0.9558[/C][C]0.6325[/C][C]0.9999[/C][/ROW]
[ROW][C]67[/C][C]51.1[/C][C]46.6566[/C][C]34.5583[/C][C]58.7548[/C][C]0.2358[/C][C]0[/C][C]0.6244[/C][C]0[/C][/ROW]
[ROW][C]68[/C][C]98.6[/C][C]95.8206[/C][C]83.682[/C][C]107.9593[/C][C]0.3268[/C][C]1[/C][C]0.6156[/C][C]0.9568[/C][/ROW]
[ROW][C]69[/C][C]102.2[/C][C]108.7994[/C][C]96.6264[/C][C]120.9724[/C][C]0.144[/C][C]0.9497[/C][C]0.6078[/C][C]0.9999[/C][/ROW]
[ROW][C]70[/C][C]114.3[/C][C]106.3847[/C][C]94.1818[/C][C]118.5877[/C][C]0.1018[/C][C]0.7493[/C][C]0.6005[/C][C]0.9997[/C][/ROW]
[ROW][C]71[/C][C]99.4[/C][C]103.9782[/C][C]91.7493[/C][C]116.2072[/C][C]0.2315[/C][C]0.049[/C][C]0.5936[/C][C]0.9987[/C][/ROW]
[ROW][C]72[/C][C]72.5[/C][C]79.0788[/C][C]66.8272[/C][C]91.3303[/C][C]0.1463[/C][C]6e-04[/C][C]0.5873[/C][C]0.1637[/C][/ROW]
[ROW][C]73[/C][C]92.3[/C][C]86.486[/C][C]74.2149[/C][C]98.7572[/C][C]0.1765[/C][C]0.9873[/C][C]0.5814[/C][C]0.5814[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65340&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65340&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[61])
4976.7-------
5084-------
51103.3-------
5288.5-------
5399-------
54105.9-------
5544.7-------
5694-------
57107.1-------
58104.8-------
59102.5-------
6077.7-------
6185.2-------
6291.385.145373.495296.79540.15020.49630.57640.4963
63106.5106.355494.598118.11290.49040.9940.69470.9998
6492.490.767778.8118102.72360.39450.0050.6450.8193
6597.5101.285789.2917113.27970.26810.92680.64560.9957
66107107.98295.9277120.03620.43660.95580.63250.9999
6751.146.656634.558358.75480.235800.62440
6898.695.820683.682107.95930.326810.61560.9568
69102.2108.799496.6264120.97240.1440.94970.60780.9999
70114.3106.384794.1818118.58770.10180.74930.60050.9997
7199.4103.978291.7493116.20720.23150.0490.59360.9987
7272.579.078866.827291.33030.14636e-040.58730.1637
7392.386.48674.214998.75720.17650.98730.58140.5814







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
620.06980.0723037.880100
630.05640.00140.03680.020918.95054.3532
640.06720.0180.03052.664413.52183.6772
650.0604-0.03740.032314.331613.72433.7046
660.057-0.00910.02760.964311.17233.3425
670.13230.09520.038919.744212.60093.5498
680.06460.0290.03757.724811.90433.4503
690.0571-0.06070.040443.552415.86033.9825
700.05850.07440.044262.651521.05944.589
710.06-0.0440.044120.960221.04944.588
720.079-0.08320.047743.2823.07044.8032
730.07240.06720.049333.802523.96474.8954

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
62 & 0.0698 & 0.0723 & 0 & 37.8801 & 0 & 0 \tabularnewline
63 & 0.0564 & 0.0014 & 0.0368 & 0.0209 & 18.9505 & 4.3532 \tabularnewline
64 & 0.0672 & 0.018 & 0.0305 & 2.6644 & 13.5218 & 3.6772 \tabularnewline
65 & 0.0604 & -0.0374 & 0.0323 & 14.3316 & 13.7243 & 3.7046 \tabularnewline
66 & 0.057 & -0.0091 & 0.0276 & 0.9643 & 11.1723 & 3.3425 \tabularnewline
67 & 0.1323 & 0.0952 & 0.0389 & 19.7442 & 12.6009 & 3.5498 \tabularnewline
68 & 0.0646 & 0.029 & 0.0375 & 7.7248 & 11.9043 & 3.4503 \tabularnewline
69 & 0.0571 & -0.0607 & 0.0404 & 43.5524 & 15.8603 & 3.9825 \tabularnewline
70 & 0.0585 & 0.0744 & 0.0442 & 62.6515 & 21.0594 & 4.589 \tabularnewline
71 & 0.06 & -0.044 & 0.0441 & 20.9602 & 21.0494 & 4.588 \tabularnewline
72 & 0.079 & -0.0832 & 0.0477 & 43.28 & 23.0704 & 4.8032 \tabularnewline
73 & 0.0724 & 0.0672 & 0.0493 & 33.8025 & 23.9647 & 4.8954 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65340&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]62[/C][C]0.0698[/C][C]0.0723[/C][C]0[/C][C]37.8801[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]63[/C][C]0.0564[/C][C]0.0014[/C][C]0.0368[/C][C]0.0209[/C][C]18.9505[/C][C]4.3532[/C][/ROW]
[ROW][C]64[/C][C]0.0672[/C][C]0.018[/C][C]0.0305[/C][C]2.6644[/C][C]13.5218[/C][C]3.6772[/C][/ROW]
[ROW][C]65[/C][C]0.0604[/C][C]-0.0374[/C][C]0.0323[/C][C]14.3316[/C][C]13.7243[/C][C]3.7046[/C][/ROW]
[ROW][C]66[/C][C]0.057[/C][C]-0.0091[/C][C]0.0276[/C][C]0.9643[/C][C]11.1723[/C][C]3.3425[/C][/ROW]
[ROW][C]67[/C][C]0.1323[/C][C]0.0952[/C][C]0.0389[/C][C]19.7442[/C][C]12.6009[/C][C]3.5498[/C][/ROW]
[ROW][C]68[/C][C]0.0646[/C][C]0.029[/C][C]0.0375[/C][C]7.7248[/C][C]11.9043[/C][C]3.4503[/C][/ROW]
[ROW][C]69[/C][C]0.0571[/C][C]-0.0607[/C][C]0.0404[/C][C]43.5524[/C][C]15.8603[/C][C]3.9825[/C][/ROW]
[ROW][C]70[/C][C]0.0585[/C][C]0.0744[/C][C]0.0442[/C][C]62.6515[/C][C]21.0594[/C][C]4.589[/C][/ROW]
[ROW][C]71[/C][C]0.06[/C][C]-0.044[/C][C]0.0441[/C][C]20.9602[/C][C]21.0494[/C][C]4.588[/C][/ROW]
[ROW][C]72[/C][C]0.079[/C][C]-0.0832[/C][C]0.0477[/C][C]43.28[/C][C]23.0704[/C][C]4.8032[/C][/ROW]
[ROW][C]73[/C][C]0.0724[/C][C]0.0672[/C][C]0.0493[/C][C]33.8025[/C][C]23.9647[/C][C]4.8954[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65340&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65340&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
620.06980.0723037.880100
630.05640.00140.03680.020918.95054.3532
640.06720.0180.03052.664413.52183.6772
650.0604-0.03740.032314.331613.72433.7046
660.057-0.00910.02760.964311.17233.3425
670.13230.09520.038919.744212.60093.5498
680.06460.0290.03757.724811.90433.4503
690.0571-0.06070.040443.552415.86033.9825
700.05850.07440.044262.651521.05944.589
710.06-0.0440.044120.960221.04944.588
720.079-0.08320.047743.2823.07044.8032
730.07240.06720.049333.802523.96474.8954



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