Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_cross.wasp
Title produced by softwareCross Correlation Function
Date of computationMon, 01 Dec 2008 10:48:05 -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/01/t1228153816yl6701cw3ofantg.htm/, Retrieved Sun, 05 May 2024 14:24:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27061, Retrieved Sun, 05 May 2024 14:24:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact261
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  [(Partial) Autocorrelation Function] [vraag 6] [2008-11-29 14:36:13] [c45c87b96bbf32ffc2144fc37d767b2e]
-   P     [(Partial) Autocorrelation Function] [vraag 6] [2008-11-29 14:47:29] [c45c87b96bbf32ffc2144fc37d767b2e]
- RMP       [Variance Reduction Matrix] [vraag 6] [2008-11-29 14:53:24] [c45c87b96bbf32ffc2144fc37d767b2e]
- RMP         [Spectral Analysis] [vraag 6] [2008-11-29 15:02:46] [c45c87b96bbf32ffc2144fc37d767b2e]
F RMPD            [Cross Correlation Function] [Q7] [2008-12-01 17:48:05] [366411ff82333cf2a466cacd3525c11d] [Current]
Feedback Forum
2008-12-03 17:03:20 [Ken Van den Heuvel] [reply
Mijn interpretatie van deze gegevens was verkeerd.
CCF geeft de mate van voorspellen weer van een reeks adhv het verleden van een andere reeks.

Zo zien we bij k=0 dat de correlatie tussen bijde reeksen 66% is, we kunnen dus een hoge mate van voorspelbaarheid verwachten.
Kijken we naar de andere data dan lijkt dit te kloppen. Bij lag=1 zien we dat we reeks Y kunnen verklaren voor 53% met de data van reeks X (1 periode vooruit verschoven). Omgekeerd zien we dat bij lag=-1 36% van Y kan verklaard worden door X (1 periode in het verleden verschoven).
2008-12-07 21:26:39 [Jeroen Aerts] [reply
De CCF geeft de mate van voorspellen weer van een reeks adhv het verleden van een andere reeks.

Bij k=0 is de correlatie 66%, hier is dus een hoge voorspelbaarheidsgraad.

Bij lag=1 is er 53% te voorspellen ( verschuiving van 1 periode)
2008-12-08 08:21:20 [Jonas De Kinder] [reply
bij de CCF kunnen we het heden voorspellen van een reeks aan de hand van een andere reeks en vice versa. door de CCF toe te passen ga je alle nonsens correlatie eruit halen want vele tijdreeksen hebben wel een positieve correlatie maar deze is niet relevant. door de tijdreeks stationair te maken ga je alle nonsens correlatie eruit halen en verkrijg je zuivere correlatie gegevens.

Bij k=0 is de correlatie 66%, hier is dus een hoge voorspelbaarheidsgraad.

Bij lag=1 is er 53% te voorspellen ( verschuiving van 1 periode)
2008-12-08 12:25:14 [Ellen Smolders] [reply
De student interpreteert de cross correlatie functie verkeerd. Met deze software berekenen we de correlatie tussen twee tijdreeksen waarbij één tijdreeks in een periode verschuift.
2008-12-08 13:48:08 [Bas van Keken] [reply
De CCF produceert een voorspelling van een datareeks adhv het verleden van de reeks. De interpretatie (zoals gevraagd) kan gedaan worden door de waarden af te lezen bij toevoeging bij X (in funcie van tijd) met een bepaalde periode in de formule rho(Y[t],X[t+k]),(bijvoorbeeld K= -1 en +1). De waarden die volgen zijn bovengenoemde waarden.
2008-12-08 16:04:32 [Mehmet Yilmaz] [reply
Aangezien we bij k=0 een hoge correlatiewaarde van 66% vinden tussen de 2 reeksen is er een hoge mate van voorspelbaarheid.
2008-12-08 16:59:44 [Jeroen Michel] [reply
De conclusie van de student was inderdaad verkeerd. Je hebt je nadien wel goed verbeterd. Deze functie dient inderdaad om aan de hand van een andere variabele een voorspelling te kunnen maken over de toekomst.

De tijdreeks maakt met andere woorden een sprong in de toekomst (lags). Per lag is er een verschuiving van 1 periode.

Bij k=0 een hoge correlatiewaarde van 66% vinden tussen de 2 reeksen is er een hoge mate van voorspelbaarheid.
2008-12-08 19:22:40 [Davy De Nef] [reply
Bij de cross correlation function komt het erop neer dat we de mate zoeken waarin we de ene reeks kunnen voorspellen, door gebruik te maken van het verleden van de andere reeks.

Bij het aantal lags zien we hoeveel perioden er verschoven wordt. Naarmate de periode verschilt waarmee men vergelijkt, verschilt ook de betrouwbaarheid/de mate van voorspelling.

bij k=0 zien we een voorspelling van 66%.
2008-12-08 22:57:46 [Kristof Augustyns] [reply
Berekening is hier juist, maar conclusie niet.
Deze functie dient om aan de hand van andere variabelen een voorspelling te maken over de toekomst.
Zo maakt men een sprong in de toekomst.
k=0 --> voorspellende correlatiewaarde van 66%.

Post a new message
Dataseries X:
86,7
87,9
89,8
103
102,7
156,3
95
84,6
106,5
98,7
103,5
110,7
96,2
89,2
97,1
104,8
132,5
154,8
83,6
82,4
103,9
87
93,2
110,5
96,4
76,3
94
103,4
137
150,1
112,6
81,4
113,6
99,6
98,2
118,6
86,8
79,3
98,4
93,6
101
161,2
92,5
99,8
104,1
90,2
99,2
116,5
98,4
90,6
130,5
107,4
106
196,5
107,8
90,5
123,8
114,7
115,3
197
88,4
93,8
111,3
105,9
123,6
171
97
99,2
126,6
103,4
121,3
129,6
110,8
98,9
122,8
120,9
133,1
203,1
110,2
119,5
135,1
113,9
137,4
157,1
126,4
112,2
128,8
136,8
156,5
215,2
146,7
130,8
133,1
154,4
160,4
175,1
145,3
Dataseries Y:
83,1
89,6
105,7
110,7
110,4
109
106
100,9
114,3
101,2
109,2
111,6
91,7
93,7
105,7
109,5
105,3
102,8
100,6
97,6
110,3
107,2
107,2
108,1
97,1
92,2
112,2
111,6
115,7
111,3
104,2
103,2
112,7
106,4
102,6
110,6
95,2
89
112,5
116,8
107,2
113,6
101,8
102,6
122,7
110,3
110,5
121,6
100,3
100,7
123,4
127,1
124,1
131,2
111,6
114,2
130,1
125,9
119
133,8
107,5
113,5
134,4
126,8
135,6
139,9
129,8
131
153,1
134,1
144,1
155,9
123,3
128,1
144,3
153
149,9
150,9
141
138,9
157,4
142,9
151,7
161
138,5
135,9
151,5
164
159,1
157
142,1
144,8
152,1
154,6
148,7
157,7
146,7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 1 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27061&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27061&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27061&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 time1 seconds
R Server'George Udny Yule' @ 72.249.76.132







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)1
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])
-160.195569907112048
-150.269376163305547
-140.0921764410619702
-130.157901813655699
-120.419553027041836
-110.319710912101100
-100.276698892567455
-90.319438530613931
-80.116445425982059
-70.221776977870484
-60.515299727259489
-50.387732821273774
-40.35825984806366
-30.485604267827267
-20.269390894400781
-10.367321667765403
00.66111513754993
10.537697758692074
20.51134738484756
30.478234659284669
40.234669576796665
50.280474282507577
60.615054630385768
70.463763104095503
80.412199977256835
90.482168006556177
100.227821160778078
110.283121843940302
120.513542013245625
130.403651574521368
140.347985295564175
150.349107060657401
160.0892798853796267

\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) & 1 \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
-16 & 0.195569907112048 \tabularnewline
-15 & 0.269376163305547 \tabularnewline
-14 & 0.0921764410619702 \tabularnewline
-13 & 0.157901813655699 \tabularnewline
-12 & 0.419553027041836 \tabularnewline
-11 & 0.319710912101100 \tabularnewline
-10 & 0.276698892567455 \tabularnewline
-9 & 0.319438530613931 \tabularnewline
-8 & 0.116445425982059 \tabularnewline
-7 & 0.221776977870484 \tabularnewline
-6 & 0.515299727259489 \tabularnewline
-5 & 0.387732821273774 \tabularnewline
-4 & 0.35825984806366 \tabularnewline
-3 & 0.485604267827267 \tabularnewline
-2 & 0.269390894400781 \tabularnewline
-1 & 0.367321667765403 \tabularnewline
0 & 0.66111513754993 \tabularnewline
1 & 0.537697758692074 \tabularnewline
2 & 0.51134738484756 \tabularnewline
3 & 0.478234659284669 \tabularnewline
4 & 0.234669576796665 \tabularnewline
5 & 0.280474282507577 \tabularnewline
6 & 0.615054630385768 \tabularnewline
7 & 0.463763104095503 \tabularnewline
8 & 0.412199977256835 \tabularnewline
9 & 0.482168006556177 \tabularnewline
10 & 0.227821160778078 \tabularnewline
11 & 0.283121843940302 \tabularnewline
12 & 0.513542013245625 \tabularnewline
13 & 0.403651574521368 \tabularnewline
14 & 0.347985295564175 \tabularnewline
15 & 0.349107060657401 \tabularnewline
16 & 0.0892798853796267 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27061&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]1[/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]-16[/C][C]0.195569907112048[/C][/ROW]
[ROW][C]-15[/C][C]0.269376163305547[/C][/ROW]
[ROW][C]-14[/C][C]0.0921764410619702[/C][/ROW]
[ROW][C]-13[/C][C]0.157901813655699[/C][/ROW]
[ROW][C]-12[/C][C]0.419553027041836[/C][/ROW]
[ROW][C]-11[/C][C]0.319710912101100[/C][/ROW]
[ROW][C]-10[/C][C]0.276698892567455[/C][/ROW]
[ROW][C]-9[/C][C]0.319438530613931[/C][/ROW]
[ROW][C]-8[/C][C]0.116445425982059[/C][/ROW]
[ROW][C]-7[/C][C]0.221776977870484[/C][/ROW]
[ROW][C]-6[/C][C]0.515299727259489[/C][/ROW]
[ROW][C]-5[/C][C]0.387732821273774[/C][/ROW]
[ROW][C]-4[/C][C]0.35825984806366[/C][/ROW]
[ROW][C]-3[/C][C]0.485604267827267[/C][/ROW]
[ROW][C]-2[/C][C]0.269390894400781[/C][/ROW]
[ROW][C]-1[/C][C]0.367321667765403[/C][/ROW]
[ROW][C]0[/C][C]0.66111513754993[/C][/ROW]
[ROW][C]1[/C][C]0.537697758692074[/C][/ROW]
[ROW][C]2[/C][C]0.51134738484756[/C][/ROW]
[ROW][C]3[/C][C]0.478234659284669[/C][/ROW]
[ROW][C]4[/C][C]0.234669576796665[/C][/ROW]
[ROW][C]5[/C][C]0.280474282507577[/C][/ROW]
[ROW][C]6[/C][C]0.615054630385768[/C][/ROW]
[ROW][C]7[/C][C]0.463763104095503[/C][/ROW]
[ROW][C]8[/C][C]0.412199977256835[/C][/ROW]
[ROW][C]9[/C][C]0.482168006556177[/C][/ROW]
[ROW][C]10[/C][C]0.227821160778078[/C][/ROW]
[ROW][C]11[/C][C]0.283121843940302[/C][/ROW]
[ROW][C]12[/C][C]0.513542013245625[/C][/ROW]
[ROW][C]13[/C][C]0.403651574521368[/C][/ROW]
[ROW][C]14[/C][C]0.347985295564175[/C][/ROW]
[ROW][C]15[/C][C]0.349107060657401[/C][/ROW]
[ROW][C]16[/C][C]0.0892798853796267[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27061&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27061&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)1
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])
-160.195569907112048
-150.269376163305547
-140.0921764410619702
-130.157901813655699
-120.419553027041836
-110.319710912101100
-100.276698892567455
-90.319438530613931
-80.116445425982059
-70.221776977870484
-60.515299727259489
-50.387732821273774
-40.35825984806366
-30.485604267827267
-20.269390894400781
-10.367321667765403
00.66111513754993
10.537697758692074
20.51134738484756
30.478234659284669
40.234669576796665
50.280474282507577
60.615054630385768
70.463763104095503
80.412199977256835
90.482168006556177
100.227821160778078
110.283121843940302
120.513542013245625
130.403651574521368
140.347985295564175
150.349107060657401
160.0892798853796267



Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 0 ; par7 = 0 ;
Parameters (R input):
par1 = 1 ; par2 = 0 ; par3 = 0 ; par4 = 1 ; 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')