R version 2.7.0 (2008-04-22) 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.36,3.69,0.68,7.63,-1.52,5.71,13.19,-5.5,1.77,1.97,-5.61,-7.32,-1.09,-0.1,-9.4,-6.39,-2.03,0.9,7.57,-2.19,3.59,-1.69,-1.54,13.36,-3.66,0.61,9.25,11.03,-3.5,-6.56,5.55,16.5,-0.09,-10.19,-1.56,3.62,-3.46,-0.84,-1.75,-5.59,-4.31,8.29,-14.07,-4.08,3.96,-2.54,24.36,11.73,3.82,-2.98,7.46,-6.39,11.7,2.36,-7.48,-2.54,-2.31,10.86,-2.11,3.41,11.2,-1.21,5.82,-2.61,-1.54,-5.42,11.6,-9.07) > 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) > par7 = '0' > par6 = '0' > par5 = '1' > par4 = '1' > 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: 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.36 2.69 -0.32 6.63 -2.52 4.71 12.19 -6.50 0.77 0.97 [11] -6.61 -8.32 -2.09 -1.10 -10.40 -7.39 -3.03 -0.10 6.57 -3.19 [21] 2.59 -2.69 -2.54 12.36 -4.66 -0.39 8.25 10.03 -4.50 -7.56 [31] 4.55 15.50 -1.09 -11.19 -2.56 2.62 -4.46 -1.84 -2.75 -6.59 [41] -5.31 7.29 -15.07 -5.08 2.96 -3.54 23.36 10.73 2.82 -3.98 [51] 6.46 -7.39 10.70 1.36 -8.48 -3.54 -3.31 9.86 -3.11 2.41 [61] 10.20 -2.21 4.82 -3.61 -2.54 -6.42 10.60 -10.07 > postscript(file="/var/www/html/rcomp/tmp/14bf31230472342.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.032 0.169 -0.139 0.008 -0.057 0.047 0.022 -0.225 -0.222 0.097 0.263 -4 -3 -2 -1 0 1 2 3 4 5 6 -0.136 -0.062 0.005 -0.028 0.427 -0.137 0.095 0.022 0.085 0.025 0.086 7 8 9 10 11 12 13 14 15 -0.109 -0.008 0.147 -0.070 0.067 0.107 -0.170 -0.024 -0.032 > 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/2fx0p1230472343.tab") > > system("convert tmp/14bf31230472342.ps tmp/14bf31230472342.png") > > > proc.time() user system elapsed 1.172 0.282 1.232