R version 2.6.0 (2007-10-03) 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(106.7,110.2,125.9,100.1,106.4,114.8,81.3,87,104.2,108,105,94.5,92,95.9,108.8,103.4,102.1,110.1,83.2,82.7,106.8,113.7,102.5,96.6,92.1,95.6,102.3,98.6,98.2,104.5,84,73.8,103.9,106,97.2,102.6,89,93.8,116.7,106.8,98.5,118.7,90,91.9,113.3,113.1,104.1,108.7,96.7,101,116.9,105.8,99,129.4,83,88.9,115.9,104.2,113.4,112.2,100.8,107.3,126.6,102.9,117.9,128.8,87.5,93.8,122.7,126.2,124.6,116.7,115.2,111.1,129.9,113.3,118.5,133.5,102.1,102.4) > x <- c(97.3,101,113.2,101,105.7,113.9,86.4,96.5,103.3,114.9,105.8,94.2,98.4,99.4,108.8,112.6,104.4,112.2,81.1,97.1,112.6,113.8,107.8,103.2,103.3,101.2,107.7,110.4,101.9,115.9,89.9,88.6,117.2,123.9,100,103.6,94.1,98.7,119.5,112.7,104.4,124.7,89.1,97,121.6,118.8,114,111.5,97.2,102.5,113.4,109.8,104.9,126.1,80,96.8,117.2,112.3,117.3,111.1,102.2,104.3,122.9,107.6,121.3,131.5,89,104.4,128.9,135.9,133.3,121.3,120.5,120.4,137.9,126.1,133.2,146.6,103.4,117.2) > par7 = '1' > par6 = '0' > par5 = '1' > par4 = '12' > par3 = '1' > 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] -14.7 -14.3 -17.1 3.3 -4.3 -4.7 1.9 -4.3 2.6 5.7 -2.5 2.1 [13] 0.1 -0.3 -6.5 -4.8 -3.9 -5.6 0.8 -8.9 -2.9 -7.7 -5.3 6.0 [25] -3.1 -1.8 14.4 8.2 0.3 14.2 6.0 18.1 9.4 7.1 6.9 6.1 [37] 7.7 7.2 0.2 -1.0 0.5 10.7 -7.0 -3.0 2.6 -8.9 9.3 3.5 [49] 4.1 6.3 9.7 -2.9 18.9 -0.6 4.5 4.9 6.8 22.0 11.2 4.5 [61] 14.4 3.8 3.3 10.4 0.6 4.7 14.6 8.6 > y [1] 105.7 109.2 124.9 99.1 105.4 113.8 80.3 86.0 103.2 107.0 104.0 93.5 [13] 91.0 94.9 107.8 102.4 101.1 109.1 82.2 81.7 105.8 112.7 101.5 95.6 [25] 91.1 94.6 101.3 97.6 97.2 103.5 83.0 72.8 102.9 105.0 96.2 101.6 [37] 88.0 92.8 115.7 105.8 97.5 117.7 89.0 90.9 112.3 112.1 103.1 107.7 [49] 95.7 100.0 115.9 104.8 98.0 128.4 82.0 87.9 114.9 103.2 112.4 111.2 [61] 99.8 106.3 125.6 101.9 116.9 127.8 86.5 92.8 121.7 125.2 123.6 115.7 [73] 114.2 110.1 128.9 112.3 117.5 132.5 101.1 101.4 > postscript(file="/var/www/html/rcomp/tmp/1g7jo1195813459.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > (r <- ccf(x,y,main='Cross Correlation Function',xlab='Lag (k)')) Autocorrelations of series 'X', by lag -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 0.205 0.017 0.116 0.319 0.059 0.187 0.163 0.025 0.184 0.213 0.113 -4 -3 -2 -1 0 1 2 3 4 5 6 0.164 0.036 -0.047 0.028 -0.180 0.020 0.045 -0.026 0.025 0.012 -0.015 7 8 9 10 11 12 13 14 15 0.078 0.083 0.068 0.017 0.036 -0.041 0.031 0.036 -0.047 > 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/2a7xd1195813460.tab") > > system("convert tmp/1g7jo1195813459.ps tmp/1g7jo1195813459.png") > > > proc.time() user system elapsed 0.654 0.169 0.720