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, 14 Dec 2009 01:41:55 -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/14/t12607803480uqacm6apx9olia.htm/, Retrieved Fri, 03 May 2024 12:22:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67440, Retrieved Fri, 03 May 2024 12:22:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact177
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Q1 The Seatbeltlaw] [2007-11-14 19:27:43] [8cd6641b921d30ebe00b648d1481bba0]
- RM D  [Multiple Regression] [Seatbelt] [2009-11-12 14:06:21] [b98453cac15ba1066b407e146608df68]
- R PD    [Multiple Regression] [] [2009-11-19 08:06:13] [639dd97b6eeebe46a3c92d62cb04fb95]
- RMPD        [ARIMA Forecasting] [] [2009-12-14 08:41:55] [2795ec65528c1a16d9df20713e7edc71] [Current]
-   PD          [ARIMA Forecasting] [] [2009-12-19 10:06:44] [ea26ab7ea3bba830cfeb08d06278d52c]
- R PD            [ARIMA Forecasting] [Arima forecast 6 ...] [2009-12-21 17:12:24] [9dbb467a28ad600d808a4e47d5e0774e]
-   P               [ARIMA Forecasting] [Arima forecast 12...] [2009-12-21 17:19:37] [9dbb467a28ad600d808a4e47d5e0774e]
-                     [ARIMA Forecasting] [paper] [2010-12-28 17:28:42] [654616a560d52fe6eb611aa3bbf6b3c7]
-   P               [ARIMA Forecasting] [Arima forecast 24...] [2009-12-21 17:25:53] [9dbb467a28ad600d808a4e47d5e0774e]
-                     [ARIMA Forecasting] [paper] [2010-12-28 17:32:12] [654616a560d52fe6eb611aa3bbf6b3c7]
-                   [ARIMA Forecasting] [paper] [2010-12-28 17:26:19] [654616a560d52fe6eb611aa3bbf6b3c7]
-   PD          [ARIMA Forecasting] [] [2009-12-19 10:31:03] [ea26ab7ea3bba830cfeb08d06278d52c]
-   PD          [ARIMA Forecasting] [] [2009-12-19 10:32:11] [ea26ab7ea3bba830cfeb08d06278d52c]
Feedback Forum

Post a new message
Dataseries X:
595	
591	
589	
584	
573	
567	
569	
621	
629	
628	
612	
595	
597	
593	
590	
580	
574	
573	
573	
620	
626	
620	
588	
566	
557	
561	
549	
532	
526	
511	
499	
555	
565	
542	
527	
510	
514	
517	
508	
493	
490	
469	
478	
528	
534	
518	
506	
502	
516	
528	
533	
536	
537	
524	
536	
587	
597	
581	
564	
558	




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=67440&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=67440&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67440&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[50])
38517-------
39508-------
40493-------
41490-------
42469-------
43478-------
44528-------
45534-------
46518-------
47506-------
48502-------
49516-------
50528-------
51533523.6752507.0722540.27820.13550.30480.96790.3048
52536512.5055489.1823535.82870.02420.04250.94940.0964
53537512.4241482.3597542.48850.05460.06210.92810.1549
54524493.1462455.271531.02140.05520.01160.89430.0356
55536503.5318459.048548.01560.07630.18360.86970.1405
56587554.5084503.6734605.34350.10510.76230.84660.8466
57597561.1401504.2024618.07790.10850.18670.82490.873
58581545.629483.0758608.18210.13390.05370.80670.7097
59564533.9641466.076601.85220.19290.08720.79030.5684
60558530.1931457.2531603.1330.22750.18180.77570.5235

