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 computationMon, 22 Dec 2008 12:20:32 -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/22/t12299736520tsw7r42mjx3soh.htm/, Retrieved Mon, 13 May 2024 11:50:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36178, Retrieved Mon, 13 May 2024 11:50:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact202
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [(P)ACF werkloosheid] [2008-12-21 22:54:14] [7a4703cb85a198d9845d72899eff0288]
-   P   [(Partial) Autocorrelation Function] [(P)ACF werkloosheid] [2008-12-21 23:29:15] [7a4703cb85a198d9845d72899eff0288]
-   P     [(Partial) Autocorrelation Function] [(P)ACF werklooshe...] [2008-12-22 12:23:56] [7a4703cb85a198d9845d72899eff0288]
- RMP       [Spectral Analysis] [Spectral analysis...] [2008-12-22 12:38:27] [7a4703cb85a198d9845d72899eff0288]
-   P         [Spectral Analysis] [Spectral Analysis...] [2008-12-22 13:08:13] [7a4703cb85a198d9845d72899eff0288]
-   P           [Spectral Analysis] [Spectral analysis...] [2008-12-22 13:40:53] [7a4703cb85a198d9845d72899eff0288]
- RMP               [ARIMA Forecasting] [] [2008-12-22 19:20:32] [d76b387543b13b5e3afd8ff9e5fdc89f] [Current]
Feedback Forum

Post a new message
Dataseries X:
467
460
448
443
436
431
484
510
513
503
471
471
476
475
470
461
455
456
517
525
523
519
509
512
519
517
510
509
501
507
569
580
578
565
547
555




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36178&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'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[24])
12471-------
13476-------
14475-------
15470-------
16461-------
17455-------
18456-------
19517-------
20525-------
21523-------
22519-------
23509-------
24512-------
25519517497.579536.4210.420.693110.6931
26517516488.5346543.46540.47160.41520.99830.6124
27510511477.3618544.63820.47680.36330.99160.4768
28509502463.158540.8420.3620.34320.98070.3069
29501496452.5733539.42670.41070.27870.96790.2351
30507497449.4285544.57150.34020.43450.95440.2683
31569558506.6169609.38310.33740.97410.94110.9603
32580566511.0691620.93090.30870.45740.92830.973
33578564505.737622.2630.31880.29520.91610.9599
34565560498.5854621.41460.43660.28280.90460.9372
35547550485.5878614.41220.46360.3240.89390.8762
36555553485.7237620.27630.47680.56940.88390.8839

