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 15:00:51 -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/t1228168913m7y6hmixzwqdfmi.htm/, Retrieved Sun, 05 May 2024 17:28:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27444, Retrieved Sun, 05 May 2024 17:28:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact253
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    [Cross Correlation Function] [Q7 : alle waarden...] [2008-12-01 22:00:51] [00a0a665d7a07edd2e460056b0c0c354] [Current]
-   PD      [Cross Correlation Function] [q7] [2008-12-01 22:39:53] [82d201ca7b4e7cd2c6f885d29b5b6937]
- RMPD      [Standard Deviation-Mean Plot] [Standard Deviatio...] [2008-12-07 21:51:17] [82d201ca7b4e7cd2c6f885d29b5b6937]
-    D        [Standard Deviation-Mean Plot] [Standard deviatio...] [2008-12-07 22:05:25] [82d201ca7b4e7cd2c6f885d29b5b6937]
- RMPD      [Variance Reduction Matrix] [VRM] [2008-12-07 21:56:13] [82d201ca7b4e7cd2c6f885d29b5b6937]
-    D        [Variance Reduction Matrix] [VRM] [2008-12-07 22:13:53] [82d201ca7b4e7cd2c6f885d29b5b6937]
Feedback Forum
2008-12-05 15:02:36 [Kristof Van Esbroeck] [reply
De vraagstelling heeft betrekking op de cross correlatie functie. Deze tracht een voorspelling neer te zetten van een datareeks adhv een verschillende variabele. Dit in tegenstelling tot de autocorrelatie, welke tracht een voorspelling te maken adhv het verleden van de reeks.

We noteren voorts op de x as van de cross correlatie functie de verschillende lags.

We merken verschillende k waarden op in de bijhorende tabel.k = 0 verwijst naar de autocorrelatie. Een negatieve waarde heeft betrekking op het verleden, een positieve daarentegen verwijst naar de toekomst.
2008-12-07 21:14:26 [Inge Meelberghs] [reply
Door het toepassen van de cross correlation techniek op je eigen tijdreeksen kan een variabele verklaard worden door het verleden van een andere variabele. Hiedoor kan men dus onderzoeken of er een verband is tussen het heden van Y en het verleden en toekomst van X.

De k-waarden kunnen een positief of een negatief karakter aannemen. De positieve wijzen op de toekomst en de negatieve op het verleden. k= 0 duidt op de autocorrelatie.
2008-12-07 22:28:18 [Inge Meelberghs] [reply
Doordat ik Q8 eerst niet had gemaakt omdat ik deze vraag niet begreep heb ik de oplossing nu daarom in dit feedbackforum gezet.

Om deze vraag op te lossen heb ik gebuik gemaakt van 2 tijdreeksen:

1e tijdreeks - Energie in België:

Standard deviation - mean plot
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/07/t122868679610h2c5unr6bg45n.htm

Variance reduction matrix
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/07/t1228687050gvezictu4zdlidx.htm

2e tijdreeks - 'energie in vlaanderen'

Standard deviaton Mean plot
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/07/t1228687637jjwp684d5v06crg.htm

Variance reduction matrix
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/07/t1228688073cac450sxr1qyzzl.htm

Conclusie:

De lambda waarden zijn in beide tijdreeksen verschillend. Namelijk 4,59 en 6,43.

Ook de variantie reductie matrix is anders. In de eerste tijdreeks vinden we de kleinste waarde terug bij Range 40.4: 35.7982372881356. Hier is de waarde van ‘d’= 1 en de waarde van ‘D’ = 0.
Dit wil dus zeggen dat we 1 keer een gewone differentiatie moeten doorvoeren om een minimale Variantie te bekome.

In de tweede tijdreeks vinden we de kleinste waarde terug bij Range 23: 24.4216496…. Hier is de waarde van ‘d’= 0 en de waarde van ‘D’ =10.
Dit wil dus zeggen dat we 1 keer een seizonale differentiatie moeten doorvoeren om een minimale Variantie te bekome.

Door deze berekeningen uit te voeren kunnen we uiteindelijk zeggen dat de tijdreeksen stationair zijn.


Post a new message
Dataseries X:
116.1
102.5
102.0
101.3
100.6
100.9
104.2
108.3
108.9
109.9
106.8
112.7
113.4
101.3
97.8
95.0
93.8
94.5
101.4
105.8
106.6
109.7
108.8
113.4
113.7
103.6
98.2
95.5
94.4
95.9
103.2
104.1
127.6
130.3
133.0
140.4
123.5
116.9
115.9
113.1
112.1
112.4
118.9
117.4
115.6
120.7
114.9
122.0
119.6
114.6
118.4
110.9
111.6
114.6
112.1
117.4
114.8
123.4
118.1
121.9
123.3
Dataseries Y:
117,1
107,0
107,0
111,0
108,2
96,3
100,9
107,7
106,2
118,7
116,1
118,1
118,4
110,8
106,4
112,2
108,3
96,0
100,6
107,8
108,4
120,9
117,3
119,7
119,6
111,8
108,1
111,8
105,5
93,6
103,9
100,3
106,6
118,4
106,6
109,8
115,9
111,7
119,8
116,1
103,2
99,0
112,3
104,2
114,0
121,7
107,2
112,8
117,8
113,3
116,1
111,8
110,2
110,0
102,9
110,1
102,7
118,7
109,0
115,7
118,1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27444&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)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])
-140.329851488452894
-130.374108541318031
-120.344932020734495
-110.0974373701940178
-100.0582681704361766
-9-0.128327825398787
-8-0.326584378051439
-7-0.27655267600184
-6-0.240195212780106
-5-0.0639200195753278
-40.227826457125556
-30.414344820868453
-20.401909020179802
-10.424873827558581
00.426980633094778
10.0906662757616331
2-0.00941878005035762
3-0.229652250303543
4-0.445327600983917
5-0.398227280362817
6-0.410411048143881
7-0.218669868579371
80.0733640487107107
90.274900207899943
100.361146438061639
110.459607319291064
120.428395759142295
130.197895459945220
140.0549775798269557

