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 computationTue, 02 Dec 2008 12:28: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/t1228246191v34exg8h0dmdtff.htm/, Retrieved Fri, 17 May 2024 04:42:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=28228, Retrieved Fri, 17 May 2024 04:42:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact161
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [Cross Correlation Function] [Non stat time ser...] [2008-12-02 19:28:43] [c5d6d05aee6be5527ac4a30a8c3b8fe5] [Current]
Feedback Forum
2008-12-06 14:08:20 [Thomas Plasschaert] [reply
Met de cross correlatiefunctie kan men nagaan in hoeverre Y te verklaren valt door het verleden van X. X = totale productie van intermediaire goederen en Y= totale productie investeringsgoederen. 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)?
2008-12-08 13:46:06 [Katja van Hek] [reply
De cross correlation functie wordt gebruikt om het verband te zoeken tussen 2 variabelen, men wil dit uitzoeken aan de hand van de huidige waarde of de oude waardevan x. De k staat voor het aantal perioden dat er opgeschoven word. De correlatie tussen de variabelen stijgt hier naarmate men dichter bij 0 komt.
2008-12-08 16:51:43 [Jonas Janssens] [reply
Er is inderdaad een sterke correlatie tussen de 2 variabelen, omdat de correlatiecoëfficiënten bijna altijd positief zijn en buiten het 95% betrouwbaarheidsinterval liggen (=de verschillen zijn significant verschillend van nul en dus niet toe te schrijven aan het toeval).
2008-12-08 19:43:36 [5faab2fc6fb120339944528a32d48a04] [reply
Aan de hand van de cross correlation function kunnen we de graad schatten waarmee 2 reeksen gecorreleerd zijn. We kunnen kijken in hoeverre we Y kunnen voorspellen uit het verleden van X. X = totale productie van intermediaire goederen en Y= totale productie investeringsgoederen. 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. Wanneer k groter is dan 0 geeft het de correlatie weer tussen de toekomstige x en het heden van Y
2008-12-09 22:46:18 [Gert-Jan Geudens] [reply
We kunnen inderdaad yt verklaren aan de hand van het verleden en de toekomst van xt. In Q9 zullen we onderzoeken of we hier toch niet te maken hebben met een zogenaamde nonsenscorrelatie.

Post a new message
Dataseries X:
105,4
107,1
110,7
117,1
118,7
126,5
127,5
134,6
131,8
135,9
142,7
141,7
153,4
145
137,7
148,3
152,2
169,4
168,6
161,1
174,1
179
190,6
190
181,6
174,8
180,5
196,8
193,8
197
216,3
221,4
217,9
229,7
227,4
204,2
196,6
198,8
207,5
190,7
201,6
210,5
223,5
223,8
231,2
244
234,7
250,2
265,7
287,6
283,3
295,4
312,3
333,8
347,7
383,2
407,1
413,6
362,7
321,9
239,4
Dataseries Y:
109,1
111,4
114,1
121,8
127,6
129,9
128
123,5
124
127,4
127,6
128,4
131,4
135,1
134
144,5
147,3
150,9
148,7
141,4
138,9
139,8
145,6
147,9
148,5
151,1
157,5
167,5
172,3
173,5
187,5
205,5
195,1
204,5
204,5
201,7
207
206,6
210,6
211,1
215
223,9
238,2
238,9
229,6
232,2
222,1
221,6
227,3
221
213,6
243,4
253,8
265,3
268,2
268,5
266,9
268,4
250,8
231,2
192




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time14 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 14 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=28228&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]14 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=28228&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=28228&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 time14 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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.172904572009529
-130.208563705564303
-120.247459219924701
-110.29214376458578
-100.336872996800044
-90.379206680054228
-80.423112671894318
-70.469754646193741
-60.519970561620427
-50.574874613402607
-40.640074358426202
-30.711636708362213
-20.787675992827022
-10.856566721994158
00.90972043899777
10.894662195797469
20.860669880567116
30.811941584064153
40.757754523449314
50.698336817499927
60.642293913173273
70.591378558155632
80.552327588558932
90.523067723406485
100.506445969202953
110.49353426968391
120.474266344017049
130.45491471571945
140.428500907718814

\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.172904572009529 \tabularnewline
-13 & 0.208563705564303 \tabularnewline
-12 & 0.247459219924701 \tabularnewline
-11 & 0.29214376458578 \tabularnewline
-10 & 0.336872996800044 \tabularnewline
-9 & 0.379206680054228 \tabularnewline
-8 & 0.423112671894318 \tabularnewline
-7 & 0.469754646193741 \tabularnewline
-6 & 0.519970561620427 \tabularnewline
-5 & 0.574874613402607 \tabularnewline
-4 & 0.640074358426202 \tabularnewline
-3 & 0.711636708362213 \tabularnewline
-2 & 0.787675992827022 \tabularnewline
-1 & 0.856566721994158 \tabularnewline
0 & 0.90972043899777 \tabularnewline
1 & 0.894662195797469 \tabularnewline
2 & 0.860669880567116 \tabularnewline
3 & 0.811941584064153 \tabularnewline
4 & 0.757754523449314 \tabularnewline
5 & 0.698336817499927 \tabularnewline
6 & 0.642293913173273 \tabularnewline
7 & 0.591378558155632 \tabularnewline
8 & 0.552327588558932 \tabularnewline
9 & 0.523067723406485 \tabularnewline
10 & 0.506445969202953 \tabularnewline
11 & 0.49353426968391 \tabularnewline
12 & 0.474266344017049 \tabularnewline
13 & 0.45491471571945 \tabularnewline
14 & 0.428500907718814 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=28228&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.172904572009529[/C][/ROW]
[ROW][C]-13[/C][C]0.208563705564303[/C][/ROW]
[ROW][C]-12[/C][C]0.247459219924701[/C][/ROW]
[ROW][C]-11[/C][C]0.29214376458578[/C][/ROW]
[ROW][C]-10[/C][C]0.336872996800044[/C][/ROW]
[ROW][C]-9[/C][C]0.379206680054228[/C][/ROW]
[ROW][C]-8[/C][C]0.423112671894318[/C][/ROW]
[ROW][C]-7[/C][C]0.469754646193741[/C][/ROW]
[ROW][C]-6[/C][C]0.519970561620427[/C][/ROW]
[ROW][C]-5[/C][C]0.574874613402607[/C][/ROW]
[ROW][C]-4[/C][C]0.640074358426202[/C][/ROW]
[ROW][C]-3[/C][C]0.711636708362213[/C][/ROW]
[ROW][C]-2[/C][C]0.787675992827022[/C][/ROW]
[ROW][C]-1[/C][C]0.856566721994158[/C][/ROW]
[ROW][C]0[/C][C]0.90972043899777[/C][/ROW]
[ROW][C]1[/C][C]0.894662195797469[/C][/ROW]
[ROW][C]2[/C][C]0.860669880567116[/C][/ROW]
[ROW][C]3[/C][C]0.811941584064153[/C][/ROW]
[ROW][C]4[/C][C]0.757754523449314[/C][/ROW]
[ROW][C]5[/C][C]0.698336817499927[/C][/ROW]
[ROW][C]6[/C][C]0.642293913173273[/C][/ROW]
[ROW][C]7[/C][C]0.591378558155632[/C][/ROW]
[ROW][C]8[/C][C]0.552327588558932[/C][/ROW]
[ROW][C]9[/C][C]0.523067723406485[/C][/ROW]
[ROW][C]10[/C][C]0.506445969202953[/C][/ROW]
[ROW][C]11[/C][C]0.49353426968391[/C][/ROW]
[ROW][C]12[/C][C]0.474266344017049[/C][/ROW]
[ROW][C]13[/C][C]0.45491471571945[/C][/ROW]
[ROW][C]14[/C][C]0.428500907718814[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=28228&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=28228&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.172904572009529
-130.208563705564303
-120.247459219924701
-110.29214376458578
-100.336872996800044
-90.379206680054228
-80.423112671894318
-70.469754646193741
-60.519970561620427
-50.574874613402607
-40.640074358426202
-30.711636708362213
-20.787675992827022
-10.856566721994158
00.90972043899777
10.894662195797469
20.860669880567116
30.811941584064153
40.757754523449314
50.698336817499927
60.642293913173273
70.591378558155632
80.552327588558932
90.523067723406485
100.506445969202953
110.49353426968391
120.474266344017049
130.45491471571945
140.428500907718814



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')