\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[24]) \tabularnewline
12 & 471 & - & - & - & - & - & - & - \tabularnewline
13 & 476 & - & - & - & - & - & - & - \tabularnewline
14 & 475 & - & - & - & - & - & - & - \tabularnewline
15 & 470 & - & - & - & - & - & - & - \tabularnewline
16 & 461 & - & - & - & - & - & - & - \tabularnewline
17 & 455 & - & - & - & - & - & - & - \tabularnewline
18 & 456 & - & - & - & - & - & - & - \tabularnewline
19 & 517 & - & - & - & - & - & - & - \tabularnewline
20 & 525 & - & - & - & - & - & - & - \tabularnewline
21 & 523 & - & - & - & - & - & - & - \tabularnewline
22 & 519 & - & - & - & - & - & - & - \tabularnewline
23 & 509 & - & - & - & - & - & - & - \tabularnewline
24 & 512 & - & - & - & - & - & - & - \tabularnewline
25 & 519 & 517 & 497.579 & 536.421 & 0.42 & 0.6931 & 1 & 0.6931 \tabularnewline
26 & 517 & 516 & 488.5346 & 543.4654 & 0.4716 & 0.4152 & 0.9983 & 0.6124 \tabularnewline
27 & 510 & 511 & 477.3618 & 544.6382 & 0.4768 & 0.3633 & 0.9916 & 0.4768 \tabularnewline
28 & 509 & 502 & 463.158 & 540.842 & 0.362 & 0.3432 & 0.9807 & 0.3069 \tabularnewline
29 & 501 & 496 & 452.5733 & 539.4267 & 0.4107 & 0.2787 & 0.9679 & 0.2351 \tabularnewline
30 & 507 & 497 & 449.4285 & 544.5715 & 0.3402 & 0.4345 & 0.9544 & 0.2683 \tabularnewline
31 & 569 & 558 & 506.6169 & 609.3831 & 0.3374 & 0.9741 & 0.9411 & 0.9603 \tabularnewline
32 & 580 & 566 & 511.0691 & 620.9309 & 0.3087 & 0.4574 & 0.9283 & 0.973 \tabularnewline
33 & 578 & 564 & 505.737 & 622.263 & 0.3188 & 0.2952 & 0.9161 & 0.9599 \tabularnewline
34 & 565 & 560 & 498.5854 & 621.4146 & 0.4366 & 0.2828 & 0.9046 & 0.9372 \tabularnewline
35 & 547 & 550 & 485.5878 & 614.4122 & 0.4636 & 0.324 & 0.8939 & 0.8762 \tabularnewline
36 & 555 & 553 & 485.7237 & 620.2763 & 0.4768 & 0.5694 & 0.8839 & 0.8839 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36178&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[24])[/C][/ROW]
[ROW][C]12[/C][C]471[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]13[/C][C]476[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]14[/C][C]475[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]15[/C][C]470[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]16[/C][C]461[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]17[/C][C]455[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]18[/C][C]456[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]19[/C][C]517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]20[/C][C]525[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]21[/C][C]523[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]519[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]509[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]512[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]519[/C][C]517[/C][C]497.579[/C][C]536.421[/C][C]0.42[/C][C]0.6931[/C][C]1[/C][C]0.6931[/C][/ROW]
[ROW][C]26[/C][C]517[/C][C]516[/C][C]488.5346[/C][C]543.4654[/C][C]0.4716[/C][C]0.4152[/C][C]0.9983[/C][C]0.6124[/C][/ROW]
[ROW][C]27[/C][C]510[/C][C]511[/C][C]477.3618[/C][C]544.6382[/C][C]0.4768[/C][C]0.3633[/C][C]0.9916[/C][C]0.4768[/C][/ROW]
[ROW][C]28[/C][C]509[/C][C]502[/C][C]463.158[/C][C]540.842[/C][C]0.362[/C][C]0.3432[/C][C]0.9807[/C][C]0.3069[/C][/ROW]
[ROW][C]29[/C][C]501[/C][C]496[/C][C]452.5733[/C][C]539.4267[/C][C]0.4107[/C][C]0.2787[/C][C]0.9679[/C][C]0.2351[/C][/ROW]
[ROW][C]30[/C][C]507[/C][C]497[/C][C]449.4285[/C][C]544.5715[/C][C]0.3402[/C][C]0.4345[/C][C]0.9544[/C][C]0.2683[/C][/ROW]
[ROW][C]31[/C][C]569[/C][C]558[/C][C]506.6169[/C][C]609.3831[/C][C]0.3374[/C][C]0.9741[/C][C]0.9411[/C][C]0.9603[/C][/ROW]
[ROW][C]32[/C][C]580[/C][C]566[/C][C]511.0691[/C][C]620.9309[/C][C]0.3087[/C][C]0.4574[/C][C]0.9283[/C][C]0.973[/C][/ROW]
[ROW][C]33[/C][C]578[/C][C]564[/C][C]505.737[/C][C]622.263[/C][C]0.3188[/C][C]0.2952[/C][C]0.9161[/C][C]0.9599[/C][/ROW]
[ROW][C]34[/C][C]565[/C][C]560[/C][C]498.5854[/C][C]621.4146[/C][C]0.4366[/C][C]0.2828[/C][C]0.9046[/C][C]0.9372[/C][/ROW]
[ROW][C]35[/C][C]547[/C][C]550[/C][C]485.5878[/C][C]614.4122[/C][C]0.4636[/C][C]0.324[/C][C]0.8939[/C][C]0.8762[/C][/ROW]
[ROW][C]36[/C][C]555[/C][C]553[/C][C]485.7237[/C][C]620.2763[/C][C]0.4768[/C][C]0.5694[/C][C]0.8839[/C][C]0.8839[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36178&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36178&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[24])
12471-------
13476-------
14475-------
15470-------
16461-------
17455-------
18456-------
19517-------
20525-------
21523-------
22519-------
23509-------
24512-------
25519517497.579536.4210.420.693110.6931
26517516488.5346543.46540.47160.41520.99830.6124
27510511477.3618544.63820.47680.36330.99160.4768
28509502463.158540.8420.3620.34320.98070.3069
29501496452.5733539.42670.41070.27870.96790.2351
30507497449.4285544.57150.34020.43450.95440.2683
31569558506.6169609.38310.33740.97410.94110.9603
32580566511.0691620.93090.30870.45740.92830.973
33578564505.737622.2630.31880.29520.91610.9599
34565560498.5854621.41460.43660.28280.90460.9372
35547550485.5878614.41220.46360.3240.89390.8762
36555553485.7237620.27630.47680.56940.88390.8839







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
250.01920.00393e-0440.33330.5774
260.02720.00192e-0410.08330.2887
270.0336-0.0022e-0410.08330.2887
280.03950.01390.0012494.08332.0207
290.04470.01018e-04252.08331.4434
300.04880.02010.00171008.33332.8868
310.0470.01970.001612110.08333.1754
320.04950.02470.002119616.33334.0415
330.05270.02480.002119616.33334.0415
340.0560.00897e-04252.08331.4434
350.0598-0.00555e-0490.750.866
360.06210.00363e-0440.33330.5774

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
25 & 0.0192 & 0.0039 & 3e-04 & 4 & 0.3333 & 0.5774 \tabularnewline
26 & 0.0272 & 0.0019 & 2e-04 & 1 & 0.0833 & 0.2887 \tabularnewline
27 & 0.0336 & -0.002 & 2e-04 & 1 & 0.0833 & 0.2887 \tabularnewline
28 & 0.0395 & 0.0139 & 0.0012 & 49 & 4.0833 & 2.0207 \tabularnewline
29 & 0.0447 & 0.0101 & 8e-04 & 25 & 2.0833 & 1.4434 \tabularnewline
30 & 0.0488 & 0.0201 & 0.0017 & 100 & 8.3333 & 2.8868 \tabularnewline
31 & 0.047 & 0.0197 & 0.0016 & 121 & 10.0833 & 3.1754 \tabularnewline
32 & 0.0495 & 0.0247 & 0.0021 & 196 & 16.3333 & 4.0415 \tabularnewline
33 & 0.0527 & 0.0248 & 0.0021 & 196 & 16.3333 & 4.0415 \tabularnewline
34 & 0.056 & 0.0089 & 7e-04 & 25 & 2.0833 & 1.4434 \tabularnewline
35 & 0.0598 & -0.0055 & 5e-04 & 9 & 0.75 & 0.866 \tabularnewline
36 & 0.0621 & 0.0036 & 3e-04 & 4 & 0.3333 & 0.5774 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36178&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]25[/C][C]0.0192[/C][C]0.0039[/C][C]3e-04[/C][C]4[/C][C]0.3333[/C][C]0.5774[/C][/ROW]
[ROW][C]26[/C][C]0.0272[/C][C]0.0019[/C][C]2e-04[/C][C]1[/C][C]0.0833[/C][C]0.2887[/C][/ROW]
[ROW][C]27[/C][C]0.0336[/C][C]-0.002[/C][C]2e-04[/C][C]1[/C][C]0.0833[/C][C]0.2887[/C][/ROW]
[ROW][C]28[/C][C]0.0395[/C][C]0.0139[/C][C]0.0012[/C][C]49[/C][C]4.0833[/C][C]2.0207[/C][/ROW]
[ROW][C]29[/C][C]0.0447[/C][C]0.0101[/C][C]8e-04[/C][C]25[/C][C]2.0833[/C][C]1.4434[/C][/ROW]
[ROW][C]30[/C][C]0.0488[/C][C]0.0201[/C][C]0.0017[/C][C]100[/C][C]8.3333[/C][C]2.8868[/C][/ROW]
[ROW][C]31[/C][C]0.047[/C][C]0.0197[/C][C]0.0016[/C][C]121[/C][C]10.0833[/C][C]3.1754[/C][/ROW]
[ROW][C]32[/C][C]0.0495[/C][C]0.0247[/C][C]0.0021[/C][C]196[/C][C]16.3333[/C][C]4.0415[/C][/ROW]
[ROW][C]33[/C][C]0.0527[/C][C]0.0248[/C][C]0.0021[/C][C]196[/C][C]16.3333[/C][C]4.0415[/C][/ROW]
[ROW][C]34[/C][C]0.056[/C][C]0.0089[/C][C]7e-04[/C][C]25[/C][C]2.0833[/C][C]1.4434[/C][/ROW]
[ROW][C]35[/C][C]0.0598[/C][C]-0.0055[/C][C]5e-04[/C][C]9[/C][C]0.75[/C][C]0.866[/C][/ROW]
[ROW][C]36[/C][C]0.0621[/C][C]0.0036[/C][C]3e-04[/C][C]4[/C][C]0.3333[/C][C]0.5774[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36178&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36178&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
250.01920.00393e-0440.33330.5774
260.02720.00192e-0410.08330.2887
270.0336-0.0022e-0410.08330.2887
280.03950.01390.0012494.08332.0207
290.04470.01018e-04252.08331.4434
300.04880.02010.00171008.33332.8868
310.0470.01970.001612110.08333.1754
320.04950.02470.002119616.33334.0415
330.05270.02480.002119616.33334.0415
340.0560.00897e-04252.08331.4434
350.0598-0.00555e-0490.750.866
360.06210.00363e-0440.33330.5774



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