R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(54.281,63.654,68.918,58.686,67.074,60.183,54.326,54.085,53.564,60.873,53.398,45.164,59.672,56.298,62.361,56.930,62.954,62.431,52.528,54.060,53.093,52.695,52.333,41.747,58.576,57.851,63.721,63.384,61.141,59.231,63.472,49.214,55.816,61.713,48.664,45.351,57.888,54.091,59.098,58.962,55.433,60.403,60.721,48.440,57.981,60.258,47.312,46.980,54.846,56.824,67.744,62.849,54.691,65.461,53.724,54.560,57.722,55.458,48.490,46.362) > x <- c(58.972,59.249,63.955,53.785,52.760,44.795,37.348,32.370,32.717,40.974,33.591,21.124,58.608,46.865,51.378,46.235,47.206,45.382,41.227,33.795,31.295,42.625,33.625,21.538,56.421,53.152,53.536,52.408,41.454,38.271,35.306,26.414,31.917,38.030,27.534,18.387,50.556,43.901,48.572,43.899,37.532,40.357,35.489,29.027,34.485,42.598,30.306,26.451,47.460,50.104,61.465,53.726,39.477,43.895,31.481,29.896,33.842,39.120,33.702,25.094) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '1' > par6 = '0' > par5 = '-2.0' > par4 = '12' > par3 = '1' > par2 = '1' > par1 = '-1.7' > ylab = '' > xlab = '' > main = '' > #'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] -2.731558e-04 5.343145e-05 2.873322e-05 5.252128e-05 1.646277e-04 [6] 1.731190e-04 -8.067432e-05 -2.353025e-04 1.921025e-04 -6.675049e-05 [11] 1.042702e-04 -1.456303e-04 2.024287e-04 -1.145613e-04 1.176987e-04 [16] -3.741655e-04 -9.408952e-05 -1.703371e-05 -4.519673e-04 8.260035e-04 [21] -2.690808e-04 -3.907192e-04 -3.783462e-04 8.555231e-04 -1.363193e-04 [26] 1.415579e-04 -1.249995e-04 5.424563e-05 2.960203e-04 -9.137703e-05 [31] 3.215392e-04 -1.323954e-04 1.130818e-05 1.031798e-04 1.605959e-03 [36] -2.006304e-03 2.756829e-04 7.262060e-05 1.228072e-05 -1.739236e-04 [41] 4.382049e-05 -4.537089e-04 4.017090e-04 -1.403188e-04 -1.091334e-04 [46] 4.500666e-04 -5.047691e-04 > y [1] 2.927711e-05 -3.435436e-05 -2.330124e-05 -9.094128e-06 -1.502274e-05 [6] 9.762434e-06 -1.179650e-05 -1.581287e-07 -3.105702e-06 -4.513203e-05 [11] -7.209758e-06 -4.176903e-05 -5.303881e-06 8.356144e-06 5.429636e-06 [16] 2.981765e-05 -7.592947e-06 -1.423561e-05 5.710288e-05 -3.535208e-05 [21] 1.688455e-05 4.878030e-05 -2.856665e-05 4.378634e-05 -3.484445e-06 [26] -2.149211e-05 -2.001929e-05 -1.936756e-05 -2.896369e-05 5.476929e-06 [31] -1.150047e-05 -6.649904e-06 1.176169e-05 -6.416628e-06 -1.223915e-05 [36] 1.656681e-05 -1.701050e-05 1.604303e-05 3.421063e-05 1.723971e-05 [41] -4.445160e-06 2.035955e-05 -3.762393e-05 4.512338e-05 -1.337705e-06 [46] -2.486834e-05 1.072119e-05 -6.079743e-06 > postscript(file="/var/www/html/rcomp/tmp/1cicc1228763234.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 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 0.098 0.037 -0.095 0.183 0.172 -0.323 0.214 -0.106 -0.017 0.190 -0.240 -2 -1 0 1 2 3 4 5 6 7 8 -0.089 0.231 -0.309 0.051 0.104 -0.245 0.056 0.189 -0.179 0.149 -0.086 9 10 11 12 13 0.029 0.136 0.095 -0.200 0.334 > 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/2587i1228763234.tab") > > system("convert tmp/1cicc1228763234.ps tmp/1cicc1228763234.png") > > > proc.time() user system elapsed 0.407 0.174 0.468