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(6539,6699,6962,6981,7024,6940,6774,6671,6965,6969,6822,6878,6691,6837,7018,7167,7076,7171,7093,6971,7142,7047,6999,6650,6475,6437,6639,6422,6272,6232,6003,5673,6050,5977,5796,5752,5609,5839,6069,6006,5809,5797,5502,5568,5864,5764,5615,5615,5681,5915,6334,6494,6620,6578,6495,6538,6737,6651,6530,6563) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1b0uu1259953204.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/2pnyc1259953204.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.0000000000 0.9414030383 0.8668085791 0.8062124436 0.7474296565 [6] 0.7036235148 0.6564366064 0.5592282073 0.4545358191 0.3788826118 [11] 0.3160786503 0.2932581843 0.2559912529 0.1663808865 0.0743660588 [16] 0.0097344307 -0.0562433736 -0.0972732088 -0.1445764944 -0.2294787736 [21] -0.3088553220 -0.3601834393 -0.3944867533 -0.4056587284 -0.4132453721 [26] -0.4568850781 -0.4805956264 -0.4807508285 -0.4649690972 -0.4274748360 [31] -0.3873908447 -0.3718429584 -0.3488453864 -0.3096327416 -0.2674156253 [36] -0.2185401964 -0.1871211289 -0.1809899088 -0.1794646749 -0.1659802711 [41] -0.1508931391 -0.1250087771 -0.1038285343 -0.0946952701 -0.0828969663 [46] -0.0626660172 -0.0346297295 -0.0026942338 0.0236681361 0.0320382201 [51] 0.0354972834 0.0354343953 0.0324275578 0.0307187021 0.0282519578 [56] 0.0217491578 0.0137082003 0.0075782001 0.0028864732 0.0008851113 > (mypacf <- c(rpacf$acf)) [1] 0.941403038 -0.170807375 0.105152697 -0.056128670 0.122005078 [6] -0.106553601 -0.441553934 -0.018797567 0.157995683 0.013459908 [11] 0.307581026 -0.327009177 -0.312742552 0.021516955 0.079403249 [16] -0.198673492 -0.035834284 -0.114865340 0.073885252 0.042291273 [21] 0.012871032 -0.081412688 -0.100073525 0.135355551 -0.069478109 [26] 0.051829137 -0.032736053 0.096754687 0.094262200 0.084897957 [31] 0.053583784 -0.068973024 -0.115901625 0.052021704 -0.194408073 [36] -0.093203538 -0.019075813 -0.144328359 0.041813619 0.050131962 [41] -0.050215229 0.086972976 -0.032680821 -0.027805757 -0.117602851 [46] 0.008477373 0.086180735 -0.005587719 0.031822042 -0.018561844 [51] -0.028476609 -0.016401302 0.023486172 -0.020318536 0.044004482 [56] 0.001750327 0.029117264 -0.118493057 -0.024962897 > 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/3pjdg1259953204.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/48n6e1259953204.tab") > > system("convert tmp/1b0uu1259953204.ps tmp/1b0uu1259953204.png") > system("convert tmp/2pnyc1259953204.ps tmp/2pnyc1259953204.png") > > > proc.time() user system elapsed 0.598 0.327 0.720