::Free Statistics and Forecasting Software::

v1.1.22-r6
 
  Black&White | Blue Theme | Normal Fontsize | Increase Fontsize | Decrease Fontsize | Toggle underline | Secure website (SSL)
 
 
This software module is powered by R

:: ARIMA Forecasting - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This free online software (calculator) computes the extrapolation forecasts of a univariate ARIMA model for a time series Y[t] (for t = 1, 2, ..., T). The user may specify a cut-off period K which implies that the ARIMA model is estimated based on Y[t] for t = 1, 2, ..., T-K and such that the extrapolation forecast F[t] for t = T-K+1, ..., T is computed and compared with the actual values that were dropped: various extrapolation forecast statistics are computed (MPE, RMSE, MAPE, ...). In addition, the following probabilities are computed: P(F[t]>Y[t-1]), P(F[t]>Y[t-s]), and P(F[t]>Y[T-K]).

Click here to edit the underlying code of this R Module.

Enter (or paste) your data delimited by hard returns.

Send output to:
Data:
 
Sample Range:
(leave blank to include all observations)
From:
To:
Testing Period (?)
Box-Cox lambda transformation parameter (lambda) 
Degree of non-seasonal differencing (d) 
Degree of seasonal differencing (D) 
Seasonal period (s) 
AR(p) order 
MA(q) order 
SAR(P) order 
SMA(Q) order 
Include mean? 
Chart options
Width:
Height:

Click here to edit the underlying code of this R Module.






Cite this software as:
Wessa P., (2008), ARIMA Forecasting (v1.0.4) in Free Statistics Software (v1.1.22-r6), Office for Research Development and Education, URL http://www.wessa.net/rwasp_arimaforecasting.wasp/
The R code is based on :
Borghers, E, and P. Wessa, Statistics - Econometrics - Forecasting, Office for Research Development and Education, http://www.xycoon.com/

