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(14.36,14.62,13.51,14.95,16.72,16.33,15.21,16.69,15.81,16.02,16.7,15.99,17.68,18.89,18.72,21.14,20.97,23.75,23.05,23.45,21.74,19.37,21.1,21.2,22.67,22.24,23.78,23.27,25.74,26.1,27.49,31.41,28.79,26.76,26.41,27.05,29.43,32.1,36.84,34.22,36.53,40.99,45.97,43.6,47.84,51.47,51.31,48.47,48.28,46.56,43.83,51.17,49.59,49.11,49.97,50.07,53.3,57.08,68.54,71.62,67.64,64.79,80.97,88.42,110.22,99,95.95,107.94,97.82,111.64,114.73,117.58,99.19,90.19,59.74,44.51,23.94,21.29,20.77,25.07,32.95,40.05,44.59,40.28,41.19,38.14,41.85,43.76,50.16,52.94,47.69,51.52,58.69,50.44,45.72,43.24,51.49,50.43,58.73,65.12,64.13) > x <- c(54.64,52.39,52.51,52.92,55.22,55.41,57.02,58.55,57.49,55.52,57.84,58.69,59.74,60.7,60.74,64.32,66.9,70.93,75.89,80.6,81.39,81.33,77.04,79.54,81.93,80.79,81.98,85.94,86.6,87.42,93.14,95.76,99.75,97.71,94.99,96.41,96.28,100.14,99.9,102.87,107.37,115.68,124.33,128.44,130.19,148.4,169.14,153.98,163.13,165.4,166.35,173.73,174.23,177.04,170.78,174.01,183.76,201.95,205.38,197.36,196.53,179.94,174.84,179.86,172.77,162.56,178.4,190.83,201.07,198.95,190.46,186.27,187.96,174.99,164.1,131.48,116.14,103.43,96.87,93.68,96.49,105.22,110.11,118.47,122.15,137.35,134.83,138.34,141.98,149.45,154.68,145.98,156.33,176.28,159.08,151.18,162.63,174.2,180.51,185.31,186.33) > par7 = '0' > par6 = '0' > par5 = '1' > par4 = '12' > par3 = '0' > 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#output/ > #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] 53.64 51.39 51.51 51.92 54.22 54.41 56.02 57.55 56.49 54.52 [11] 56.84 57.69 58.74 59.70 59.74 63.32 65.90 69.93 74.89 79.60 [21] 80.39 80.33 76.04 78.54 80.93 79.79 80.98 84.94 85.60 86.42 [31] 92.14 94.76 98.75 96.71 93.99 95.41 95.28 99.14 98.90 101.87 [41] 106.37 114.68 123.33 127.44 129.19 147.40 168.14 152.98 162.13 164.40 [51] 165.35 172.73 173.23 176.04 169.78 173.01 182.76 200.95 204.38 196.36 [61] 195.53 178.94 173.84 178.86 171.77 161.56 177.40 189.83 200.07 197.95 [71] 189.46 185.27 186.96 173.99 163.10 130.48 115.14 102.43 95.87 92.68 [81] 95.49 104.22 109.11 117.47 121.15 136.35 133.83 137.34 140.98 148.45 [91] 153.68 144.98 155.33 175.28 158.08 150.18 161.63 173.20 179.51 184.31 [101] 185.33 > y [1] 13.36 13.62 12.51 13.95 15.72 15.33 14.21 15.69 14.81 15.02 [11] 15.70 14.99 16.68 17.89 17.72 20.14 19.97 22.75 22.05 22.45 [21] 20.74 18.37 20.10 20.20 21.67 21.24 22.78 22.27 24.74 25.10 [31] 26.49 30.41 27.79 25.76 25.41 26.05 28.43 31.10 35.84 33.22 [41] 35.53 39.99 44.97 42.60 46.84 50.47 50.31 47.47 47.28 45.56 [51] 42.83 50.17 48.59 48.11 48.97 49.07 52.30 56.08 67.54 70.62 [61] 66.64 63.79 79.97 87.42 109.22 98.00 94.95 106.94 96.82 110.64 [71] 113.73 116.58 98.19 89.19 58.74 43.51 22.94 20.29 19.77 24.07 [81] 31.95 39.05 43.59 39.28 40.19 37.14 40.85 42.76 49.16 51.94 [91] 46.69 50.52 57.69 49.44 44.72 42.24 50.49 49.43 57.73 64.12 [101] 63.13 > postscript(file="/var/www/html/rcomp/tmp/10lin1292785783.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 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 0.392 0.433 0.474 0.516 0.549 0.572 0.591 0.606 0.619 0.637 0.666 0.691 0.715 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 0.744 0.778 0.810 0.838 0.854 0.830 0.784 0.731 0.675 0.608 0.539 0.476 0.417 9 10 11 12 13 14 15 16 17 0.358 0.308 0.262 0.221 0.186 0.165 0.148 0.135 0.124 > 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/264xy1292785783.tab") > > try(system("convert tmp/10lin1292785783.ps tmp/10lin1292785783.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.391 0.173 0.887