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 12:55:38 -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/t1228247807m60ccuywbwkx7ew.htm/, Retrieved Sun, 19 May 2024 12:37:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=28301, Retrieved Sun, 19 May 2024 12:37:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact188
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] [] [2008-12-02 19:55:38] [c00776cbed2786c9c4960950021bd861] [Current]
F   P       [Cross Correlation Function] [Q9] [2008-12-03 12:45:14] [74be16979710d4c4e7c6647856088456]
Feedback Forum
2008-12-03 19:05:53 [407693b66d7f2e0b350979005057872d] [reply
Dit is goed geantwoord omdat we X gebruiken om Y te voorspellen.
2008-12-04 16:08:31 [c97d2ae59c98cf77a04815c1edffab5a] [reply
wat de student zegt is juist. we gaan inderdaad onderzoeken of x(t) een leading indicator is (voorloper)/ een voorspellende kracht heeft op het verloop van y(t).
hierbij gaan we k verschillende waarden laten aannemen, die overeenstemmen met verschuivingen in de tijd. uit de crosscorrelatie functie kan je afleiden hoeveel periodes je x(t) moet vertragen(k<0) of versnellen(k>0) om y(t) te voorspellen. je kan ook nagaan of x(t) een positief of negatief effect zal hebben op y(t) bij deze tijdsreeks zal dit een positief effect zijn.
de rest heeft de student allemaal vermeld.
2008-12-07 18:19:45 [Sandra Hofmans] [reply
Je hebt goed begrepen wat een cross correlation functie inhoudt. We krijgen hier de grootste coefficient bij k=0. Dit betekent dat we Yt het beste kunnen voorspellen door middel van Xt, we hoeven dus niet naar het verleden of de toekomst te kijken.
2008-12-08 13:06:29 [Dave Bellekens] [reply
Je geeft een correcte uitleg over het gebruik en interpretatie van de cross correlation functie.
We zien hier op de grafiek dat de lag(k)=0 de hoogste correlatie coëfficiënt heeft, wat er op wijst dat Y(t)het best kunnen voorspellen adhv de huidige X waarden.

Post a new message
Dataseries X:
263151
259372
251960
246936
240570
238382
261156
272095
272017
271876
266863
270878
274212
265841
255968
250606
240470
232662
256235
266169
261751
255914
252397
254227
255699
252285
247132
242785
235667
234952
255179
263727
261315
252049
245914
248289
246790
243978
238108
231776
224585
219058
240429
254569
249074
237521
230384
232521
234611
230592
225144
218143
212434
208676
229328
242148
233916
225628
217837
217786
218413
213261
204094
201484
194600
191325
211261
226293
219734
214591
205348
203496
208155
205010
200290
198088
195186
191395
213768
225780
230579
229261
216228
216713
220206
220115
218444
214912
210705
209673
237041
242081
241878
242621
238545
240337
244752
244576
241572
240541
236089
236997
264579
270349
269645
267037
258113
262813
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
Dataseries Y:
336766
332201
323529
320287
314768
316870
347093
358764
356615
352559
342807
344952
346958
338371
328380
323111
314764
312235
342631
353912
345948
334046
326268
325939
323758
319275
313328
308612
301096
305610
333005
343322
337653
325595
316726
317578
314484
310166
301792
294495
287256
286224
313654
329656
319784
301995
291228
293041
291908
285121
278310
271158
266586
266426
294354
309380
297710
285409
274580
274402
274452
267700
257841
255124
247377
247823
276919
294271
281758
270434
258848
256674
258882
255060
247698
244779
240901
239933
270247
283893
282348
273570
254756
254354
255843
254490
251995
246339
244019
245953
279806
283111
281097
275964
270694
271901
274412
272433
268361
268586
264768
269974
304744
309365
308347
298427
289231
291975
294912
293488
290555
284736
281818
287854
316263
325412
326011
328282
317480
317539
313737
312276
309391
302950
300316
304035
333476
337698
335932
323931
313927
314485
313218
309664
302963
298989
298423
301631
329765
335083
327616
309119
295916
291413
291542
284678
276475
272566
264981
263290
296806
303598
286994
276427
266424
267153
268381
262522
255542
253158
243803
250741
280445
285257
270976
261076




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=28301&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])
-190.281875842657375
-180.305796412433953
-170.306281277843243
-160.304316983824934
-150.329351365270924
-140.402771228992521
-130.520993232023117
-120.621889078493107
-110.613621251493282
-100.550764316339467
-90.503517105625111
-80.491553073954822
-70.512570596928469
-60.525488040819997
-50.513450987097768
-40.494282726872846
-30.503513423932723
-20.561917418335251
-10.667754902299167
00.751857447677508
10.703708008466709
20.604126682658009
30.523037534948574
40.478622937677534
50.468941273322929
60.454815983111529
70.40942624078387
80.353727803348371
90.330344322280269
100.352608651235671
110.419089202846041
120.460382275559815
130.390298452408503
140.277305037425343
150.181278350390099
160.122774869591836
170.0999769349706572
180.0763971583982997
190.0249065424780193

\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
-19 & 0.281875842657375 \tabularnewline
-18 & 0.305796412433953 \tabularnewline
-17 & 0.306281277843243 \tabularnewline
-16 & 0.304316983824934 \tabularnewline
-15 & 0.329351365270924 \tabularnewline
-14 & 0.402771228992521 \tabularnewline
-13 & 0.520993232023117 \tabularnewline
-12 & 0.621889078493107 \tabularnewline
-11 & 0.613621251493282 \tabularnewline
-10 & 0.550764316339467 \tabularnewline
-9 & 0.503517105625111 \tabularnewline
-8 & 0.491553073954822 \tabularnewline
-7 & 0.512570596928469 \tabularnewline
-6 & 0.525488040819997 \tabularnewline
-5 & 0.513450987097768 \tabularnewline
-4 & 0.494282726872846 \tabularnewline
-3 & 0.503513423932723 \tabularnewline
-2 & 0.561917418335251 \tabularnewline
-1 & 0.667754902299167 \tabularnewline
0 & 0.751857447677508 \tabularnewline
1 & 0.703708008466709 \tabularnewline
2 & 0.604126682658009 \tabularnewline
3 & 0.523037534948574 \tabularnewline
4 & 0.478622937677534 \tabularnewline
5 & 0.468941273322929 \tabularnewline
6 & 0.454815983111529 \tabularnewline
7 & 0.40942624078387 \tabularnewline
8 & 0.353727803348371 \tabularnewline
9 & 0.330344322280269 \tabularnewline
10 & 0.352608651235671 \tabularnewline
11 & 0.419089202846041 \tabularnewline
12 & 0.460382275559815 \tabularnewline
13 & 0.390298452408503 \tabularnewline
14 & 0.277305037425343 \tabularnewline
15 & 0.181278350390099 \tabularnewline
16 & 0.122774869591836 \tabularnewline
17 & 0.0999769349706572 \tabularnewline
18 & 0.0763971583982997 \tabularnewline
19 & 0.0249065424780193 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=28301&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]-19[/C][C]0.281875842657375[/C][/ROW]
[ROW][C]-18[/C][C]0.305796412433953[/C][/ROW]
[ROW][C]-17[/C][C]0.306281277843243[/C][/ROW]
[ROW][C]-16[/C][C]0.304316983824934[/C][/ROW]
[ROW][C]-15[/C][C]0.329351365270924[/C][/ROW]
[ROW][C]-14[/C][C]0.402771228992521[/C][/ROW]
[ROW][C]-13[/C][C]0.520993232023117[/C][/ROW]
[ROW][C]-12[/C][C]0.621889078493107[/C][/ROW]
[ROW][C]-11[/C][C]0.613621251493282[/C][/ROW]
[ROW][C]-10[/C][C]0.550764316339467[/C][/ROW]
[ROW][C]-9[/C][C]0.503517105625111[/C][/ROW]
[ROW][C]-8[/C][C]0.491553073954822[/C][/ROW]
[ROW][C]-7[/C][C]0.512570596928469[/C][/ROW]
[ROW][C]-6[/C][C]0.525488040819997[/C][/ROW]
[ROW][C]-5[/C][C]0.513450987097768[/C][/ROW]
[ROW][C]-4[/C][C]0.494282726872846[/C][/ROW]
[ROW][C]-3[/C][C]0.503513423932723[/C][/ROW]
[ROW][C]-2[/C][C]0.561917418335251[/C][/ROW]
[ROW][C]-1[/C][C]0.667754902299167[/C][/ROW]
[ROW][C]0[/C][C]0.751857447677508[/C][/ROW]
[ROW][C]1[/C][C]0.703708008466709[/C][/ROW]
[ROW][C]2[/C][C]0.604126682658009[/C][/ROW]
[ROW][C]3[/C][C]0.523037534948574[/C][/ROW]
[ROW][C]4[/C][C]0.478622937677534[/C][/ROW]
[ROW][C]5[/C][C]0.468941273322929[/C][/ROW]
[ROW][C]6[/C][C]0.454815983111529[/C][/ROW]
[ROW][C]7[/C][C]0.40942624078387[/C][/ROW]
[ROW][C]8[/C][C]0.353727803348371[/C][/ROW]
[ROW][C]9[/C][C]0.330344322280269[/C][/ROW]
[ROW][C]10[/C][C]0.352608651235671[/C][/ROW]
[ROW][C]11[/C][C]0.419089202846041[/C][/ROW]
[ROW][C]12[/C][C]0.460382275559815[/C][/ROW]
[ROW][C]13[/C][C]0.390298452408503[/C][/ROW]
[ROW][C]14[/C][C]0.277305037425343[/C][/ROW]
[ROW][C]15[/C][C]0.181278350390099[/C][/ROW]
[ROW][C]16[/C][C]0.122774869591836[/C][/ROW]
[ROW][C]17[/C][C]0.0999769349706572[/C][/ROW]
[ROW][C]18[/C][C]0.0763971583982997[/C][/ROW]
[ROW][C]19[/C][C]0.0249065424780193[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=28301&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=28301&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])
-190.281875842657375
-180.305796412433953
-170.306281277843243
-160.304316983824934
-150.329351365270924
-140.402771228992521
-130.520993232023117
-120.621889078493107
-110.613621251493282
-100.550764316339467
-90.503517105625111
-80.491553073954822
-70.512570596928469
-60.525488040819997
-50.513450987097768
-40.494282726872846
-30.503513423932723
-20.561917418335251
-10.667754902299167
00.751857447677508
10.703708008466709
20.604126682658009
30.523037534948574
40.478622937677534
50.468941273322929
60.454815983111529
70.40942624078387
80.353727803348371
90.330344322280269
100.352608651235671
110.419089202846041
120.460382275559815
130.390298452408503
140.277305037425343
150.181278350390099
160.122774869591836
170.0999769349706572
180.0763971583982997
190.0249065424780193



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