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(-1,4,9,18,13,9,5,9,9,17,7,4,8,1,4,2,1,5,15,11,4,11,2,3,7,6,4,5,3,2,1,1,0,9,3,4,-3) > x <- c(-19,0,-18,-17,0,-16,-1,-11,7,-2,-9,-8,4,-7,2,1,3,5,0,11,5,-1,17,0,4,13,0,-7,19,9,2,9,8,-2,-6,-5,11) > par7 = '0' > par6 = '0' > par5 = '0.1' > par4 = '12' > par3 = '0' > par2 = '0' > par1 = '-2.0' > #'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] 0.4986150 -Inf 0.4984568 0.4982699 -Inf 0.4980469 0.0000000 [8] 0.4958678 0.4897959 0.3750000 0.4938272 0.4921875 0.4687500 0.4897959 [15] 0.3750000 0.0000000 0.4444444 0.4800000 -Inf 0.4958678 0.4800000 [22] 0.0000000 0.4982699 -Inf 0.4687500 0.4970414 -Inf 0.4897959 [29] 0.4986150 0.4938272 0.3750000 0.4938272 0.4921875 0.3750000 0.4861111 [36] 0.4800000 0.4958678 > y [1] NaN 1.4869835 2.4573094 3.3514136 2.9239222 2.4573094 [7] 1.7461894 2.4573094 2.4573094 3.2753167 2.1481404 1.4869835 [13] 2.3114441 0.0000000 1.4869835 0.7177346 0.0000000 1.7461894 [19] 3.1101942 2.7098162 1.4869835 2.7098162 0.7177346 1.1612317 [25] 2.1481404 1.9623120 1.4869835 1.7461894 1.1612317 0.7177346 [31] 0.0000000 0.0000000 -10.0000000 2.4573094 1.1612317 1.4869835 [37] NaN > postscript(file="/var/www/html/rcomp/tmp/1dxnq1228253643.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)')) Error in na.fail.default(ts.intersect(as.ts(x), as.ts(y))) : missing values in object Calls: ccf -> na.action -> na.fail.default Execution halted