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(544.5,619.8,777.6,640.4,633,722,860.1,495.1,692.8,766.7,648.5,640,681.6,752.5,1031.7,685.5,887.6,655.4,944.2,626.6,1221.8,939.6,886.6,811.3,774.7,910.6,911.6,697.7,829.8,824.3,885.6,538.9,686,878.7,812.7,640.4,773.9,795.9,836.3,876.1,851.7,692.4,877.3,536.8,705.9,951,755.7,695.5,744.8,672.1,666.6,760.8,756,604.4,883.9,527.9,756.2,812.9,655.6,707.6) > x <- c(1.1608,1.1208,1.0883,1.0704,1.0628,1.0378,1.0353,1.0604,1.0501,1.0706,1.0338,1.011,1.0137,0.9834,0.9643,0.947,0.906,0.9492,0.9397,0.9041,0.8721,0.8552,0.8564,0.8973,0.9383,0.9217,0.9095,0.892,0.8742,0.8532,0.8607,0.9005,0.9111,0.9059,0.8883,0.8924,0.8833,0.87,0.8758,0.8858,0.917,0.9554,0.9922,0.9778,0.9808,0.9811,1.0014,1.0183,1.0622,1.0773,1.0807,1.0848,1.1582,1.1663,1.1372,1.1139,1.1222,1.1692,1.1702,1.2286) > 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.1608 0.1208 0.0883 0.0704 0.0628 0.0378 0.0353 0.0604 0.0501 [10] 0.0706 0.0338 0.0110 0.0137 -0.0166 -0.0357 -0.0530 -0.0940 -0.0508 [19] -0.0603 -0.0959 -0.1279 -0.1448 -0.1436 -0.1027 -0.0617 -0.0783 -0.0905 [28] -0.1080 -0.1258 -0.1468 -0.1393 -0.0995 -0.0889 -0.0941 -0.1117 -0.1076 [37] -0.1167 -0.1300 -0.1242 -0.1142 -0.0830 -0.0446 -0.0078 -0.0222 -0.0192 [46] -0.0189 0.0014 0.0183 0.0622 0.0773 0.0807 0.0848 0.1582 0.1663 [55] 0.1372 0.1139 0.1222 0.1692 0.1702 0.2286 > y [1] 543.5 618.8 776.6 639.4 632.0 721.0 859.1 494.1 691.8 765.7 [11] 647.5 639.0 680.6 751.5 1030.7 684.5 886.6 654.4 943.2 625.6 [21] 1220.8 938.6 885.6 810.3 773.7 909.6 910.6 696.7 828.8 823.3 [31] 884.6 537.9 685.0 877.7 811.7 639.4 772.9 794.9 835.3 875.1 [41] 850.7 691.4 876.3 535.8 704.9 950.0 754.7 694.5 743.8 671.1 [51] 665.6 759.8 755.0 603.4 882.9 526.9 755.2 811.9 654.6 706.6 > postscript(file="/var/www/html/freestat/rcomp/tmp/1gt6z1230128378.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 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 0.153 0.130 0.071 0.026 -0.043 -0.055 -0.105 -0.189 -0.174 -0.192 -0.246 -3 -2 -1 0 1 2 3 4 5 6 7 -0.278 -0.281 -0.352 -0.431 -0.389 -0.339 -0.282 -0.293 -0.235 -0.274 -0.229 8 9 10 11 12 13 14 -0.214 -0.219 -0.160 -0.097 -0.054 -0.028 -0.021 > dev.off() null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/2fjdr1230128378.tab") > > system("convert tmp/1gt6z1230128378.ps tmp/1gt6z1230128378.png") > > > proc.time() user system elapsed 0.563 0.232 0.633