R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(7291,6820,8031,7862,7357,7213,7079,7012,7319,8148,7599,6908,7878,7407,7911,7323,7179,6758,6934,6696,7688,8296,7697,7907,7592,7710,9011,8225,7733,8062,7859,8221,8330,8868,9053,8811,8120,7953,8878,8601,8361,9116,9310,9891,10147,10317,10682,10276,10614,9413,11068,9772,10350,10541,10049,10714,10759,11684,11462,10485,11056,10184,11082,10554,11315,10847,11104,11026,11073,12073,12328,11172) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: > 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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1fit01259089272.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2e7pk1259089272.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.641127126 0.625899753 0.536811523 0.422974333 [6] 0.343363430 0.237288576 0.148339408 0.104835569 0.053975604 [11] -0.095426922 -0.091198599 -0.166361330 -0.061231980 -0.067592541 [16] -0.107693413 -0.045863980 -0.051922814 0.001277833 -0.026766621 [21] -0.047220354 0.040946076 0.019304756 -0.025899354 -0.136678873 [26] -0.214342491 -0.253280231 -0.270182758 -0.349734299 -0.308997700 [31] -0.270804343 -0.322929102 -0.264043904 -0.342094944 -0.247378363 [36] -0.186830993 -0.192820041 > (mypacf <- c(rpacf$acf)) [1] 0.641127126 0.364807827 0.094075478 -0.082760824 -0.064816928 [6] -0.091915777 -0.077957554 0.017019444 0.021425366 -0.225929877 [11] -0.007259206 -0.034807126 0.271569521 0.096888637 -0.137090453 [16] -0.029189406 -0.036389044 0.108028669 -0.024982026 -0.137952604 [21] 0.114554487 -0.084294090 -0.062646350 -0.270009496 -0.201575271 [26] -0.018541376 0.044278164 0.046291670 0.066163919 0.065208119 [31] -0.135004516 -0.014100741 -0.049141999 0.019484940 -0.001921314 [36] -0.193619839 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/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,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),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="/var/www/html/rcomp/tmp/3xg6g1259089272.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,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),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="/var/www/html/rcomp/tmp/4yiro1259089272.tab") > > system("convert tmp/1fit01259089272.ps tmp/1fit01259089272.png") > system("convert tmp/2e7pk1259089272.ps tmp/2e7pk1259089272.png") > > > proc.time() user system elapsed 0.532 0.318 0.814