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(-0.39,4.81,-5.87,16.07,-8.58,5.08,0.09,3.83,5.82,37.12,-0.46,-3.63,-3.88,4.62,-12.97,3.2,-5.75,-0.57,-7.16,-18.05,15.63,-18.68,-0.7,2.59,2.57,0.36,32.56,8.53,1.42,3.53,0.9,-1.1,13.32,-33.59,-0.85,42.09,-6.25,-11.08,-29.29,-11.17,13.92,13.54,-16.49,-9.38,-2.84,-2.88,6.18,3.71,3.18,-4.18,13.6,4.82,10.05,9.69,-13.63,2.81,2.39,9.12,14.21,3.49,5.51,-6.15,2.72,-11.12,-4.7,1.82,-10.44,6.04) > x <- c(0.65,-1.53,-3.36,10.51,-1.02,-2.68,-9.75,3.64,9.5,-0.33,-0.99,3.16,4.27,-2.97,-7.49,0.33,-2.57,4.07,5.31,-8.09,5.29,7.38,-6.12,-3.38,-8.61,2.58,10.02,7.08,-2.75,3.42,-1.6,0.65,2.86,-3.52,5.65,4.31,-4.39,-5.85,-5.47,-2.3,-0.14,8.08,-7.43,0.02,-2.47,-2.11,7.87,4.66,3.6,-3.64,7.26,-7.62,13.83,1.28,-0.32,-2.9,4.92,11.99,10.06,-2.22,3.97,0.56,3.34,-2.86,4.38,1.43,-0.49,-1.23) > 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: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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) x <- diff(y,lag=par4,difference=par7) > x [1] -0.35 -2.53 -4.36 9.51 -2.02 -3.68 -10.75 2.64 8.50 -1.33 [11] -1.99 2.16 3.27 -3.97 -8.49 -0.67 -3.57 3.07 4.31 -9.09 [21] 4.29 6.38 -7.12 -4.38 -9.61 1.58 9.02 6.08 -3.75 2.42 [31] -2.60 -0.35 1.86 -4.52 4.65 3.31 -5.39 -6.85 -6.47 -3.30 [41] -1.14 7.08 -8.43 -0.98 -3.47 -3.11 6.87 3.66 2.60 -4.64 [51] 6.26 -8.62 12.83 0.28 -1.32 -3.90 3.92 10.99 9.06 -3.22 [61] 2.97 -0.44 2.34 -3.86 3.38 0.43 -1.49 -2.23 > y [1] -1.39 3.81 -6.87 15.07 -9.58 4.08 -0.91 2.83 4.82 36.12 [11] -1.46 -4.63 -4.88 3.62 -13.97 2.20 -6.75 -1.57 -8.16 -19.05 [21] 14.63 -19.68 -1.70 1.59 1.57 -0.64 31.56 7.53 0.42 2.53 [31] -0.10 -2.10 12.32 -34.59 -1.85 41.09 -7.25 -12.08 -30.29 -12.17 [41] 12.92 12.54 -17.49 -10.38 -3.84 -3.88 5.18 2.71 2.18 -5.18 [51] 12.60 3.82 9.05 8.69 -14.63 1.81 1.39 8.12 13.21 2.49 [61] 4.51 -7.15 1.72 -12.12 -5.70 0.82 -11.44 5.04 > postscript(file="/var/www/html/rcomp/tmp/1y2jw1230545902.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.135 0.181 -0.232 -0.058 -0.165 0.009 0.136 -0.031 -0.205 0.146 0.189 -4 -3 -2 -1 0 1 2 3 4 5 6 -0.204 -0.088 -0.068 0.108 0.471 -0.011 -0.028 -0.024 -0.059 0.069 0.192 7 8 9 10 11 12 13 14 15 -0.082 -0.093 0.078 -0.231 0.058 0.147 -0.193 -0.183 -0.076 > 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/2mvra1230545903.tab") > > system("convert tmp/1y2jw1230545902.ps tmp/1y2jw1230545902.png") > > > proc.time() user system elapsed 0.385 0.173 0.457