Source code of R module
1par1 <- as.numeric(par1) #cut off periods
2par2 <- as.numeric(par2) #lambda
3par3 <- as.numeric(par3) #degree of non-seasonal differencing
4par4 <- as.numeric(par4) #degree of seasonal differencing
5par5 <- as.numeric(par5) #seasonal period
6par6 <- as.numeric(par6) #p
7par7 <- as.numeric(par7) #q
8par8 <- as.numeric(par8) #P
9par9 <- as.numeric(par9) #Q
10if (par10 == "TRUE") par10 <- TRUE
11if (par10 == "FALSE") par10 <- FALSE
12if (par2 == 0) x <- log(x)
13if (par2 != 0) x <- x^par2
14lx <- length(x)
15first <- lx - 2*par1
16nx <- lx - par1
17nx1 <- nx + 1
18fx <- lx - nx
19if (fx < 1) {
20fx <- par5
21nx1 <- lx + fx - 1
22first <- lx - 2*fx
23}
24first <- 1
25if (fx < 3) fx <- round(lx/10,0)
26(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"))
27(forecast <- predict(arima.out,fx))
28(lb <- forecast$pred - 1.96 * forecast$se)
29(ub <- forecast$pred + 1.96 * forecast$se)
30if (par2 == 0) {
31x <- exp(x)
32forecast$pred <- exp(forecast$pred)
33lb <- exp(lb)
34ub <- exp(ub)
35}
36if (par2 != 0) {
37x <- x^(1/par2)
38forecast$pred <- forecast$pred^(1/par2)
39lb <- lb^(1/par2)
40ub <- ub^(1/par2)
41}
42if (par2 < 0) {
43olb <- lb
44lb <- ub
45ub <- olb
46}
47(actandfor <- c(x[1:nx], forecast$pred))
48(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
49bitmap(file="test1.png")
50opar <- par(mar=c(4,4,2,2),las=1)
51ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
52plot(x,ylim=ylim,type="n",xlim=c(first,lx))
53usr <- par("usr")
54rect(usr[1],usr[3],nx+1,usr[4],border=NA,col="lemonchiffon")
55rect(nx1,usr[3],usr[2],usr[4],border=NA,col="lavender")
56abline(h= (-3:3)*2 , col ="gray", lty =3)
57polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = "orange", lty=2,border=NA)
58lines(nx1:lx, lb , lty=2)
59lines(nx1:lx, ub , lty=2)
60lines(x, lwd=2)
61lines(nx1:lx, forecast$pred , lwd=2 , col ="white")
62box()
63par(opar)
64dev.off()
65prob.dec <- array(NA, dim=fx)
66prob.sdec <- array(NA, dim=fx)
67prob.ldec <- array(NA, dim=fx)
68prob.pval <- array(NA, dim=fx)
69perf.pe <- array(0, dim=fx)
70perf.mape <- array(0, dim=fx)
71perf.se <- array(0, dim=fx)
72perf.mse <- array(0, dim=fx)
73perf.rmse <- array(0, dim=fx)
74for (i in 1:fx) {
75locSD <- (ub[i] - forecast$pred[i]) / 1.96
76perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
77perf.mape[i] = perf.mape[i] + abs(perf.pe[i])
78perf.se[i] = (x[nx+i] - forecast$pred[i])^2
79perf.mse[i] = perf.mse[i] + perf.se[i]
80prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
81prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
82prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
83prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
84}
85perf.mape = perf.mape / fx
86perf.mse = perf.mse / fx
87perf.rmse = sqrt(perf.mse)
88bitmap(file="test2.png")
89plot(forecast$pred, pch=19, type="b",main="ARIMA Extrapolation Forecast", ylab="Forecast and 95% CI", xlab="time",ylim=c(min(lb),max(ub)))
90dum <- forecast$pred
91dum[1:12] <- x[(nx+1):lx]
92lines(dum, lty=1)
93lines(ub,lty=3)
94lines(lb,lty=3)
95dev.off()
96load(file="createtable")
97a<-table.start()
98a<-table.row.start(a)
99a<-table.element(a,"Univariate ARIMA Extrapolation Forecast",9,TRUE)
100a<-table.row.end(a)
101a<-table.row.start(a)
102a<-table.element(a,"time",1,header=TRUE)
103a<-table.element(a,"Y[t]",1,header=TRUE)
104a<-table.element(a,"F[t]",1,header=TRUE)
105a<-table.element(a,"95% LB",1,header=TRUE)
106a<-table.element(a,"95% UB",1,header=TRUE)
107a<-table.element(a,"p-value
(H0: Y[t] = F[t])",1,header=TRUE)
108a<-table.element(a,"P(F[t]>Y[t-1])",1,header=TRUE)
109a<-table.element(a,"P(F[t]>Y[t-s])",1,header=TRUE)
110mylab <- paste("P(F[t]>Y[",nx,sep="")
111mylab <- paste(mylab,"])",sep="")
112a<-table.element(a,mylab,1,header=TRUE)
113a<-table.row.end(a)
114for (i in (nx-par5):nx) {
115a<-table.row.start(a)
116a<-table.element(a,i,header=TRUE)
117a<-table.element(a,x[i])
118a<-table.element(a,"-")
119a<-table.element(a,"-")
120a<-table.element(a,"-")
121a<-table.element(a,"-")
122a<-table.element(a,"-")
123a<-table.element(a,"-")
124a<-table.element(a,"-")
125a<-table.row.end(a)
126}
127for (i in 1:fx) {
128a<-table.row.start(a)
129a<-table.element(a,nx+i,header=TRUE)
130a<-table.element(a,round(x[nx+i],4))
131a<-table.element(a,round(forecast$pred[i],4))
132a<-table.element(a,round(lb[i],4))
133a<-table.element(a,round(ub[i],4))
134a<-table.element(a,round((1-prob.pval[i]),4))
135a<-table.element(a,round((1-prob.dec[i]),4))
136a<-table.element(a,round((1-prob.sdec[i]),4))
137a<-table.element(a,round((1-prob.ldec[i]),4))
138a<-table.row.end(a)
139}
140a<-table.end(a)
141table.save(a,file="mytable.tab")
142a<-table.start()
143a<-table.row.start(a)
144a<-table.element(a,"Univariate ARIMA Extrapolation Forecast Performance",7,TRUE)
145a<-table.row.end(a)
146a<-table.row.start(a)
147a<-table.element(a,"time",1,header=TRUE)
148a<-table.element(a,"% S.E.",1,header=TRUE)
149a<-table.element(a,"PE",1,header=TRUE)
150a<-table.element(a,"MAPE",1,header=TRUE)
151a<-table.element(a,"Sq.E",1,header=TRUE)
152a<-table.element(a,"MSE",1,header=TRUE)
153a<-table.element(a,"RMSE",1,header=TRUE)
154a<-table.row.end(a)
155for (i in 1:fx) {
156a<-table.row.start(a)
157a<-table.element(a,nx+i,header=TRUE)
158a<-table.element(a,round(perc.se[i],4))
159a<-table.element(a,round(perf.pe[i],4))
160a<-table.element(a,round(perf.mape[i],4))
161a<-table.element(a,round(perf.se[i],4))
162a<-table.element(a,round(perf.mse[i],4))
163a<-table.element(a,round(perf.rmse[i],4))
164a<-table.row.end(a)
165}
166a<-table.end(a)
167table.save(a,file="mytable1.tab")
Delete history
Server DateModuleCommand
Sun, 18 May 2008 01:44:51 -0600Start of session-

Please, send us your feedback!
Overall rating
What do you think about the response time?
Rate the facility with which you interact with our software.
Is the output presented in an understandable (clear) form?
How did you find this website/module?
Do you have any comments about our site?
Do you have any suggestions for our site?
Please enter the code that is displayed in this picture: captcha

To cite Wessa.net in publications use:
Wessa, P. (2008), Free Statistics Software, Office for Research Development and Education,
version 1.1.22-r6, URL http://www.wessa.net/

© Resa R&D, and the 'Office for Research, Development, and Education' - All rights reserved. Academic license for non-commercial use only.
This website is an intellectual and physical property of Resa R&D. This includes: html content, graphical illustrations (gif files), computer software, online or electronic documentation, associated media, and printed materials. The free use of the scientific content, services, and applications in this website is granted for non commercial use only. In any case, the source (url) should always be clearly displayed. Under no circumstances are you allowed to reproduce, copy or redistribute the design, layout, or any content of this website (for commercial use) including any materials contained herein without the express written permission of Resa R&D or the Office for Research, Development, and Education.

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, Resa R&D makes no warranties or representations as to the accuracy or completeness of such information (or software), and it assumes no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall Resa R&D be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.

Software Version : 1.1.22-r6
Algorithms & Software : Prof. dr. P. Wessa
Facilities : Resa R&D - Office for Research, Development, and Education
Server : www.wessa.net

Comments, Feedback & Errors | Privacy Policy | Statistics Resources | Wessa.net Home

 © Wessa.Net 2002-2008  
 
 

Home Page
Equation Plotter
Time Series Analysis (new)
Time Series Analysis (old)
Multiple Regression (new)
Multiple Regression (old)
Descriptive Statistics
Statistical Distributions
Hypothesis Testing

Academic citations
Computations Archive
Search Computations
FAQ
About Wessa.net
Powered by Linux

Server status page
History list
Edit R Code
Google
Web wessa.net