Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_cross.wasp
Title produced by softwareCross Correlation Function
Date of computationMon, 01 Dec 2008 11:25:17 -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/t1228156020iow2bt7w8ucv656.htm/, Retrieved Sun, 05 May 2024 09:34:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27097, Retrieved Sun, 05 May 2024 09:34:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsq7
Estimated Impact231
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [Cross Correlation Function] [cross correlation...] [2008-12-01 18:25:17] [e4c7d76df262b0a2d80dba01c6bb2cb8] [Current]
-   P     [Cross Correlation Function] [cross correlation...] [2008-12-01 18:49:25] [592f2eec6ad66b41308d6ae6d607599a]
-   PD      [Cross Correlation Function] [Verbetering Q9] [2008-12-08 15:34:52] [2bd2ad6af3eef3a703e9ec23e39bd695]
-   PD    [Cross Correlation Function] [Verbetering Q7] [2008-12-08 15:33:08] [2bd2ad6af3eef3a703e9ec23e39bd695]
Feedback Forum
2008-12-07 10:34:01 [Glenn De Maeyer] [reply
De crosscorrelatie kan niet vergeleken worden met de autocorrelatie. Autocorrelatie gaat proberen een voorspelling van een tijdreeks (vb.Yt) te doen aan de hand van zijn eigen verleden. De crosscorrelatie gaat proberen een voorspelling te doen van een tijdreeks (vb. Yt) aan de hand van het verleden van een andere variabele (vb.Xt).

In de tabel zien we:

k=0 => dit is gewoon de correlatie tussen Yt en Xt. Dit resultaat is wat je dus ook zou krijgen als je gewoon de correlatie zou berekenen.

k=-1 => de correlatie tussen Yt en Xt-1 (verleden)

K=+1 => de correlatie tussen yt en Xt+1 (toekomst)

We merken bij de grafiek van de cross correlatie functie in de links helft op dat we allemaal significante positieve correlatie hebben. Dit houdt in dat we de tijdreeks Yt kunnen voorspellen op basis van het verleden van X (=Xt-1).
Na k=0 zien we een daling. We kunnen dus de tijdreeks Yt niet goed voorspellen op basis van de toekomstige evolutie van Xt (= Xt+1)
2008-12-08 16:50:03 [Mehmet Yilmaz] [reply
Correct.

Post a new message
Dataseries X:
0,9383
0,9217
0,9095
0,892
0,8742
0,8532
0,8607
0,9005
0,9111
0,9059
0,8883
0,8924
0,8833
0,87
0,8758
0,8858
0,917
0,9554
0,9922
0,9778
0,9808
0,9811
1,0014
1,0183
1,0622
1,0773
1,0807
1,0848
1,1582
1,1663
1,1372
1,1139
1,1222
1,1692
1,1702
1,2286
1,2613
1,2646
1,2262
1,1985
1,2007
1,2138
1,2266
1,2176
1,2218
1,249
1,2991
1,3408
1,3119
1,3014
1,3201
1,2938
1,2694
1,2165
1,2037
1,2292
1,2256
1,2015
1,1786
1,1856
1,2103
1,1938
1,202
1,2271
1,277
1,265
1,2684
1,2811
1,2727
1,2611
1,2881
1,3213
Dataseries Y:
90,8
96,4
90
92,1
97,2
95,1
88,5
91
90,5
75
66,3
66
68,4
70,6
83,9
90,1
90,6
87,1
90,8
94,1
99,8
96,8
87
96,3
107,1
115,2
106,1
89,5
91,3
97,6
100,7
104,6
94,7
101,8
102,5
105,3
110,3
109,8
117,3
118,8
131,3
125,9
133,1
147
145,8
164,4
149,8
137,7
151,7
156,8
180
180,4
170,4
191,6
199,5
218,2
217,5
205
194
199,3
219,3
211,1
215,2
240,2
242,2
240,7
255,4
253
218,2
203,7
205,6
215,6




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=27097&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=27097&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27097&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)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])
-150.687096762778538
-140.689383417172903
-130.69120934201659
-120.69342586735057
-110.700858456875403
-100.710428665293474
-90.719909857913917
-80.726801148958226
-70.732644420274327
-60.73120525044389
-50.728846623184957
-40.728578949736867
-30.72909991006576
-20.724575603070605
-10.727100445810163
00.736049692727718
10.701113847961934
20.667455992362463
30.634311812523181
40.598222474793139
50.542340329321173
60.481738269371594
70.429696741963482
80.378407885764823
90.331130281569963
100.292707350175207
110.250015250590003
120.200500712399168
130.154318623166057
140.110939806716221
150.0653870690323747

