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(7.14,7.24,7.33,7.61,7.66,7.69,7.7,7.68,7.71,7.71,7.72,7.68,7.72,7.74,7.76,7.9,7.97,7.96,7.95,7.97,7.93,7.99,7.96,7.92,7.97,7.98,8,8.04,8.17,8.29,8.26,8.3,8.32,8.28,8.27,8.32,8.31,8.34,8.32,8.36,8.33,8.35,8.34,8.37,8.31,8.33,8.34,8.25,8.27,8.31,8.25,8.3,8.3,8.35,8.78,8.9) > x <- c(1.64,1.65,1.65,1.65,1.66,1.66,1.67,1.67,1.68,1.68,1.68,1.68,1.69,1.69,1.7,1.7,1.71,1.71,1.71,1.71,1.72,1.72,1.72,1.73,1.73,1.73,1.74,1.75,1.75,1.76,1.76,1.77,1.77,1.78,1.79,1.8,1.8,1.81,1.81,1.81,1.81,1.82,1.82,1.82,1.83,1.83,1.83,1.84,1.84,1.85,1.85,1.86,1.86,1.86,1.86,1.86) > 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.00 0.01 0.00 0.01 0.00 0.01 0.00 0.00 0.00 0.01 0.00 0.01 0.00 [16] 0.01 0.00 0.00 0.00 0.01 0.00 0.00 0.01 0.00 0.00 0.01 0.01 0.00 0.01 0.00 [31] 0.01 0.00 0.01 0.01 0.01 0.00 0.01 0.00 0.00 0.00 0.01 0.00 0.00 0.01 0.00 [46] 0.00 0.01 0.00 0.01 0.00 0.01 0.00 0.00 0.00 0.00 > y [1] 0.10 0.09 0.28 0.05 0.03 0.01 -0.02 0.03 0.00 0.01 -0.04 0.04 [13] 0.02 0.02 0.14 0.07 -0.01 -0.01 0.02 -0.04 0.06 -0.03 -0.04 0.05 [25] 0.01 0.02 0.04 0.13 0.12 -0.03 0.04 0.02 -0.04 -0.01 0.05 -0.01 [37] 0.03 -0.02 0.04 -0.03 0.02 -0.01 0.03 -0.06 0.02 0.01 -0.09 0.02 [49] 0.04 -0.06 0.05 0.00 0.05 0.43 0.12 > postscript(file="/var/www/html/rcomp/tmp/1pjee1292849209.ps",horizontal=F,onefile=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 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -0.059 -0.020 -0.041 -0.103 -0.016 -0.100 0.044 0.012 -0.127 0.085 0.011 -3 -2 -1 0 1 2 3 4 5 6 7 -0.067 0.128 -0.082 -0.118 -0.082 0.038 0.009 -0.052 0.147 0.056 -0.077 8 9 10 11 12 13 14 0.052 -0.031 0.011 0.000 0.035 0.071 -0.061 > 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/2ekb81292849209.tab") > > try(system("convert tmp/1pjee1292849209.ps tmp/1pjee1292849209.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.383 0.185 0.848