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(-15.57,-7,-2.08,6.06,3.1,-7.28,11.93,-15.18,-4.97,-3.06,5.18,-2.3,-1.86,-8.75,-8.02,4.8,3.9,-11.31,4.26,-6.89,4.13,4.25,-5.92,-2.62,-5.12,-6.19,1.58,6.93,1.3,0.7,18.15,-13.63,-8.97,-3.48,0.13,0.16,-1.28,-8.46,-2.92,0.15,3.87,7.71,-4.12,-2.74,3.19,-6.22,1.25,4.24,0.15,-2.06,2.14,-1.68,5.03,2.25,-6.58,-2.85,5.04,4.44,-0.68,-2.51,2.36,-6.32,-3.82,2.17,4.14,-6.96,5.28,4.28) > 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] -16.57 -8.00 -3.08 5.06 2.10 -8.28 10.93 -16.18 -5.97 -4.06 [11] 4.18 -3.30 -2.86 -9.75 -9.02 3.80 2.90 -12.31 3.26 -7.89 [21] 3.13 3.25 -6.92 -3.62 -6.12 -7.19 0.58 5.93 0.30 -0.30 [31] 17.15 -14.63 -9.97 -4.48 -0.87 -0.84 -2.28 -9.46 -3.92 -0.85 [41] 2.87 6.71 -5.12 -3.74 2.19 -7.22 0.25 3.24 -0.85 -3.06 [51] 1.14 -2.68 4.03 1.25 -7.58 -3.85 4.04 3.44 -1.68 -3.51 [61] 1.36 -7.32 -4.82 1.17 3.14 -7.96 4.28 3.28 > postscript(file="/var/www/html/rcomp/tmp/1wn6i1230472594.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.015 -0.087 0.011 0.137 -0.161 0.028 0.150 -0.014 0.080 -0.027 -0.152 -4 -3 -2 -1 0 1 2 3 4 5 6 -0.128 0.184 -0.145 0.096 0.245 0.004 0.109 -0.327 -0.094 0.377 0.267 7 8 9 10 11 12 13 14 15 -0.060 -0.086 -0.050 -0.138 0.214 -0.022 -0.084 0.122 -0.100 > 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/2svla1230472594.tab") > > system("convert tmp/1wn6i1230472594.ps tmp/1wn6i1230472594.png") > > > proc.time() user system elapsed 1.181 0.278 1.234