Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_cross.wasp
Title produced by softwareCross Correlation Function
Date of computationTue, 02 Dec 2008 06:49:39 -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/t1228225829xhcf6yrnjq5dkqj.htm/, Retrieved Sun, 19 May 2024 09:36:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27790, Retrieved Sun, 19 May 2024 09:36:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact208
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  [Spectral Analysis] [q6] [2008-12-02 13:19:49] [74be16979710d4c4e7c6647856088456]
F RMPD    [Cross Correlation Function] [q7] [2008-12-02 13:34:43] [7ab42b4673454531c59df48fbb842b60]
F   PD        [Cross Correlation Function] [q8] [2008-12-02 13:49:39] [074508d5a5a3592082de3e836d27af7d] [Current]
F RM D          [Variance Reduction Matrix] [q8] [2008-12-02 13:55:29] [7ab42b4673454531c59df48fbb842b60]
- RMP             [Standard Deviation-Mean Plot] [q9] [2008-12-07 11:33:42] [1b742211e88d1643c42c5773474321b2]
F RM D          [Variance Reduction Matrix] [q8] [2008-12-02 13:58:13] [7ab42b4673454531c59df48fbb842b60]
- RMP             [Standard Deviation-Mean Plot] [q9] [2008-12-07 11:28:49] [1b742211e88d1643c42c5773474321b2]
Feedback Forum
2008-12-07 21:08:12 [Jasmine Hendrikx] [reply
Evaluatie Q9:
De berekening is correct uitgevoerd. De student vermeldt dat het trendmatig verloop verdwenen is, maar bij cross correlatie kijken we niet naar de trend. Het volgende zou bij de conclusie nog vermeld kunnen worden: De resultaten zijn erg verschillend voor en na transformatie. Vóór we d aangepast hebben, waren er voor de verschillende k’s zeer veel significante verschillen met 0. Nu zien we dat deze zo goed als allemaal binnen het betrouwbaarheidsinterval vallen en dus door toeval verklaard kunnen worden.
Dit is een typisch fenomeen. Na transformatie zie je ofwel niets meer of véél minder significante verschillen. De verklaring hiervoor is terug te vinden in partiële correlatie. De correlatie tussen Xt enYt kan vertekend worden indien er een andere variabele is die zowel Yt als Xt sterk beïnvloedt. Zt is dus duidelijk aanwezig in de 2 tijdreeksen. De 2 reeksen vertonen dezelfde trend. Er is autocorrelatie bij de twee reeksen aanwezig. Als we de trend uit X en Y halen, zullen we dus een veel zuiverder beeld zien. Q9 geeft dus een veel betrouwbaarder beeld dan Q7. We kunnen dus eigenlijk spreken van een nonsenscorrelatie tussen Xt en Yt.
  2008-12-07 21:36:19 [Jasmine Hendrikx] [reply
Ook moet ik hier nog vermelden dat de student geen gebruik heeft gemaakt van de optimale lambda in haar berekeningen bij Q9 (deze is hier gewoon gelijkgesteld aan 1), aangezien deze niet berekend waren in Q8.
2008-12-08 19:40:14 [Koen Van Baelen] [reply
Doordat de student niet de optimale lambda heeft ingevoerd, door de foute berekening in Q8 is het niet helemaal correct. Als we de analyse dan toch maken met de foute lambda vinden we het volgende: We zien dat er nog steeds sprake is van voorspelbaarheid voor k0, maar de voorspelbaarheid is dus al een stuk minder dan in Q7. Dit betekent dus dat er sprake was van een schijncorrelatie. Er was een ‘Z’ die invloed had op beide variabelen en dus zorgde voor een schijnbare correlatie tussen X en Y. In bovenstaande grafiek is de invloed van die Z geëlimineerd. Dit geeft dus een betrouwbaarder beeld en toont aan dat we Y veel minder goed kunnen voorspellen op basis van vroegere en toekomstige waarden van X.

Post a new message
Dataseries X:
2174.56
2196.72
2350.44
2440.25
2408.64
2472.81
2407.6
2454.62
2448.05
2497.84
2645.64
2756.76
2849.27
2921.44
2981.85
3080.58
3106.22
3119.31
3061.26
3097.31
3161.69
3257.16
3277.01
3295.32
3363.99
3494.17
3667.03
3813.06
3917.96
3895.51
3801.06
3570.12
3701.61
3862.27
3970.1
4138.52
4199.75
4290.89
4443.91
4502.64
4356.98
4591.27
4696.96
4621.4
4562.84
4202.52
4296.49
4435.23
4105.18
4116.68
3844.49
3720.98
3674.4
3857.62
3801.06
3504.37
3032.6
3047.03
2962.34
Dataseries Y:
9762.12
10124.63
10540.05
10601.61
10323.73
10418.4
10092.96
10364.91
10152.09
10032.8
10204.59
10001.6
10411.75
10673.38
10539.51
10723.78
10682.06
10283.19
10377.18
10486.64
10545.38
10554.27
10532.54
10324.31
10695.25
10827.81
10872.48
10971.19
11145.65
11234.68
11333.88
10997.97
11036.89
11257.35
11533.59
11963.12
12185.15
12377.62
12512.89
12631.48
12268.53
12754.8
13407.75
13480.21
13673.28
13239.71
13557.69
13901.28
13200.58
13406.97
12538.12
12419.57
12193.88
12656.63
12812.48
12056.67
11322.38
11530.75
11114.08




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 & 2 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=27790&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]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27790&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27790&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'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 series1
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 series1
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-14-0.0106218067802321
-130.0013103999004675
-12-0.0118796428458863
-110.079408472268524
-100.193916113943067
-9-0.0321956143397015
-80.172387517116657
-70.133303034139322
-60.0651301742805937
-50.228625854763937
-40.00458657126325821
-30.0687829193067431
-20.115348229923832
-10.108255570104156
00.795527606558038
10.0768033738541333
2-0.0219162209465283
3-0.0808553544820761
4-0.015605134786923
50.155301351376416
60.0819472209273824
7-0.0412937632007856
80.123925215595611
9-0.136782505940466
10-0.0574525045738246
110.041090500217156
12-0.0345586542239933
13-0.0847593388247136
14-0.0530258050730538

\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 & 1 \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 & 1 \tabularnewline
Degree of seasonal differencing (D) of Y series & 0 \tabularnewline
k & rho(Y[t],X[t+k]) \tabularnewline
-14 & -0.0106218067802321 \tabularnewline
-13 & 0.0013103999004675 \tabularnewline
-12 & -0.0118796428458863 \tabularnewline
-11 & 0.079408472268524 \tabularnewline
-10 & 0.193916113943067 \tabularnewline
-9 & -0.0321956143397015 \tabularnewline
-8 & 0.172387517116657 \tabularnewline
-7 & 0.133303034139322 \tabularnewline
-6 & 0.0651301742805937 \tabularnewline
-5 & 0.228625854763937 \tabularnewline
-4 & 0.00458657126325821 \tabularnewline
-3 & 0.0687829193067431 \tabularnewline
-2 & 0.115348229923832 \tabularnewline
-1 & 0.108255570104156 \tabularnewline
0 & 0.795527606558038 \tabularnewline
1 & 0.0768033738541333 \tabularnewline
2 & -0.0219162209465283 \tabularnewline
3 & -0.0808553544820761 \tabularnewline
4 & -0.015605134786923 \tabularnewline
5 & 0.155301351376416 \tabularnewline
6 & 0.0819472209273824 \tabularnewline
7 & -0.0412937632007856 \tabularnewline
8 & 0.123925215595611 \tabularnewline
9 & -0.136782505940466 \tabularnewline
10 & -0.0574525045738246 \tabularnewline
11 & 0.041090500217156 \tabularnewline
12 & -0.0345586542239933 \tabularnewline
13 & -0.0847593388247136 \tabularnewline
14 & -0.0530258050730538 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27790&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]1[/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]1[/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.0106218067802321[/C][/ROW]
[ROW][C]-13[/C][C]0.0013103999004675[/C][/ROW]
[ROW][C]-12[/C][C]-0.0118796428458863[/C][/ROW]
[ROW][C]-11[/C][C]0.079408472268524[/C][/ROW]
[ROW][C]-10[/C][C]0.193916113943067[/C][/ROW]
[ROW][C]-9[/C][C]-0.0321956143397015[/C][/ROW]
[ROW][C]-8[/C][C]0.172387517116657[/C][/ROW]
[ROW][C]-7[/C][C]0.133303034139322[/C][/ROW]
[ROW][C]-6[/C][C]0.0651301742805937[/C][/ROW]
[ROW][C]-5[/C][C]0.228625854763937[/C][/ROW]
[ROW][C]-4[/C][C]0.00458657126325821[/C][/ROW]
[ROW][C]-3[/C][C]0.0687829193067431[/C][/ROW]
[ROW][C]-2[/C][C]0.115348229923832[/C][/ROW]
[ROW][C]-1[/C][C]0.108255570104156[/C][/ROW]
[ROW][C]0[/C][C]0.795527606558038[/C][/ROW]
[ROW][C]1[/C][C]0.0768033738541333[/C][/ROW]
[ROW][C]2[/C][C]-0.0219162209465283[/C][/ROW]
[ROW][C]3[/C][C]-0.0808553544820761[/C][/ROW]
[ROW][C]4[/C][C]-0.015605134786923[/C][/ROW]
[ROW][C]5[/C][C]0.155301351376416[/C][/ROW]
[ROW][C]6[/C][C]0.0819472209273824[/C][/ROW]
[ROW][C]7[/C][C]-0.0412937632007856[/C][/ROW]
[ROW][C]8[/C][C]0.123925215595611[/C][/ROW]
[ROW][C]9[/C][C]-0.136782505940466[/C][/ROW]
[ROW][C]10[/C][C]-0.0574525045738246[/C][/ROW]
[ROW][C]11[/C][C]0.041090500217156[/C][/ROW]
[ROW][C]12[/C][C]-0.0345586542239933[/C][/ROW]
[ROW][C]13[/C][C]-0.0847593388247136[/C][/ROW]
[ROW][C]14[/C][C]-0.0530258050730538[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27790&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27790&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 series1
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 series1
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-14-0.0106218067802321
-130.0013103999004675
-12-0.0118796428458863
-110.079408472268524
-100.193916113943067
-9-0.0321956143397015
-80.172387517116657
-70.133303034139322
-60.0651301742805937
-50.228625854763937
-40.00458657126325821
-30.0687829193067431
-20.115348229923832
-10.108255570104156
00.795527606558038
10.0768033738541333
2-0.0219162209465283
3-0.0808553544820761
4-0.015605134786923
50.155301351376416
60.0819472209273824
7-0.0412937632007856
80.123925215595611
9-0.136782505940466
10-0.0574525045738246
110.041090500217156
12-0.0345586542239933
13-0.0847593388247136
14-0.0530258050730538



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