R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(43880,43110,44496,44164,40399,36763,37903,35532,35533,32110,33374,35462,33508,36080,34560,38737,38144,37594,36424,36843,37246,38661,40454,44928,48441,48140,45998,47369,49554,47510,44873,45344,42413,36912,43452,42142,44382,43636,44167,44423,42868,43908,42013,38846,35087,33026,34646,37135,37985,43121,43722,43630,42234,39351,39327,35704,30466,28155,29257,29998,32529,34787,33855,34556,31348,30805,28353,24514,21106,21346,23335,24379,26290,30084,29429,30632,27349,27264,27474,24482,21453,18788,19282,19713,21917,23812,23785,24696,24562,23580,24939,23899,21454,19761,19815,20780,23462,25005,24725,26198,27543,26471,26558,25317,22896,22248,23406,25073,27691,30599,31948,32946,34012,32936,32974,30951,29812,29010,31068,32447,34844,35676,35387,36488,35652,33488,32914,29781,27951) > x <- c(211868,229527,229139,198563,195722,202196,205816,212588,214320,220375,204442,206903,214126,226899,223532,195309,186005,188906,191563,189226,186413,178037,166827,169362,174330,187069,186530,158114,151001,159612,161914,164182,169701,171297,166444,173476,182516,202388,202300,168053,167302,172608,178106,185686,194581,194596,197922,208795,230580,240636,240048,211457,211142,214771,212610,219313,219277,231805,229245,241114,248624,265845,256446,219452,217142,221678,227184,230354,235243,237217,233575,244460,243324,260307,241476,203666,200237,204045,209465,213586,216234,213188,208679,217859,227247,243477,232571,191531,186029,189733,190420,194163,198770,195198,193111,195411,202108,215706,206348,166972,166070,169292,175041,177876,181140,179566,175335,184128,189917,194690,179612,150605,150569,153745,155511,159044,163095,159585,158644,166618,176512,200765,182698,153730,156145,161570,165688,173666,180144) > par7 = '1' > par6 = '1' > 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: 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#output/ > #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] -4886 -2979 2353 -6463 -3573 -963 -9109 -4545 -14431 4723 [11] 74 -2255 -34 2828 -193 2191 5710 -355 4605 8332 [21] 9972 6357 4497 4072 7133 451 -5831 6362 -3305 3196 [31] 5312 3376 -1581 8179 3841 12745 -9816 -500 5656 436 [41] -1677 -7659 -877 -8931 12513 -5886 996 -14275 7165 -8811 [51] -8403 -1995 907 7667 -3533 4925 -10554 -1082 -984 -8646 [61] -238 -9432 -816 -1119 -728 -86 951 -2241 -5020 -867 [71] -1705 10524 -753 7925 -3230 -2073 -104 -4733 -378 1959 [81] -526 2422 -6880 -2691 -2632 1548 1664 4600 -482 5062 [91] -908 -1343 1998 -2144 6493 -908 -8825 -5720 10369 866 [101] -46 -3983 698 787 -1936 3290 -819 4105 19480 -2989 [111] 39 2451 2249 2352 4445 2427 > y [1] 3342 -2906 4509 3172 3086 -2310 2790 402 4838 529 2386 5467 [13] -2873 -622 -2806 2778 -1494 -1467 52 -3334 -6916 4747 -5784 -1273 [25] -445 2673 -1115 -3740 3084 742 -3638 -828 3440 -4920 3799 -1390 [37] 5882 70 -348 159 -3923 1871 -456 -1479 -250 -518 -1748 1681 [49] -2878 -1533 793 -1812 2340 -2428 -216 1830 2551 887 303 -620 [61] 1536 277 502 -75 458 2662 847 379 -2905 -1495 -613 293 [73] -1899 628 -292 3149 -897 1149 1952 584 972 -440 534 478 [85] -352 -253 562 1479 -90 -1272 -201 24 1045 1104 702 -64 [97] 1365 1629 -475 -279 -4 -49 -782 1282 -154 900 -288 -221 [109] -2076 -1638 103 -1902 -1088 -612 -1110 -691 > postscript(file="/var/www/rcomp/tmp/10hvr1291970766.ps",horizontal=F,onefile=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 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 0.010 0.083 -0.068 0.069 -0.051 0.249 -0.055 -0.089 -0.016 0.003 -0.053 -6 -5 -4 -3 -2 -1 0 1 2 3 4 -0.027 -0.074 -0.067 -0.160 -0.066 -0.017 -0.369 -0.009 -0.166 0.000 -0.271 5 6 7 8 9 10 11 12 13 14 15 -0.109 0.042 -0.034 0.027 -0.026 0.195 -0.127 0.217 -0.091 0.207 -0.156 16 17 0.247 0.083 > dev.off() null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/2p0al1291970766.tab") > > try(system("convert tmp/10hvr1291970766.ps tmp/10hvr1291970766.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.450 0.230 0.661