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 12:24:37 -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/t1228159504lbmiao89cbnvk0o.htm/, Retrieved Sun, 05 May 2024 17:10:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27222, Retrieved Sun, 05 May 2024 17:10:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact228
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]
- RMPD  [Standard Deviation-Mean Plot] [Q5] [2008-11-29 20:10:39] [57fa5e3679c393aa19449b2f1be9928b]
-   P     [Standard Deviation-Mean Plot] [Q5] [2008-11-29 20:18:39] [57fa5e3679c393aa19449b2f1be9928b]
- RM        [Variance Reduction Matrix] [Q6 Variance] [2008-11-29 20:25:29] [57fa5e3679c393aa19449b2f1be9928b]
- RM          [(Partial) Autocorrelation Function] [Q6 ACF] [2008-11-29 20:35:57] [57fa5e3679c393aa19449b2f1be9928b]
-               [(Partial) Autocorrelation Function] [Q6 aangepaste ACF] [2008-11-29 20:44:03] [57fa5e3679c393aa19449b2f1be9928b]
- RM D            [Cross Correlation Function] [Q7] [2008-11-29 20:55:14] [57fa5e3679c393aa19449b2f1be9928b]
-   P               [Cross Correlation Function] [] [2008-11-30 11:20:03] [a4ee3bef49b119f4bd2e925060c84f5e]
F    D                  [Cross Correlation Function] [] [2008-12-01 19:24:37] [db9a5fd0f9c3e1245d8075d8bb09236d] [Current]
F    D                    [Cross Correlation Function] [] [2008-12-01 19:35:49] [d134696a922d84037f02d49ded84b0bd]
Feedback Forum
2008-12-06 13:40:28 [90714a39acc78a7b2ecd294ecc6b2864] [reply
De Cross Correlation Function is anders dan de Autocorrelation Function. De x-as toont negatieve en positieve waarden. De autocorrelatie is de correlatie tussen Yt en Yt-1; Yt en Yt-2; Yt en Yt-3; ... De cross correlatie is de correlatie tussen Xt en Yt; Xt en Yt-1; Xt en Yt-2; ... Via de autocorrelatie kan je een voorspelling doen door het eigen verleden (Yt-1, Yt-2, ...) Via de cross correlatie kan je een voorspelling doen door het verleden van een andere tijdreeks. De grafiek van de Cross Correlation Function heeft niets te maken met een trend en seizonaliteit.

Als je d=1 invoert voor x en y dan is het vorige patroon verdwenen. De trend is verwijderd en zo maak je de reeks stationair. d= het aantal keer differentiëren (meestal 1 voor economische tijdreeksen).
2008-12-07 14:02:21 [Stijn Van de Velde] [reply
De cross correlatie functie word inderdaad gebruikt om het een voorspelling te maken voor tijdreeks Y aan de hand van het verleden van tijdreeks X. Toch is mijn antwoord correct. De ccf laat een typisch beeld zien van 2 tijdreeksen die simultaan op elkaar gelijken (eerst stijgend, dan dalend, met een peik in het midden).

Post a new message
Dataseries X:
9097,4
12639,8
13040,1
11687,3
11191,7
11391,9
11793,1
13933,2
12778,1
11810,3
13698,4
11956,6
10723,8
13938,9
13979,8
13807,4
12973,9
12509,8
12934,1
14908,3
13772,1
13012,6
14049,9
11816,5
11593,2
14466,2
13615,9
14733,9
13880,7
13527,5
13584
16170,2
13260,6
14741,9
15486,5
13154,5
12621,2
15031,6
15452,4
15428
13105,9
14716,8
14180
16202,2
14392,4
15140,6
15960,1
14351,3
13230,2
15202,1
17157,3
16159,1
13405,7
17224,7
17338,4
17370,6
18817,8
16593,2
17979,5
17015,2
Dataseries Y:
8638,7
11063,7
11855,7
10684,5
11337,4
10478
11123,9
12909,3
11339,9
10462,2
12733,5
10519,2
10414,9
12476,8
12384,6
12266,7
12919,9
11497,3
12142
13919,4
12656,8
12034,1
13199,7
10881,3
11301,2
13643,9
12517
13981,1
14275,7
13435
13565,7
16216,3
12970
14079,9
14235
12213,4
12581
14130,4
14210,8
14378,5
13142,8
13714,7
13621,9
15379,8
13306,3
14391,2
14909,9
14025,4
12951,2
14344,3
16213,3
15544,5
14750,6
17292,7
17568,5
17930,8
18644,7
16694,8
17242,8
16979,9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27222&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.144159986512926
-130.191620587217266
-120.373981358932228
-110.257988647357137
-100.173643762057973
-90.330480966597057
-80.341284799056841
-70.269211429026945
-60.427149009187276
-50.449879064010547
-40.45960562700074
-30.578358512427709
-20.542682036456784
-10.637178568157966
00.960952817660977
10.651779975651096
20.536079019874281
30.631284678588884
40.51580690039527
50.417565432486522
60.418884799710935
70.284735605781134
80.282482673897241
90.259332570083933
100.157569628893517
110.211107073404606
120.335143801200698
130.160954521551604
140.0897188354520629

\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.144159986512926 \tabularnewline
-13 & 0.191620587217266 \tabularnewline
-12 & 0.373981358932228 \tabularnewline
-11 & 0.257988647357137 \tabularnewline
-10 & 0.173643762057973 \tabularnewline
-9 & 0.330480966597057 \tabularnewline
-8 & 0.341284799056841 \tabularnewline
-7 & 0.269211429026945 \tabularnewline
-6 & 0.427149009187276 \tabularnewline
-5 & 0.449879064010547 \tabularnewline
-4 & 0.45960562700074 \tabularnewline
-3 & 0.578358512427709 \tabularnewline
-2 & 0.542682036456784 \tabularnewline
-1 & 0.637178568157966 \tabularnewline
0 & 0.960952817660977 \tabularnewline
1 & 0.651779975651096 \tabularnewline
2 & 0.536079019874281 \tabularnewline
3 & 0.631284678588884 \tabularnewline
4 & 0.51580690039527 \tabularnewline
5 & 0.417565432486522 \tabularnewline
6 & 0.418884799710935 \tabularnewline
7 & 0.284735605781134 \tabularnewline
8 & 0.282482673897241 \tabularnewline
9 & 0.259332570083933 \tabularnewline
10 & 0.157569628893517 \tabularnewline
11 & 0.211107073404606 \tabularnewline
12 & 0.335143801200698 \tabularnewline
13 & 0.160954521551604 \tabularnewline
14 & 0.0897188354520629 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27222&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.144159986512926[/C][/ROW]
[ROW][C]-13[/C][C]0.191620587217266[/C][/ROW]
[ROW][C]-12[/C][C]0.373981358932228[/C][/ROW]
[ROW][C]-11[/C][C]0.257988647357137[/C][/ROW]
[ROW][C]-10[/C][C]0.173643762057973[/C][/ROW]
[ROW][C]-9[/C][C]0.330480966597057[/C][/ROW]
[ROW][C]-8[/C][C]0.341284799056841[/C][/ROW]
[ROW][C]-7[/C][C]0.269211429026945[/C][/ROW]
[ROW][C]-6[/C][C]0.427149009187276[/C][/ROW]
[ROW][C]-5[/C][C]0.449879064010547[/C][/ROW]
[ROW][C]-4[/C][C]0.45960562700074[/C][/ROW]
[ROW][C]-3[/C][C]0.578358512427709[/C][/ROW]
[ROW][C]-2[/C][C]0.542682036456784[/C][/ROW]
[ROW][C]-1[/C][C]0.637178568157966[/C][/ROW]
[ROW][C]0[/C][C]0.960952817660977[/C][/ROW]
[ROW][C]1[/C][C]0.651779975651096[/C][/ROW]
[ROW][C]2[/C][C]0.536079019874281[/C][/ROW]
[ROW][C]3[/C][C]0.631284678588884[/C][/ROW]
[ROW][C]4[/C][C]0.51580690039527[/C][/ROW]
[ROW][C]5[/C][C]0.417565432486522[/C][/ROW]
[ROW][C]6[/C][C]0.418884799710935[/C][/ROW]
[ROW][C]7[/C][C]0.284735605781134[/C][/ROW]
[ROW][C]8[/C][C]0.282482673897241[/C][/ROW]
[ROW][C]9[/C][C]0.259332570083933[/C][/ROW]
[ROW][C]10[/C][C]0.157569628893517[/C][/ROW]
[ROW][C]11[/C][C]0.211107073404606[/C][/ROW]
[ROW][C]12[/C][C]0.335143801200698[/C][/ROW]
[ROW][C]13[/C][C]0.160954521551604[/C][/ROW]
[ROW][C]14[/C][C]0.0897188354520629[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27222&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27222&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.144159986512926
-130.191620587217266
-120.373981358932228
-110.257988647357137
-100.173643762057973
-90.330480966597057
-80.341284799056841
-70.269211429026945
-60.427149009187276
-50.449879064010547
-40.45960562700074
-30.578358512427709
-20.542682036456784
-10.637178568157966
00.960952817660977
10.651779975651096
20.536079019874281
30.631284678588884
40.51580690039527
50.417565432486522
60.418884799710935
70.284735605781134
80.282482673897241
90.259332570083933
100.157569628893517
110.211107073404606
120.335143801200698
130.160954521551604
140.0897188354520629



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