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. > y <- c(1.77,1.76,1.77,1.95,1.98,1.93,1.94,1.92,1.94,1.92,1.92,1.94,1.91,1.88,1.98,2.4,2.47,2.22,1.98,1.89,1.87,1.88,1.86,1.81,1.79,1.78,1.73,1.88,1.91,1.9,1.84,1.85,1.83,1.82,1.82,1.81,1.75,1.74,1.73,1.96,2.07,1.96,1.87,1.84,1.81,1.78,1.72,1.73,1.64,1.61,1.63,1.92,1.88,1.68,1.58,1.49,1.46,1.44,1.44,1.42,1.4,1.38,1.36,1.48,1.56,1.51,1.51,1.42,1.4,1.38,1.35,1.29) > x <- c(1.19,1.18,1.18,1.33,1.3,1.25,1.22,1.17,1.18,1.19,1.21,1.21,1.2,1.2,1.29,1.83,1.85,1.54,1.52,1.43,1.4,1.4,1.39,1.37,1.33,1.36,1.34,1.75,1.84,1.73,1.63,1.5,1.45,1.38,1.38,1.27,1.31,1.29,1.32,1.48,1.39,1.45,1.44,1.44,1.42,1.39,1.4,1.39,1.3,1.32,1.35,1.51,1.37,1.25,1.15,1.09,1.09,1.06,1.02,1.01,1,1,1.05,1.3,1.34,1.24,1.22,1.06,1,1,1,1.01) > par7 = '1' > par6 = '0' > par5 = '1' > par4 = '1' > par3 = '1' > par2 = '0' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2008), Cross Correlation Function (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_cross.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > par6 <- as.numeric(par6) > par7 <- as.numeric(par7) > if (par1 == 0) { + x <- log(x) + } else { + x <- (x ^ par1 - 1) / par1 + } > if (par5 == 0) { + y <- log(y) + } else { + y <- (y ^ par5 - 1) / par5 + } > if (par2 > 0) x <- diff(x,lag=1,difference=par2) > if (par6 > 0) y <- diff(y,lag=1,difference=par6) > if (par3 > 0) x <- diff(x,lag=par4,difference=par3) > if (par7 > 0) y <- diff(y,lag=par4,difference=par7) > x [1] -0.01 0.00 0.15 -0.03 -0.05 -0.03 -0.05 0.01 0.01 0.02 0.00 -0.01 [13] 0.00 0.09 0.54 0.02 -0.31 -0.02 -0.09 -0.03 0.00 -0.01 -0.02 -0.04 [25] 0.03 -0.02 0.41 0.09 -0.11 -0.10 -0.13 -0.05 -0.07 0.00 -0.11 0.04 [37] -0.02 0.03 0.16 -0.09 0.06 -0.01 0.00 -0.02 -0.03 0.01 -0.01 -0.09 [49] 0.02 0.03 0.16 -0.14 -0.12 -0.10 -0.06 0.00 -0.03 -0.04 -0.01 -0.01 [61] 0.00 0.05 0.25 0.04 -0.10 -0.02 -0.16 -0.06 0.00 0.00 0.01 > y [1] -0.01 0.01 0.18 0.03 -0.05 0.01 -0.02 0.02 -0.02 0.00 0.02 -0.03 [13] -0.03 0.10 0.42 0.07 -0.25 -0.24 -0.09 -0.02 0.01 -0.02 -0.05 -0.02 [25] -0.01 -0.05 0.15 0.03 -0.01 -0.06 0.01 -0.02 -0.01 0.00 -0.01 -0.06 [37] -0.01 -0.01 0.23 0.11 -0.11 -0.09 -0.03 -0.03 -0.03 -0.06 0.01 -0.09 [49] -0.03 0.02 0.29 -0.04 -0.20 -0.10 -0.09 -0.03 -0.02 0.00 -0.02 -0.02 [61] -0.02 -0.02 0.12 0.08 -0.05 0.00 -0.09 -0.02 -0.02 -0.03 -0.06 > postscript(file="/var/www/html/rcomp/tmp/1l8b11261067336.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > (r <- ccf(x,y,main='Cross Correlation Function',ylab='CCF',xlab='Lag (k)')) Autocorrelations of series 'X', by lag -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -0.106 -0.113 0.251 0.458 -0.022 -0.125 -0.132 -0.125 -0.032 0.031 -0.014 -4 -3 -2 -1 0 1 2 3 4 5 6 -0.144 -0.257 -0.154 0.378 0.771 0.050 -0.218 -0.168 -0.102 -0.011 0.012 7 8 9 10 11 12 13 14 15 0.025 -0.121 -0.221 -0.185 0.192 0.693 0.163 -0.109 -0.138 > dev.off() null device 1 > > #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,'Cross Correlation Function',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'Value',header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Box-Cox transformation parameter (lambda) of X series',header=TRUE) > a<-table.element(a,par1) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of non-seasonal differencing (d) of X series',header=TRUE) > a<-table.element(a,par2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of seasonal differencing (D) of X series',header=TRUE) > a<-table.element(a,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Seasonal Period (s)',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Box-Cox transformation parameter (lambda) of Y series',header=TRUE) > a<-table.element(a,par5) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of non-seasonal differencing (d) of Y series',header=TRUE) > a<-table.element(a,par6) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Degree of seasonal differencing (D) of Y series',header=TRUE) > a<-table.element(a,par7) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'k',header=TRUE) > a<-table.element(a,'rho(Y[t],X[t+k])',header=TRUE) > a<-table.row.end(a) > mylength <- length(r$acf) > myhalf <- floor((mylength-1)/2) > for (i in 1:mylength) { + a<-table.row.start(a) + a<-table.element(a,i-myhalf-1,header=TRUE) + a<-table.element(a,r$acf[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/24xkm1261067336.tab") > > try(system("convert tmp/1l8b11261067336.ps tmp/1l8b11261067336.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.371 0.155 0.451