\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[50]) \tabularnewline
38 & 517 & - & - & - & - & - & - & - \tabularnewline
39 & 508 & - & - & - & - & - & - & - \tabularnewline
40 & 493 & - & - & - & - & - & - & - \tabularnewline
41 & 490 & - & - & - & - & - & - & - \tabularnewline
42 & 469 & - & - & - & - & - & - & - \tabularnewline
43 & 478 & - & - & - & - & - & - & - \tabularnewline
44 & 528 & - & - & - & - & - & - & - \tabularnewline
45 & 534 & - & - & - & - & - & - & - \tabularnewline
46 & 518 & - & - & - & - & - & - & - \tabularnewline
47 & 506 & - & - & - & - & - & - & - \tabularnewline
48 & 502 & - & - & - & - & - & - & - \tabularnewline
49 & 516 & - & - & - & - & - & - & - \tabularnewline
50 & 528 & - & - & - & - & - & - & - \tabularnewline
51 & 533 & 523.6752 & 507.0722 & 540.2782 & 0.1355 & 0.3048 & 0.9679 & 0.3048 \tabularnewline
52 & 536 & 512.5055 & 489.1823 & 535.8287 & 0.0242 & 0.0425 & 0.9494 & 0.0964 \tabularnewline
53 & 537 & 512.4241 & 482.3597 & 542.4885 & 0.0546 & 0.0621 & 0.9281 & 0.1549 \tabularnewline
54 & 524 & 493.1462 & 455.271 & 531.0214 & 0.0552 & 0.0116 & 0.8943 & 0.0356 \tabularnewline
55 & 536 & 503.5318 & 459.048 & 548.0156 & 0.0763 & 0.1836 & 0.8697 & 0.1405 \tabularnewline
56 & 587 & 554.5084 & 503.6734 & 605.3435 & 0.1051 & 0.7623 & 0.8466 & 0.8466 \tabularnewline
57 & 597 & 561.1401 & 504.2024 & 618.0779 & 0.1085 & 0.1867 & 0.8249 & 0.873 \tabularnewline
58 & 581 & 545.629 & 483.0758 & 608.1821 & 0.1339 & 0.0537 & 0.8067 & 0.7097 \tabularnewline
59 & 564 & 533.9641 & 466.076 & 601.8522 & 0.1929 & 0.0872 & 0.7903 & 0.5684 \tabularnewline
60 & 558 & 530.1931 & 457.2531 & 603.133 & 0.2275 & 0.1818 & 0.7757 & 0.5235 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67440&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[50])[/C][/ROW]
[ROW][C]38[/C][C]517[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]508[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]493[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]490[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]469[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]534[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]533[/C][C]523.6752[/C][C]507.0722[/C][C]540.2782[/C][C]0.1355[/C][C]0.3048[/C][C]0.9679[/C][C]0.3048[/C][/ROW]
[ROW][C]52[/C][C]536[/C][C]512.5055[/C][C]489.1823[/C][C]535.8287[/C][C]0.0242[/C][C]0.0425[/C][C]0.9494[/C][C]0.0964[/C][/ROW]
[ROW][C]53[/C][C]537[/C][C]512.4241[/C][C]482.3597[/C][C]542.4885[/C][C]0.0546[/C][C]0.0621[/C][C]0.9281[/C][C]0.1549[/C][/ROW]
[ROW][C]54[/C][C]524[/C][C]493.1462[/C][C]455.271[/C][C]531.0214[/C][C]0.0552[/C][C]0.0116[/C][C]0.8943[/C][C]0.0356[/C][/ROW]
[ROW][C]55[/C][C]536[/C][C]503.5318[/C][C]459.048[/C][C]548.0156[/C][C]0.0763[/C][C]0.1836[/C][C]0.8697[/C][C]0.1405[/C][/ROW]
[ROW][C]56[/C][C]587[/C][C]554.5084[/C][C]503.6734[/C][C]605.3435[/C][C]0.1051[/C][C]0.7623[/C][C]0.8466[/C][C]0.8466[/C][/ROW]
[ROW][C]57[/C][C]597[/C][C]561.1401[/C][C]504.2024[/C][C]618.0779[/C][C]0.1085[/C][C]0.1867[/C][C]0.8249[/C][C]0.873[/C][/ROW]
[ROW][C]58[/C][C]581[/C][C]545.629[/C][C]483.0758[/C][C]608.1821[/C][C]0.1339[/C][C]0.0537[/C][C]0.8067[/C][C]0.7097[/C][/ROW]
[ROW][C]59[/C][C]564[/C][C]533.9641[/C][C]466.076[/C][C]601.8522[/C][C]0.1929[/C][C]0.0872[/C][C]0.7903[/C][C]0.5684[/C][/ROW]
[ROW][C]60[/C][C]558[/C][C]530.1931[/C][C]457.2531[/C][C]603.133[/C][C]0.2275[/C][C]0.1818[/C][C]0.7757[/C][C]0.5235[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67440&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67440&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[50])
38517-------
39508-------
40493-------
41490-------
42469-------
43478-------
44528-------
45534-------
46518-------
47506-------
48502-------
49516-------
50528-------
51533523.6752507.0722540.27820.13550.30480.96790.3048
52536512.5055489.1823535.82870.02420.04250.94940.0964
53537512.4241482.3597542.48850.05460.06210.92810.1549
54524493.1462455.271531.02140.05520.01160.89430.0356
55536503.5318459.048548.01560.07630.18360.86970.1405
56587554.5084503.6734605.34350.10510.76230.84660.8466
57597561.1401504.2024618.07790.10850.18670.82490.873
58581545.629483.0758608.18210.13390.05370.80670.7097
59564533.9641466.076601.85220.19290.08720.79030.5684
60558530.1931457.2531603.1330.22750.18180.77570.5235







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
510.01620.0178086.951500
520.02320.04580.0318551.9906319.47117.8738
530.02990.0480.0372603.9759414.30620.3545
540.03920.06260.0435951.9586548.719223.4248
550.04510.06450.04771054.1833649.81225.4914
560.04680.05860.04951055.7019717.460326.7854
570.05180.06390.05161285.929798.670128.2608
580.05850.06480.05321251.111855.225229.2442
590.06490.05630.0536902.1577860.439929.3333
600.07020.05240.0535773.2257851.718529.1842

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
51 & 0.0162 & 0.0178 & 0 & 86.9515 & 0 & 0 \tabularnewline
52 & 0.0232 & 0.0458 & 0.0318 & 551.9906 & 319.471 & 17.8738 \tabularnewline
53 & 0.0299 & 0.048 & 0.0372 & 603.9759 & 414.306 & 20.3545 \tabularnewline
54 & 0.0392 & 0.0626 & 0.0435 & 951.9586 & 548.7192 & 23.4248 \tabularnewline
55 & 0.0451 & 0.0645 & 0.0477 & 1054.1833 & 649.812 & 25.4914 \tabularnewline
56 & 0.0468 & 0.0586 & 0.0495 & 1055.7019 & 717.4603 & 26.7854 \tabularnewline
57 & 0.0518 & 0.0639 & 0.0516 & 1285.929 & 798.6701 & 28.2608 \tabularnewline
58 & 0.0585 & 0.0648 & 0.0532 & 1251.111 & 855.2252 & 29.2442 \tabularnewline
59 & 0.0649 & 0.0563 & 0.0536 & 902.1577 & 860.4399 & 29.3333 \tabularnewline
60 & 0.0702 & 0.0524 & 0.0535 & 773.2257 & 851.7185 & 29.1842 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67440&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]51[/C][C]0.0162[/C][C]0.0178[/C][C]0[/C][C]86.9515[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]0.0232[/C][C]0.0458[/C][C]0.0318[/C][C]551.9906[/C][C]319.471[/C][C]17.8738[/C][/ROW]
[ROW][C]53[/C][C]0.0299[/C][C]0.048[/C][C]0.0372[/C][C]603.9759[/C][C]414.306[/C][C]20.3545[/C][/ROW]
[ROW][C]54[/C][C]0.0392[/C][C]0.0626[/C][C]0.0435[/C][C]951.9586[/C][C]548.7192[/C][C]23.4248[/C][/ROW]
[ROW][C]55[/C][C]0.0451[/C][C]0.0645[/C][C]0.0477[/C][C]1054.1833[/C][C]649.812[/C][C]25.4914[/C][/ROW]
[ROW][C]56[/C][C]0.0468[/C][C]0.0586[/C][C]0.0495[/C][C]1055.7019[/C][C]717.4603[/C][C]26.7854[/C][/ROW]
[ROW][C]57[/C][C]0.0518[/C][C]0.0639[/C][C]0.0516[/C][C]1285.929[/C][C]798.6701[/C][C]28.2608[/C][/ROW]
[ROW][C]58[/C][C]0.0585[/C][C]0.0648[/C][C]0.0532[/C][C]1251.111[/C][C]855.2252[/C][C]29.2442[/C][/ROW]
[ROW][C]59[/C][C]0.0649[/C][C]0.0563[/C][C]0.0536[/C][C]902.1577[/C][C]860.4399[/C][C]29.3333[/C][/ROW]
[ROW][C]60[/C][C]0.0702[/C][C]0.0524[/C][C]0.0535[/C][C]773.2257[/C][C]851.7185[/C][C]29.1842[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67440&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67440&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
510.01620.0178086.951500
520.02320.04580.0318551.9906319.47117.8738
530.02990.0480.0372603.9759414.30620.3545
540.03920.06260.0435951.9586548.719223.4248
550.04510.06450.04771054.1833649.81225.4914
560.04680.05860.04951055.7019717.460326.7854
570.05180.06390.05161285.929798.670128.2608
580.05850.06480.05321251.111855.225229.2442
590.06490.05630.0536902.1577860.439929.3333
600.07020.05240.0535773.2257851.718529.1842



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