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 computationSat, 12 Dec 2009 07:17:13 -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/12/t1260627510wrrd5dmgx5er8nt.htm/, Retrieved Mon, 29 Apr 2024 08:11:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66977, Retrieved Mon, 29 Apr 2024 08:11:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact156
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2009-11-05 08:15:26] [74be16979710d4c4e7c6647856088456]
-   PD  [Univariate Data Series] [] [2009-11-11 08:16:12] [74be16979710d4c4e7c6647856088456]
- RMP     [ARIMA Forecasting] [] [2009-12-06 18:23:17] [5d885a68c2332cc44f6191ec94766bfa]
- R PD        [ARIMA Forecasting] [ARIMA Forecasting] [2009-12-12 14:17:13] [d1818fb1d9a1b0f34f8553ada228d3d5] [Current]
Feedback Forum

Post a new message




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66977&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'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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417436.071397.881474.26110.16380.944610.9446
134391431.2878370.6051491.97040.09660.67780.9980.8021
135419474.3614397.509551.21380.0790.98320.95940.9615
136461476.1103385.9428566.27790.37130.89280.95920.9389
137472485.6406383.8855587.39570.39640.68250.8970.9398
138535496.2093384.0576608.3610.24890.66390.66390.9445
139622537.613415.9499659.27610.0870.51680.43360.9837
140606538.2034407.7204668.68630.15420.10410.37740.9773
141508508.4732369.7299647.21650.49730.08410.73970.9281
142461474.4424327.9036620.98120.42870.32680.81650.8235
143390452.6599298.7199606.59990.21250.45770.87580.728
144432480.1491319.1478641.15040.27890.86380.81990.8199

