R version 2.6.1 (2007-11-26) Copyright (C) 2007 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(281,295,294,302,314,321,313,310,319,316,319,333,356,358,340,328,355,356,351,359,378,378,389.,407,413,404,406,402,383,392,398,400,405,420,439,441,424,423,434,429,421,430,424,437,456,469,476,510,549,554,557,610,675,596,633,632,596,585,627,629) > x <- c(0.88,0.87,0.88,0.89,0.92,0.96,0.99,0.98,0.98,0.98,1.00,1.02,1.06,1.08,1.08,1.08,1.16,1.17,1.14,1.11,1.12,1.17,1.17,1.23,1.26,1.26,1.23,1.20,1.20,1.21,1.23,1.22,1.22,1.25,1.30,1.34,1.31,1.30,1.32,1.29,1.27,1.22,1.20,1.23,1.23,1.20,1.18,1.19,1.21,1.19,1.20,1.23,1.28,1.27,1.27,1.28,1.27,1.26,1.29,1.32) > par7 = '0' > par6 = '2' > par5 = '1' > par4 = '12' > par3 = '1' > par2 = '1' > 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.03 -0.01 -0.01 0.05 -0.03 -0.06 -0.02 0.01 0.05 -0.02 0.04 -0.01 [13] -0.02 -0.03 -0.03 -0.08 0.00 0.05 0.02 -0.01 -0.02 0.05 -0.02 -0.06 [25] -0.01 0.05 0.00 -0.02 -0.06 -0.04 0.04 0.00 -0.06 -0.07 -0.03 0.05 [37] -0.01 -0.01 0.06 0.07 0.04 0.02 -0.02 -0.01 0.02 0.05 0.02 > y [1] -15 9 4 -5 -15 5 12 -12 6 11 9 -21 -20 6 39 [16] -26 -6 13 11 -19 11 7 -12 -15 11 -6 -15 28 -3 -4 [31] 3 10 4 -17 -19 16 12 -16 -3 17 -15 19 6 -6 -6 [46] 27 5 -34 -2 50 12 -144 116 -38 -35 25 53 -40 > postscript(file="/var/www/html/rcomp/tmp/1bej21200514091.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 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -0.209 -0.358 0.212 0.327 -0.183 -0.172 0.084 0.369 -0.074 -0.064 -0.039 -2 -1 0 1 2 3 4 5 6 7 8 -0.023 0.079 0.272 -0.130 -0.145 0.169 0.189 -0.130 -0.268 0.072 0.158 9 10 11 12 13 -0.037 -0.083 0.201 0.065 -0.040 > dev.off() null device 1 > 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/21oee1200514091.tab") > > system("convert tmp/1bej21200514091.ps tmp/1bej21200514091.png") > > > proc.time() user system elapsed 0.634 0.171 0.694