# ::Free Statistics and Forecasting Software::

v1.2.1

### :: (Partial) Autocorrelation Function - 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 autocorrelation and partial autocorrelation function for any univariate time series.
The parameters lambda, d, D, and seasonality are used to apply a Box-Cox transformation and (non-)seasonal differencing in order to induce stationarity of the time series. If lambda = 1, d = 0, and D = 0 then no transformation/differencing is applied before the (P)ACF is computed.
The confidence interval can be computed in two different ways:
 assuming a white noise time series (CI type = White Noise) assuming that the series is a MA(k-1) process when the CI of ACF(k) is computed (CI type = MA)

When you use this software to check the residuals of a time series model, CI type = White Noise is appropriate. In all other cases, setting the CI type = MA may be less misleading. Note that the CI of the PACF always assumes white noise.

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

 Send output to: Browser Blue - Charts White Browser Black/White CSV Data[reset data] 112 118 132 129 121 135 148 148 136 119 104 118 115 126 141 135 125 149 170 170 158 133 114 140 145 150 178 163 172 178 199 199 184 162 146 166 171 180 193 181 183 218 230 242 209 191 172 194 196 196 236 235 229 243 264 272 237 211 180 201 204 188 235 227 234 264 302 293 259 229 203 229 242 233 267 269 270 315 364 347 312 274 237 278 284 277 317 313 318 374 413 405 355 306 271 306 315 301 356 348 355 422 465 467 404 347 305 336 340 318 362 348 363 435 491 505 404 359 310 337 360 342 406 396 420 472 548 559 463 407 362 405 417 391 419 461 472 535 622 606 508 461 390 432 Sample Range:(leave blank to include all observations) From: To: Number of time lags Default5678910111224364860 Box-Cox transformation parameter (Lambda) 1-2.0-1.9-1.8-1.7-1.6-1.5-1.4-1.3-1.2-1.1-1.0-0.9-0.8-0.7-0.6-0.5-0.4-0.3-0.2-0.10.00.10.20.30.40.50.60.70.80.91.01.11.21.31.41.51.61.71.81.92.0 Degree of non-seasonal differencing (d) 012 Degree of seasonal differencing (D) 012 Seasonality 121234612 CI type White NoiseMA Confidence Interval Use logarithms with this base (overrules the Box-Cox lambda parameter) (?) Chart options Width: Height:

 Source code of R module if (par1 == "Default") { par1 = 10*log10(length(x)) } else { par1 <- as.numeric(par1) } par2 <- as.numeric(par2) par3 <- as.numeric(par3) par4 <- as.numeric(par4) par5 <- as.numeric(par5) if (par6 == "White Noise") par6 <- "white" else par6 <- "ma" par7 <- as.numeric(par7) if (par8 != "") par8 <- as.numeric(par8) x <- na.omit(x) ox <- x if (par8 == "") { if (par2 == 0) { x <- log(x) } else { x <- (x ^ par2 - 1) / par2 } } else { x <- log(x,base=par8) } if (par3 > 0) x <- diff(x,lag=1,difference=par3) if (par4 > 0) x <- diff(x,lag=par5,difference=par4) bitmap(file="picts.png") op <- par(mfrow=c(2,1)) plot(ox,type="l",main="Original Time Series",xlab="time",ylab="value") if (par8=="") { mytitle <- paste("Working Time Series (lambda=",par2,", d=",par3,", D=",par4,")",sep="") mysub <- paste("(lambda=",par2,", d=",par3,", D=",par4,", CI=", par7, ", CI type=",par6,")",sep="") } else { mytitle <- paste("Working Time Series (base=",par8,", d=",par3,", D=",par4,")",sep="") mysub <- paste("(base=",par8,", d=",par3,", D=",par4,", CI=", par7, ", CI type=",par6,")",sep="") } plot(x,type="l", main=mytitle,xlab="time",ylab="value") par(op) dev.off() bitmap(file="pic1.png") racf <- acf(x, par1, main="Autocorrelation", xlab="time lag", ylab="ACF", ci.type=par6, ci=par7, sub=mysub) dev.off() bitmap(file="pic2.png") rpacf <- pacf(x,par1,main="Partial Autocorrelation",xlab="lags",ylab="PACF",sub=mysub) dev.off() (myacf <- c(racf\$acf)) (mypacf <- c(rpacf\$acf)) lengthx <- length(x) sqrtn <- sqrt(lengthx) load(file="createtable") a<-table.start() a<-table.row.start(a) a<-table.element(a,"Autocorrelation Function",4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Time lag k",header=TRUE) a<-table.element(a,"ACF(k)",header=TRUE) a<-table.element(a,"T-STAT",header=TRUE) a<-table.element(a,"P-value",header=TRUE) a<-table.row.end(a) for (i in 2:(par1+1)) { a<-table.row.start(a) a<-table.element(a,i-1,header=TRUE) a<-table.element(a,round(myacf[i],6)) mytstat <- myacf[i]*sqrtn a<-table.element(a,round(mytstat,4)) a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) 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,"Partial Autocorrelation Function",4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,"Time lag k",header=TRUE) a<-table.element(a,"PACF(k)",header=TRUE) a<-table.element(a,"T-STAT",header=TRUE) a<-table.element(a,"P-value",header=TRUE) a<-table.row.end(a) for (i in 1:par1) { a<-table.row.start(a) a<-table.element(a,i,header=TRUE) a<-table.element(a,round(mypacf[i],6)) mytstat <- mypacf[i]*sqrtn a<-table.element(a,round(mytstat,4)) a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file="mytable1.tab")
 Top | Output | Charts | References

 Cite this software as: Wessa P., (2017), (Partial) Autocorrelation Function (v1.0.15) in Free Statistics Software (v1.2.1), Office for Research Development and Education, URL http://www.wessa.net/rwasp_autocorrelation.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/
 Top | Output | Charts | References
 To cite Wessa.net in publications use:Wessa, P. (2024), Free Statistics Software, Office for Research Development and Education, version 1.2.1, URL https://www.wessa.net/ © All rights reserved. Academic license for non-commercial use only. 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. 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. We make 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 we 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.2.1Algorithms & Software : Patrick Wessa, PhDServer : www.wessa.net