\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[132]) \tabularnewline
120 & 337 & - & - & - & - & - & - & - \tabularnewline
121 & 360 & - & - & - & - & - & - & - \tabularnewline
122 & 342 & - & - & - & - & - & - & - \tabularnewline
123 & 406 & - & - & - & - & - & - & - \tabularnewline
124 & 396 & - & - & - & - & - & - & - \tabularnewline
125 & 420 & - & - & - & - & - & - & - \tabularnewline
126 & 472 & - & - & - & - & - & - & - \tabularnewline
127 & 548 & - & - & - & - & - & - & - \tabularnewline
128 & 559 & - & - & - & - & - & - & - \tabularnewline
129 & 463 & - & - & - & - & - & - & - \tabularnewline
130 & 407 & - & - & - & - & - & - & - \tabularnewline
131 & 362 & - & - & - & - & - & - & - \tabularnewline
132 & 405 & - & - & - & - & - & - & - \tabularnewline
133 & 417 & 436.071 & 397.881 & 474.2611 & 0.1638 & 0.9446 & 1 & 0.9446 \tabularnewline
134 & 391 & 431.2878 & 370.6051 & 491.9704 & 0.0966 & 0.6778 & 0.998 & 0.8021 \tabularnewline
135 & 419 & 474.3614 & 397.509 & 551.2138 & 0.079 & 0.9832 & 0.9594 & 0.9615 \tabularnewline
136 & 461 & 476.1103 & 385.9428 & 566.2779 & 0.3713 & 0.8928 & 0.9592 & 0.9389 \tabularnewline
137 & 472 & 485.6406 & 383.8855 & 587.3957 & 0.3964 & 0.6825 & 0.897 & 0.9398 \tabularnewline
138 & 535 & 496.2093 & 384.0576 & 608.361 & 0.2489 & 0.6639 & 0.6639 & 0.9445 \tabularnewline
139 & 622 & 537.613 & 415.9499 & 659.2761 & 0.087 & 0.5168 & 0.4336 & 0.9837 \tabularnewline
140 & 606 & 538.2034 & 407.7204 & 668.6863 & 0.1542 & 0.1041 & 0.3774 & 0.9773 \tabularnewline
141 & 508 & 508.4732 & 369.7299 & 647.2165 & 0.4973 & 0.0841 & 0.7397 & 0.9281 \tabularnewline
142 & 461 & 474.4424 & 327.9036 & 620.9812 & 0.4287 & 0.3268 & 0.8165 & 0.8235 \tabularnewline
143 & 390 & 452.6599 & 298.7199 & 606.5999 & 0.2125 & 0.4577 & 0.8758 & 0.728 \tabularnewline
144 & 432 & 480.1491 & 319.1478 & 641.1504 & 0.2789 & 0.8638 & 0.8199 & 0.8199 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66977&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[132])[/C][/ROW]
[ROW][C]120[/C][C]337[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]342[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]396[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]420[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]472[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]548[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]559[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]463[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]407[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]362[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]417[/C][C]436.071[/C][C]397.881[/C][C]474.2611[/C][C]0.1638[/C][C]0.9446[/C][C]1[/C][C]0.9446[/C][/ROW]
[ROW][C]134[/C][C]391[/C][C]431.2878[/C][C]370.6051[/C][C]491.9704[/C][C]0.0966[/C][C]0.6778[/C][C]0.998[/C][C]0.8021[/C][/ROW]
[ROW][C]135[/C][C]419[/C][C]474.3614[/C][C]397.509[/C][C]551.2138[/C][C]0.079[/C][C]0.9832[/C][C]0.9594[/C][C]0.9615[/C][/ROW]
[ROW][C]136[/C][C]461[/C][C]476.1103[/C][C]385.9428[/C][C]566.2779[/C][C]0.3713[/C][C]0.8928[/C][C]0.9592[/C][C]0.9389[/C][/ROW]
[ROW][C]137[/C][C]472[/C][C]485.6406[/C][C]383.8855[/C][C]587.3957[/C][C]0.3964[/C][C]0.6825[/C][C]0.897[/C][C]0.9398[/C][/ROW]
[ROW][C]138[/C][C]535[/C][C]496.2093[/C][C]384.0576[/C][C]608.361[/C][C]0.2489[/C][C]0.6639[/C][C]0.6639[/C][C]0.9445[/C][/ROW]
[ROW][C]139[/C][C]622[/C][C]537.613[/C][C]415.9499[/C][C]659.2761[/C][C]0.087[/C][C]0.5168[/C][C]0.4336[/C][C]0.9837[/C][/ROW]
[ROW][C]140[/C][C]606[/C][C]538.2034[/C][C]407.7204[/C][C]668.6863[/C][C]0.1542[/C][C]0.1041[/C][C]0.3774[/C][C]0.9773[/C][/ROW]
[ROW][C]141[/C][C]508[/C][C]508.4732[/C][C]369.7299[/C][C]647.2165[/C][C]0.4973[/C][C]0.0841[/C][C]0.7397[/C][C]0.9281[/C][/ROW]
[ROW][C]142[/C][C]461[/C][C]474.4424[/C][C]327.9036[/C][C]620.9812[/C][C]0.4287[/C][C]0.3268[/C][C]0.8165[/C][C]0.8235[/C][/ROW]
[ROW][C]143[/C][C]390[/C][C]452.6599[/C][C]298.7199[/C][C]606.5999[/C][C]0.2125[/C][C]0.4577[/C][C]0.8758[/C][C]0.728[/C][/ROW]
[ROW][C]144[/C][C]432[/C][C]480.1491[/C][C]319.1478[/C][C]641.1504[/C][C]0.2789[/C][C]0.8638[/C][C]0.8199[/C][C]0.8199[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66977&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66977&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[132])
120337-------
121360-------
122342-------
123406-------
124396-------
125420-------
126472-------
127548-------
128559-------
129463-------
130407-------
131362-------
132405-------
133417436.071397.881474.26110.16380.944610.9446
134391431.2878370.6051491.97040.09660.67780.9980.8021
135419474.3614397.509551.21380.0790.98320.95940.9615
136461476.1103385.9428566.27790.37130.89280.95920.9389
137472485.6406383.8855587.39570.39640.68250.8970.9398
138535496.2093384.0576608.3610.24890.66390.66390.9445
139622537.613415.9499659.27610.0870.51680.43360.9837
140606538.2034407.7204668.68630.15420.10410.37740.9773
141508508.4732369.7299647.21650.49730.08410.73970.9281
142461474.4424327.9036620.98120.42870.32680.81650.8235
143390452.6599298.7199606.59990.21250.45770.87580.728
144432480.1491319.1478641.15040.27890.86380.81990.8199







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1330.0447-0.04370363.704100
1340.0718-0.09340.06861623.1038993.403931.5183
1350.0827-0.11670.08463064.88311683.89741.0353
1360.0966-0.03170.0714228.32251320.003436.3319
1370.1069-0.02810.0627186.06641093.21633.0638
1380.11530.07820.06531504.72061161.800134.0852
1390.11550.1570.07847121.17042013.138744.868
1400.12370.1260.08434596.38492336.044548.3326
1410.1392-9e-040.07510.22392076.508945.5687
1420.1576-0.02830.0704180.69861886.927843.4388
1430.1735-0.13840.07663926.26432072.322145.5228
1440.1711-0.10030.07862318.33682092.823345.7474

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
133 & 0.0447 & -0.0437 & 0 & 363.7041 & 0 & 0 \tabularnewline
134 & 0.0718 & -0.0934 & 0.0686 & 1623.1038 & 993.4039 & 31.5183 \tabularnewline
135 & 0.0827 & -0.1167 & 0.0846 & 3064.8831 & 1683.897 & 41.0353 \tabularnewline
136 & 0.0966 & -0.0317 & 0.0714 & 228.3225 & 1320.0034 & 36.3319 \tabularnewline
137 & 0.1069 & -0.0281 & 0.0627 & 186.0664 & 1093.216 & 33.0638 \tabularnewline
138 & 0.1153 & 0.0782 & 0.0653 & 1504.7206 & 1161.8001 & 34.0852 \tabularnewline
139 & 0.1155 & 0.157 & 0.0784 & 7121.1704 & 2013.1387 & 44.868 \tabularnewline
140 & 0.1237 & 0.126 & 0.0843 & 4596.3849 & 2336.0445 & 48.3326 \tabularnewline
141 & 0.1392 & -9e-04 & 0.0751 & 0.2239 & 2076.5089 & 45.5687 \tabularnewline
142 & 0.1576 & -0.0283 & 0.0704 & 180.6986 & 1886.9278 & 43.4388 \tabularnewline
143 & 0.1735 & -0.1384 & 0.0766 & 3926.2643 & 2072.3221 & 45.5228 \tabularnewline
144 & 0.1711 & -0.1003 & 0.0786 & 2318.3368 & 2092.8233 & 45.7474 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66977&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]133[/C][C]0.0447[/C][C]-0.0437[/C][C]0[/C][C]363.7041[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]134[/C][C]0.0718[/C][C]-0.0934[/C][C]0.0686[/C][C]1623.1038[/C][C]993.4039[/C][C]31.5183[/C][/ROW]
[ROW][C]135[/C][C]0.0827[/C][C]-0.1167[/C][C]0.0846[/C][C]3064.8831[/C][C]1683.897[/C][C]41.0353[/C][/ROW]
[ROW][C]136[/C][C]0.0966[/C][C]-0.0317[/C][C]0.0714[/C][C]228.3225[/C][C]1320.0034[/C][C]36.3319[/C][/ROW]
[ROW][C]137[/C][C]0.1069[/C][C]-0.0281[/C][C]0.0627[/C][C]186.0664[/C][C]1093.216[/C][C]33.0638[/C][/ROW]
[ROW][C]138[/C][C]0.1153[/C][C]0.0782[/C][C]0.0653[/C][C]1504.7206[/C][C]1161.8001[/C][C]34.0852[/C][/ROW]
[ROW][C]139[/C][C]0.1155[/C][C]0.157[/C][C]0.0784[/C][C]7121.1704[/C][C]2013.1387[/C][C]44.868[/C][/ROW]
[ROW][C]140[/C][C]0.1237[/C][C]0.126[/C][C]0.0843[/C][C]4596.3849[/C][C]2336.0445[/C][C]48.3326[/C][/ROW]
[ROW][C]141[/C][C]0.1392[/C][C]-9e-04[/C][C]0.0751[/C][C]0.2239[/C][C]2076.5089[/C][C]45.5687[/C][/ROW]
[ROW][C]142[/C][C]0.1576[/C][C]-0.0283[/C][C]0.0704[/C][C]180.6986[/C][C]1886.9278[/C][C]43.4388[/C][/ROW]
[ROW][C]143[/C][C]0.1735[/C][C]-0.1384[/C][C]0.0766[/C][C]3926.2643[/C][C]2072.3221[/C][C]45.5228[/C][/ROW]
[ROW][C]144[/C][C]0.1711[/C][C]-0.1003[/C][C]0.0786[/C][C]2318.3368[/C][C]2092.8233[/C][C]45.7474[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66977&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66977&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
1330.0447-0.04370363.704100
1340.0718-0.09340.06861623.1038993.403931.5183
1350.0827-0.11670.08463064.88311683.89741.0353
1360.0966-0.03170.0714228.32251320.003436.3319
1370.1069-0.02810.0627186.06641093.21633.0638
1380.11530.07820.06531504.72061161.800134.0852
1390.11550.1570.07847121.17042013.138744.868
1400.12370.1260.08434596.38492336.044548.3326
1410.1392-9e-040.07510.22392076.508945.5687
1420.1576-0.02830.0704180.69861886.927843.4388
1430.1735-0.13840.07663926.26432072.322145.5228
1440.1711-0.10030.07862318.33682092.823345.7474



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