\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
-15 & 0.687096762778538 \tabularnewline
-14 & 0.689383417172903 \tabularnewline
-13 & 0.69120934201659 \tabularnewline
-12 & 0.69342586735057 \tabularnewline
-11 & 0.700858456875403 \tabularnewline
-10 & 0.710428665293474 \tabularnewline
-9 & 0.719909857913917 \tabularnewline
-8 & 0.726801148958226 \tabularnewline
-7 & 0.732644420274327 \tabularnewline
-6 & 0.73120525044389 \tabularnewline
-5 & 0.728846623184957 \tabularnewline
-4 & 0.728578949736867 \tabularnewline
-3 & 0.72909991006576 \tabularnewline
-2 & 0.724575603070605 \tabularnewline
-1 & 0.727100445810163 \tabularnewline
0 & 0.736049692727718 \tabularnewline
1 & 0.701113847961934 \tabularnewline
2 & 0.667455992362463 \tabularnewline
3 & 0.634311812523181 \tabularnewline
4 & 0.598222474793139 \tabularnewline
5 & 0.542340329321173 \tabularnewline
6 & 0.481738269371594 \tabularnewline
7 & 0.429696741963482 \tabularnewline
8 & 0.378407885764823 \tabularnewline
9 & 0.331130281569963 \tabularnewline
10 & 0.292707350175207 \tabularnewline
11 & 0.250015250590003 \tabularnewline
12 & 0.200500712399168 \tabularnewline
13 & 0.154318623166057 \tabularnewline
14 & 0.110939806716221 \tabularnewline
15 & 0.0653870690323747 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27097&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]-15[/C][C]0.687096762778538[/C][/ROW]
[ROW][C]-14[/C][C]0.689383417172903[/C][/ROW]
[ROW][C]-13[/C][C]0.69120934201659[/C][/ROW]
[ROW][C]-12[/C][C]0.69342586735057[/C][/ROW]
[ROW][C]-11[/C][C]0.700858456875403[/C][/ROW]
[ROW][C]-10[/C][C]0.710428665293474[/C][/ROW]
[ROW][C]-9[/C][C]0.719909857913917[/C][/ROW]
[ROW][C]-8[/C][C]0.726801148958226[/C][/ROW]
[ROW][C]-7[/C][C]0.732644420274327[/C][/ROW]
[ROW][C]-6[/C][C]0.73120525044389[/C][/ROW]
[ROW][C]-5[/C][C]0.728846623184957[/C][/ROW]
[ROW][C]-4[/C][C]0.728578949736867[/C][/ROW]
[ROW][C]-3[/C][C]0.72909991006576[/C][/ROW]
[ROW][C]-2[/C][C]0.724575603070605[/C][/ROW]
[ROW][C]-1[/C][C]0.727100445810163[/C][/ROW]
[ROW][C]0[/C][C]0.736049692727718[/C][/ROW]
[ROW][C]1[/C][C]0.701113847961934[/C][/ROW]
[ROW][C]2[/C][C]0.667455992362463[/C][/ROW]
[ROW][C]3[/C][C]0.634311812523181[/C][/ROW]
[ROW][C]4[/C][C]0.598222474793139[/C][/ROW]
[ROW][C]5[/C][C]0.542340329321173[/C][/ROW]
[ROW][C]6[/C][C]0.481738269371594[/C][/ROW]
[ROW][C]7[/C][C]0.429696741963482[/C][/ROW]
[ROW][C]8[/C][C]0.378407885764823[/C][/ROW]
[ROW][C]9[/C][C]0.331130281569963[/C][/ROW]
[ROW][C]10[/C][C]0.292707350175207[/C][/ROW]
[ROW][C]11[/C][C]0.250015250590003[/C][/ROW]
[ROW][C]12[/C][C]0.200500712399168[/C][/ROW]
[ROW][C]13[/C][C]0.154318623166057[/C][/ROW]
[ROW][C]14[/C][C]0.110939806716221[/C][/ROW]
[ROW][C]15[/C][C]0.0653870690323747[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27097&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27097&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])
-150.687096762778538
-140.689383417172903
-130.69120934201659
-120.69342586735057
-110.700858456875403
-100.710428665293474
-90.719909857913917
-80.726801148958226
-70.732644420274327
-60.73120525044389
-50.728846623184957
-40.728578949736867
-30.72909991006576
-20.724575603070605
-10.727100445810163
00.736049692727718
10.701113847961934
20.667455992362463
30.634311812523181
40.598222474793139
50.542340329321173
60.481738269371594
70.429696741963482
80.378407885764823
90.331130281569963
100.292707350175207
110.250015250590003
120.200500712399168
130.154318623166057
140.110939806716221
150.0653870690323747



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