\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
-14 & 0.329851488452894 \tabularnewline
-13 & 0.374108541318031 \tabularnewline
-12 & 0.344932020734495 \tabularnewline
-11 & 0.0974373701940178 \tabularnewline
-10 & 0.0582681704361766 \tabularnewline
-9 & -0.128327825398787 \tabularnewline
-8 & -0.326584378051439 \tabularnewline
-7 & -0.27655267600184 \tabularnewline
-6 & -0.240195212780106 \tabularnewline
-5 & -0.0639200195753278 \tabularnewline
-4 & 0.227826457125556 \tabularnewline
-3 & 0.414344820868453 \tabularnewline
-2 & 0.401909020179802 \tabularnewline
-1 & 0.424873827558581 \tabularnewline
0 & 0.426980633094778 \tabularnewline
1 & 0.0906662757616331 \tabularnewline
2 & -0.00941878005035762 \tabularnewline
3 & -0.229652250303543 \tabularnewline
4 & -0.445327600983917 \tabularnewline
5 & -0.398227280362817 \tabularnewline
6 & -0.410411048143881 \tabularnewline
7 & -0.218669868579371 \tabularnewline
8 & 0.0733640487107107 \tabularnewline
9 & 0.274900207899943 \tabularnewline
10 & 0.361146438061639 \tabularnewline
11 & 0.459607319291064 \tabularnewline
12 & 0.428395759142295 \tabularnewline
13 & 0.197895459945220 \tabularnewline
14 & 0.0549775798269557 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27444&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]-14[/C][C]0.329851488452894[/C][/ROW]
[ROW][C]-13[/C][C]0.374108541318031[/C][/ROW]
[ROW][C]-12[/C][C]0.344932020734495[/C][/ROW]
[ROW][C]-11[/C][C]0.0974373701940178[/C][/ROW]
[ROW][C]-10[/C][C]0.0582681704361766[/C][/ROW]
[ROW][C]-9[/C][C]-0.128327825398787[/C][/ROW]
[ROW][C]-8[/C][C]-0.326584378051439[/C][/ROW]
[ROW][C]-7[/C][C]-0.27655267600184[/C][/ROW]
[ROW][C]-6[/C][C]-0.240195212780106[/C][/ROW]
[ROW][C]-5[/C][C]-0.0639200195753278[/C][/ROW]
[ROW][C]-4[/C][C]0.227826457125556[/C][/ROW]
[ROW][C]-3[/C][C]0.414344820868453[/C][/ROW]
[ROW][C]-2[/C][C]0.401909020179802[/C][/ROW]
[ROW][C]-1[/C][C]0.424873827558581[/C][/ROW]
[ROW][C]0[/C][C]0.426980633094778[/C][/ROW]
[ROW][C]1[/C][C]0.0906662757616331[/C][/ROW]
[ROW][C]2[/C][C]-0.00941878005035762[/C][/ROW]
[ROW][C]3[/C][C]-0.229652250303543[/C][/ROW]
[ROW][C]4[/C][C]-0.445327600983917[/C][/ROW]
[ROW][C]5[/C][C]-0.398227280362817[/C][/ROW]
[ROW][C]6[/C][C]-0.410411048143881[/C][/ROW]
[ROW][C]7[/C][C]-0.218669868579371[/C][/ROW]
[ROW][C]8[/C][C]0.0733640487107107[/C][/ROW]
[ROW][C]9[/C][C]0.274900207899943[/C][/ROW]
[ROW][C]10[/C][C]0.361146438061639[/C][/ROW]
[ROW][C]11[/C][C]0.459607319291064[/C][/ROW]
[ROW][C]12[/C][C]0.428395759142295[/C][/ROW]
[ROW][C]13[/C][C]0.197895459945220[/C][/ROW]
[ROW][C]14[/C][C]0.0549775798269557[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27444&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27444&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])
-140.329851488452894
-130.374108541318031
-120.344932020734495
-110.0974373701940178
-100.0582681704361766
-9-0.128327825398787
-8-0.326584378051439
-7-0.27655267600184
-6-0.240195212780106
-5-0.0639200195753278
-40.227826457125556
-30.414344820868453
-20.401909020179802
-10.424873827558581
00.426980633094778
10.0906662757616331
2-0.00941878005035762
3-0.229652250303543
4-0.445327600983917
5-0.398227280362817
6-0.410411048143881
7-0.218669868579371
80.0733640487107107
90.274900207899943
100.361146438061639
110.459607319291064
120.428395759142295
130.197895459945220
140.0549775798269557



Parameters (Session):
par1 = Default ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ;
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')