Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_cross.wasp
Title produced by softwareCross Correlation Function
Date of computationTue, 02 Dec 2008 06:34:43 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Dec/02/t12282250652s4xmr0xnfw995e.htm/, Retrieved Sun, 19 May 2024 09:26:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27764, Retrieved Sun, 19 May 2024 09:26:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact216
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [Airline data] [2007-10-18 09:58:47] [42daae401fd3def69a25014f2252b4c2]
F RMPD  [Spectral Analysis] [q6] [2008-12-02 13:19:49] [74be16979710d4c4e7c6647856088456]
F RMPD      [Cross Correlation Function] [q7] [2008-12-02 13:34:43] [074508d5a5a3592082de3e836d27af7d] [Current]
F   PD        [Cross Correlation Function] [q8] [2008-12-02 13:49:39] [7ab42b4673454531c59df48fbb842b60]
F RM D          [Variance Reduction Matrix] [q8] [2008-12-02 13:55:29] [7ab42b4673454531c59df48fbb842b60]
- RMP             [Standard Deviation-Mean Plot] [q9] [2008-12-07 11:33:42] [1b742211e88d1643c42c5773474321b2]
F RM D          [Variance Reduction Matrix] [q8] [2008-12-02 13:58:13] [7ab42b4673454531c59df48fbb842b60]
- RMP             [Standard Deviation-Mean Plot] [q9] [2008-12-07 11:28:49] [1b742211e88d1643c42c5773474321b2]
Feedback Forum
2008-12-07 21:04:13 [Jasmine Hendrikx] [reply
Evaluatie Q7:
De berekening is correct uitgevoerd. De conclusie zou wel iets uitgebreider mogen zijn. Zo geeft de cross correlation function de correlatie weer tussen verschillende variabelen. Je gaat je afvragen op basis waarvan je Yt kan voorspellen. Misschien kunnen huidige waarden, verleden waarden of toekomstige waarden van Xt een hulp zijn voor het voorspellen van Yt. Er is dus duidelijk een verschil met de autocorrelatie. Bij autocorrelatie ga je de correlatie berekenen tussen Xt en Xt-1, tussen Xt en Xt-2,.. Autocorrelatie is dus de mate waarin Xt voorspeld kan worden op basis van zijn eigen verleden.
De laatste kolom van de tabel geeft de correlatie weer tussen Yt en Xt+k.
X t+k is dus verschoven in de tijd. Het getal in de eerste kolom is k. De correlatie tussen Yt en Xt-9 is bijvoorbeeld gelijk aan 0.75. Wanneer k=0, betekent dit dat je de correlatie zult krijgen tussen Yt en Xt zonder verschuiving in de tijd. De eerste reeks coëfficiënten (k loopt dan van -14 tot 0), vertellen iets over de correlatie tussen het verleden van Xt en Yt. Je kijkt of Xt een leading indicator is of niet, of dat Xt een indicator is die je op voorhand informatie geeft over het verloop van Yt. Bij de tweede reeks coëfficiënten wordt k positief, je gaat hier dan kijken naar het verband tussen de toekomst van Xt en de huidige waarde van Yt.
Wat betreft de grafiek, zou er nog het volgende vermeld kunnen worden.
De 2 stippellijnen in de grafiek geven het betrouwbaarheidsinterval weer. We zien dat veel verticale lijntjes significant verschillend zijn van 0. Je zou dus kunnen zeggen dat zowel het verleden als de toekomst van X(t) toelaat om Y(t) gedeeltelijk te voorspellen. Maar hoe verder we in de toekomst kijken, hoe minder dit het geval is (hier zijn de coëfficiënten niet meer significant verschillend van 0). Ook vermeldt de student dat er sprake is van een trendmatig verloop, maar bij cross correlatie kijken we niet naar trends en kijken we ook niet hoe iets gedifferentieerd moet worden.
2008-12-08 19:36:57 [Koen Van Baelen] [reply
Er ontbreekt heel wat bij de conclusie. Met de cross correlatiefunctie kan men nagaan in hoeverre Y te verklaren valt door het verleden van X.rho(Y[t],X[t+k]) geeft de correlatie aan tussen het verleden van X en het heden van Y wanneer k kleiner is dan 0. (is er sprake van een leading indicator?) Wanneer k groter is dan 0 geeft het de correlatie weer tussen de toekomstige x en het heden van Y (is er sprake van een lagging indicator)? Hier kan men dus ook zeggen dat het verleden van X iets zegt over de toekomst van Y en dat het verleden van Y ook iets zegt over de toekomst van X

Post a new message
Dataseries X:
2174,56
2196,72
2350,44
2440,25
2408,64
2472,81
2407,6
2454,62
2448,05
2497,84
2645,64
2756,76
2849,27
2921,44
2981,85
3080,58
3106,22
3119,31
3061,26
3097,31
3161,69
3257,16
3277,01
3295,32
3363,99
3494,17
3667,03
3813,06
3917,96
3895,51
3801,06
3570,12
3701,61
3862,27
3970,1
4138,52
4199,75
4290,89
4443,91
4502,64
4356,98
4591,27
4696,96
4621,4
4562,84
4202,52
4296,49
4435,23
4105,18
4116,68
3844,49
3720,98
3674,4
3857,62
3801,06
3504,37
3032,6
3047,03
2962,34
Dataseries Y:
9762,12
10124,63
10540,05
10601,61
10323,73
10418,4
10092,96
10364,91
10152,09
10032,8
10204,59
10001,6
10411,75
10673,38
10539,51
10723,78
10682,06
10283,19
10377,18
10486,64
10545,38
10554,27
10532,54
10324,31
10695,25
10827,81
10872,48
10971,19
11145,65
11234,68
11333,88
10997,97
11036,89
11257,35
11533,59
11963,12
12185,15
12377,62
12512,89
12631,48
12268,53
12754,8
13407,75
13480,21
13673,28
13239,71
13557,69
13901,28
13200,58
13406,97
12538,12
12419,57
12193,88
12656,63
12812,48
12056,67
11322,38
11530,75
11114,08




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27764&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27764&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27764&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







Cross Correlation Function
ParameterValue
Box-Cox transformation parameter (lambda) of X series1
Degree of non-seasonal differencing (d) of X series0
Degree of seasonal differencing (D) of X series0
Seasonal Period (s)12
Box-Cox transformation parameter (lambda) of Y series1
Degree of non-seasonal differencing (d) of Y series0
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-140.493520136028247
-130.538583367468546
-120.589161162465004
-110.649563158087072
-100.701105292734257
-90.745454433833246
-80.789226375908616
-70.817712168109428
-60.845689047836314
-50.859493304334156
-40.862748303701203
-30.859554167832855
-20.856735319741343
-10.85827145038896
00.863658059708989
10.776645716367817
20.68995403119887
30.607223891863751
40.539218136750566
50.478112136682482
60.408200488884973
70.326033513888888
80.249485057760158
90.166320206952501
100.100644627163653
110.0402965881518691
12-0.0121801879012895
13-0.0639531194002896
14-0.112529697418312

\begin{tabular}{lllllllll}
\hline
Cross Correlation Function \tabularnewline
Parameter & Value \tabularnewline
Box-Cox transformation parameter (lambda) of X series & 1 \tabularnewline
Degree of non-seasonal differencing (d) of X series & 0 \tabularnewline
Degree of seasonal differencing (D) of X series & 0 \tabularnewline
Seasonal Period (s) & 12 \tabularnewline
Box-Cox transformation parameter (lambda) of Y series & 1 \tabularnewline
Degree of non-seasonal differencing (d) of Y series & 0 \tabularnewline
Degree of seasonal differencing (D) of Y series & 0 \tabularnewline
k & rho(Y[t],X[t+k]) \tabularnewline
-14 & 0.493520136028247 \tabularnewline
-13 & 0.538583367468546 \tabularnewline
-12 & 0.589161162465004 \tabularnewline
-11 & 0.649563158087072 \tabularnewline
-10 & 0.701105292734257 \tabularnewline
-9 & 0.745454433833246 \tabularnewline
-8 & 0.789226375908616 \tabularnewline
-7 & 0.817712168109428 \tabularnewline
-6 & 0.845689047836314 \tabularnewline
-5 & 0.859493304334156 \tabularnewline
-4 & 0.862748303701203 \tabularnewline
-3 & 0.859554167832855 \tabularnewline
-2 & 0.856735319741343 \tabularnewline
-1 & 0.85827145038896 \tabularnewline
0 & 0.863658059708989 \tabularnewline
1 & 0.776645716367817 \tabularnewline
2 & 0.68995403119887 \tabularnewline
3 & 0.607223891863751 \tabularnewline
4 & 0.539218136750566 \tabularnewline
5 & 0.478112136682482 \tabularnewline
6 & 0.408200488884973 \tabularnewline
7 & 0.326033513888888 \tabularnewline
8 & 0.249485057760158 \tabularnewline
9 & 0.166320206952501 \tabularnewline
10 & 0.100644627163653 \tabularnewline
11 & 0.0402965881518691 \tabularnewline
12 & -0.0121801879012895 \tabularnewline
13 & -0.0639531194002896 \tabularnewline
14 & -0.112529697418312 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27764&T=1

[TABLE]
[ROW][C]Cross Correlation Function[/C][/ROW]
[ROW][C]Parameter[/C][C]Value[/C][/ROW]
[ROW][C]Box-Cox transformation parameter (lambda) of X series[/C][C]1[/C][/ROW]
[ROW][C]Degree of non-seasonal differencing (d) of X series[/C][C]0[/C][/ROW]
[ROW][C]Degree of seasonal differencing (D) of X series[/C][C]0[/C][/ROW]
[ROW][C]Seasonal Period (s)[/C][C]12[/C][/ROW]
[ROW][C]Box-Cox transformation parameter (lambda) of Y series[/C][C]1[/C][/ROW]
[ROW][C]Degree of non-seasonal differencing (d) of Y series[/C][C]0[/C][/ROW]
[ROW][C]Degree of seasonal differencing (D) of Y series[/C][C]0[/C][/ROW]
[ROW][C]k[/C][C]rho(Y[t],X[t+k])[/C][/ROW]
[ROW][C]-14[/C][C]0.493520136028247[/C][/ROW]
[ROW][C]-13[/C][C]0.538583367468546[/C][/ROW]
[ROW][C]-12[/C][C]0.589161162465004[/C][/ROW]
[ROW][C]-11[/C][C]0.649563158087072[/C][/ROW]
[ROW][C]-10[/C][C]0.701105292734257[/C][/ROW]
[ROW][C]-9[/C][C]0.745454433833246[/C][/ROW]
[ROW][C]-8[/C][C]0.789226375908616[/C][/ROW]
[ROW][C]-7[/C][C]0.817712168109428[/C][/ROW]
[ROW][C]-6[/C][C]0.845689047836314[/C][/ROW]
[ROW][C]-5[/C][C]0.859493304334156[/C][/ROW]
[ROW][C]-4[/C][C]0.862748303701203[/C][/ROW]
[ROW][C]-3[/C][C]0.859554167832855[/C][/ROW]
[ROW][C]-2[/C][C]0.856735319741343[/C][/ROW]
[ROW][C]-1[/C][C]0.85827145038896[/C][/ROW]
[ROW][C]0[/C][C]0.863658059708989[/C][/ROW]
[ROW][C]1[/C][C]0.776645716367817[/C][/ROW]
[ROW][C]2[/C][C]0.68995403119887[/C][/ROW]
[ROW][C]3[/C][C]0.607223891863751[/C][/ROW]
[ROW][C]4[/C][C]0.539218136750566[/C][/ROW]
[ROW][C]5[/C][C]0.478112136682482[/C][/ROW]
[ROW][C]6[/C][C]0.408200488884973[/C][/ROW]
[ROW][C]7[/C][C]0.326033513888888[/C][/ROW]
[ROW][C]8[/C][C]0.249485057760158[/C][/ROW]
[ROW][C]9[/C][C]0.166320206952501[/C][/ROW]
[ROW][C]10[/C][C]0.100644627163653[/C][/ROW]
[ROW][C]11[/C][C]0.0402965881518691[/C][/ROW]
[ROW][C]12[/C][C]-0.0121801879012895[/C][/ROW]
[ROW][C]13[/C][C]-0.0639531194002896[/C][/ROW]
[ROW][C]14[/C][C]-0.112529697418312[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27764&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27764&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Cross Correlation Function
ParameterValue
Box-Cox transformation parameter (lambda) of X series1
Degree of non-seasonal differencing (d) of X series0
Degree of seasonal differencing (D) of X series0
Seasonal Period (s)12
Box-Cox transformation parameter (lambda) of Y series1
Degree of non-seasonal differencing (d) of Y series0
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-140.493520136028247
-130.538583367468546
-120.589161162465004
-110.649563158087072
-100.701105292734257
-90.745454433833246
-80.789226375908616
-70.817712168109428
-60.845689047836314
-50.859493304334156
-40.862748303701203
-30.859554167832855
-20.856735319741343
-10.85827145038896
00.863658059708989
10.776645716367817
20.68995403119887
30.607223891863751
40.539218136750566
50.478112136682482
60.408200488884973
70.326033513888888
80.249485057760158
90.166320206952501
100.100644627163653
110.0402965881518691
12-0.0121801879012895
13-0.0639531194002896
14-0.112529697418312



Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 12 ; par5 = 1 ; par6 = 0 ; par7 = 0 ;
Parameters (R input):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 12 ; par5 = 1 ; par6 = 0 ; par7 = 0 ;
R code (references can be found in the software module):
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
y
bitmap(file='test1.png')
(r <- ccf(x,y,main='Cross Correlation Function',ylab='CCF',xlab='Lag (k)'))
dev.off()
load(file='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='mytable.tab')