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 13:12:48 -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/t1228162410kwm7b7w8lzmkemg.htm/, Retrieved Sun, 05 May 2024 12:25:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=27316, Retrieved Sun, 05 May 2024 12:25:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact238
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    D  [Univariate Data Series] [q5 non stationary...] [2008-12-01 19:31:26] [85134b6edb9973b9193450dd2306c65b]
F RMPD      [Cross Correlation Function] [q7 non stationary...] [2008-12-01 20:12:48] [4940af498c7c54f3992f17142bd40069] [Current]
Feedback Forum
2008-12-05 10:41:02 [Stijn Van de Velde] [reply
Q7:
De cross correlatie functie word gebruikt om het een voorspelling te maken voor tijdreeks Y aan de hand van het verleden van tijdreeks X.
Je antwoord is echter niet juist, er is maar weinig correlatie tussen de beide reeksen, want de cross correlatie ligt volledig binnen het betrouwbaarheidsinterval.

Q8:
Zie Q3: op deze manier kan je te weten komen hoeveel keer we d en D zouden moeten transformeren.

d=0 wil zeggen dat er geen lange termijn trend is
D=0 wil zeggen dat er geen seizoenaliteit is.

Als er wel 1 van de 2 vorige is, gaan we d en/of D op 1, 2 of 3 zetten (afhankelijk van welke orde de trend/seizoenaliteit is) om zo de trend of seizoenaliteit er uit te halen. Op die manier word de tijdreeks stationair gemaakt. Dit noemt men differentiëren.

Zie Q5: Zo kan je de lambda berekenen. Door deze in te vullen ga je de tijdreeks wederom transformeren en zo de reeks nog meer stationair maken.

Q9
Hier moest je dus de waarden die je bij Q8 gevonden hebt invullen.
Doordat D=0 weten we dat hier geen seizonaliteit is, en moeten we dus niet transformeren.
We moeten wel differentiëren om de lange termijn trend er uit te halen (d op 1,2 of 3 zetten afhankelijk van wat je gevonden hebt bij Q8).

Bij de Box-Cox transformation parameter moet je de lambda waarde invullen die je in Q8 vond.

Door dit te doen heb je de tijdreeks min of meer stationair gemaakt en ligt ze vzzl meer binnen het betrouwbaarheidsinterval.
2008-12-08 18:34:42 [Nathalie Boden] [reply
2008-12-08 18:42:36 [Nathalie Boden] [reply
Antwoord op Q7,Q8 en Q9 = we gaan met twee willekeurige tijdreeksen werken. We doen een opeenvolging van alle correlatiecoëfficiënten. We gaan hier de correlatie berekenen tussen Yt en een andere tijdreeks bv. Yt-2. We gaan hierbij ook kijken in welke mate een variabele voorspelt kan worden. Op de grafiek hebben we niet te maken met een trend maar wel wat het verband is tussen x en y. Wanneer de waarden binnen het betrouwbaarheidsinterval vallen is het niet significant. Zoals dit in mijn tijdreeks het geval is. We gaan ook bij d=1 en D=1 in de parameter invullen. De bedoeling is dat we de tijdreeksen stationair gaan maken en de trend doen verdwijnen. Het is belangrijk om een goede differentiatie te kiezen.

Post a new message
Dataseries X:
10511
10812
10738
10171
9721
9897
9828
9924
10371
10846
10413
10709
10662
10570
10297
10635
10872
10296
10383
10431
10574
10653
10805
10872
10625
10407
10463
10556
10646
10702
11353
11346
11451
11964
12574
13031
13812
14544
14931
14886
16005
17064
15168
16050
15839
15137
14954
15648
15305
15579
16348
15928
16171
15937
15713
15594
15683
16438
17032
17696
17745
Dataseries Y:
512238
519164
517009
509933
509127
500857
506971
569323
579714
577992
565464
547344
554788
562325
560854
555332
543599
536662
542722
593530
610763
612613
611324
594167
595454
590865
589379
584428
573100
567456
569028
620735
628884
628232
612117
595404
597141
593408
590072
579799
574205
572775
572942
619567
625809
619916
587625
565742
557274
560576
548854
531673
525919
511038
498662
555362
564591
541657
527070
509846
514258




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27316&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 series0
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-14-0.0280328349497333
-130.0432732859256053
-120.0320737434557695
-110.0292262904066976
-100.0727524614912883
-90.102354598385992
-80.0364800059529121
-70.108110854809777
-60.0928263021459805
-50.083473401773778
-40.111102137964527
-30.0624553797634577
-20.0517577678308694
-10.125140153287466
00.140250713238742
10.162459690979437
20.128247768375053
30.07533563690081
40.00109027518064760
50.0416657434902985
60.0634990946080805
70.0277462369092348
80.0337010171242809
90.00162978684689749
100.00239714799683749
110.139673126289356
120.171659848798131
130.209025028669244
140.150116147800529

\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 & 0 \tabularnewline
Degree of seasonal differencing (D) of Y series & 0 \tabularnewline
k & rho(Y[t],X[t+k]) \tabularnewline
-14 & -0.0280328349497333 \tabularnewline
-13 & 0.0432732859256053 \tabularnewline
-12 & 0.0320737434557695 \tabularnewline
-11 & 0.0292262904066976 \tabularnewline
-10 & 0.0727524614912883 \tabularnewline
-9 & 0.102354598385992 \tabularnewline
-8 & 0.0364800059529121 \tabularnewline
-7 & 0.108110854809777 \tabularnewline
-6 & 0.0928263021459805 \tabularnewline
-5 & 0.083473401773778 \tabularnewline
-4 & 0.111102137964527 \tabularnewline
-3 & 0.0624553797634577 \tabularnewline
-2 & 0.0517577678308694 \tabularnewline
-1 & 0.125140153287466 \tabularnewline
0 & 0.140250713238742 \tabularnewline
1 & 0.162459690979437 \tabularnewline
2 & 0.128247768375053 \tabularnewline
3 & 0.07533563690081 \tabularnewline
4 & 0.00109027518064760 \tabularnewline
5 & 0.0416657434902985 \tabularnewline
6 & 0.0634990946080805 \tabularnewline
7 & 0.0277462369092348 \tabularnewline
8 & 0.0337010171242809 \tabularnewline
9 & 0.00162978684689749 \tabularnewline
10 & 0.00239714799683749 \tabularnewline
11 & 0.139673126289356 \tabularnewline
12 & 0.171659848798131 \tabularnewline
13 & 0.209025028669244 \tabularnewline
14 & 0.150116147800529 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=27316&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]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.0280328349497333[/C][/ROW]
[ROW][C]-13[/C][C]0.0432732859256053[/C][/ROW]
[ROW][C]-12[/C][C]0.0320737434557695[/C][/ROW]
[ROW][C]-11[/C][C]0.0292262904066976[/C][/ROW]
[ROW][C]-10[/C][C]0.0727524614912883[/C][/ROW]
[ROW][C]-9[/C][C]0.102354598385992[/C][/ROW]
[ROW][C]-8[/C][C]0.0364800059529121[/C][/ROW]
[ROW][C]-7[/C][C]0.108110854809777[/C][/ROW]
[ROW][C]-6[/C][C]0.0928263021459805[/C][/ROW]
[ROW][C]-5[/C][C]0.083473401773778[/C][/ROW]
[ROW][C]-4[/C][C]0.111102137964527[/C][/ROW]
[ROW][C]-3[/C][C]0.0624553797634577[/C][/ROW]
[ROW][C]-2[/C][C]0.0517577678308694[/C][/ROW]
[ROW][C]-1[/C][C]0.125140153287466[/C][/ROW]
[ROW][C]0[/C][C]0.140250713238742[/C][/ROW]
[ROW][C]1[/C][C]0.162459690979437[/C][/ROW]
[ROW][C]2[/C][C]0.128247768375053[/C][/ROW]
[ROW][C]3[/C][C]0.07533563690081[/C][/ROW]
[ROW][C]4[/C][C]0.00109027518064760[/C][/ROW]
[ROW][C]5[/C][C]0.0416657434902985[/C][/ROW]
[ROW][C]6[/C][C]0.0634990946080805[/C][/ROW]
[ROW][C]7[/C][C]0.0277462369092348[/C][/ROW]
[ROW][C]8[/C][C]0.0337010171242809[/C][/ROW]
[ROW][C]9[/C][C]0.00162978684689749[/C][/ROW]
[ROW][C]10[/C][C]0.00239714799683749[/C][/ROW]
[ROW][C]11[/C][C]0.139673126289356[/C][/ROW]
[ROW][C]12[/C][C]0.171659848798131[/C][/ROW]
[ROW][C]13[/C][C]0.209025028669244[/C][/ROW]
[ROW][C]14[/C][C]0.150116147800529[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=27316&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=27316&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 series0
Degree of seasonal differencing (D) of Y series0
krho(Y[t],X[t+k])
-14-0.0280328349497333
-130.0432732859256053
-120.0320737434557695
-110.0292262904066976
-100.0727524614912883
-90.102354598385992
-80.0364800059529121
-70.108110854809777
-60.0928263021459805
-50.083473401773778
-40.111102137964527
-30.0624553797634577
-20.0517577678308694
-10.125140153287466
00.140250713238742
10.162459690979437
20.128247768375053
30.07533563690081
40.00109027518064760
50.0416657434902985
60.0634990946080805
70.0277462369092348
80.0337010171242809
90.00162978684689749
100.00239714799683749
110.139673126289356
120.171659848798131
130.209025028669244
140.150116147800529



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