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 = '0' > par6 = '0' > par5 = '1' > par4 = '1' > par3 = '0' > par2 = '0' > par1 = '1' > 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] 57.972 58.249 62.955 52.785 51.760 43.795 36.348 31.370 31.717 39.974 [11] 32.591 20.124 57.608 45.865 50.378 45.235 46.206 44.382 40.227 32.795 [21] 30.295 41.625 32.625 20.538 55.421 52.152 52.536 51.408 40.454 37.271 [31] 34.306 25.414 30.917 37.030 26.534 17.387 49.556 42.901 47.572 42.899 [41] 36.532 39.357 34.489 28.027 33.485 41.598 29.306 25.451 46.460 49.104 [51] 60.465 52.726 38.477 42.895 30.481 28.896 32.842 38.120 32.702 24.094 > y [1] 53.281 62.654 67.918 57.686 66.074 59.183 53.326 53.085 52.564 59.873 [11] 52.398 44.164 58.672 55.298 61.361 55.930 61.954 61.431 51.528 53.060 [21] 52.093 51.695 51.333 40.747 57.576 56.851 62.721 62.384 60.141 58.231 [31] 62.472 48.214 54.816 60.713 47.664 44.351 56.888 53.091 58.098 57.962 [41] 54.433 59.403 59.721 47.440 56.981 59.258 46.312 45.980 53.846 55.824 [51] 66.744 61.849 53.691 64.461 52.724 53.560 56.722 54.458 47.490 45.362 > postscript(file="/var/www/html/rcomp/tmp/1svfz1228762779.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 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 0.259 0.241 0.527 0.017 -0.301 -0.243 -0.222 -0.361 -0.236 -0.025 0.127 -3 -2 -1 0 1 2 3 4 5 6 7 0.305 0.353 0.409 0.769 0.128 -0.209 -0.173 -0.270 -0.316 -0.303 -0.153 8 9 10 11 12 13 14 0.092 0.097 0.184 0.298 0.482 0.065 -0.157 > 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/2ebhz1228762779.tab") > > system("convert tmp/1svfz1228762779.ps tmp/1svfz1228762779.png") > > > proc.time() user system elapsed 0.402 0.175 0.823