Message Boards Message Boards

0
|
2265 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Behavior of CorrelationFunction[ ] ?

Posted 2 years ago

Hello! According to the documentation, "it is also known as autocorrelation or cross-correlation function (ACF or CCF)" . Consider two series:

don2 = {1.4700335660303452`, 
   3.938502200833952`, -2.3409981833059916`, -5.206682610803625`, \
-1.5119300878777509`, -3.877572858901246`, -0.54429724639661`, \
-2.71863911017752`, -4.720466309132462`, -4.9525515879098805`, 
   0.7471418147389777`, -0.7476753577979416`, -2.0373110008808197`, \
-2.2646947237306243`, 5.119048907352052`, 7.431707238981527`, 
   6.210342150215659`, -3.432918073555193`, -1.2724627838605187`, \
-2.5942814891801476`, 1.6379652872900294`, 
   1.8672442571174344`, -2.178087718675407`, 
   0.511717534220395`, -0.12794872714807326`, -3.493540043669867`, \
-2.076520676407341`, -0.020149221736978973`, -0.23566065497338684`, \
-0.9865291935808429`, -0.7274734194559436`, -0.08506759516156492`, \
-0.5359663222662654`, -2.372956774837462`, -1.5096330893537484`, 
   0.8687632738817399`, -1.8208987088858706`, -1.6012141611738784`, 
   1.7474049593318028`, 2.0618021152562562`, -0.3578432908793836`, 
   5.4607600668245055`, 2.831853971353688`, 
   0.9958723615545395`, -3.973835080221228`, 
   1.7249884984446382`, -0.9668510202178453`, 0.025070997030766762`, 
   1.3498754178110701`, 
   0.3039176050052319`, -1.5328993929300694`, -1.342354373782186`, 
   0.014071932471644288`, 1.1270691117867102`, 4.927260371512951`, 
   9.091993757162534`, 0.6464858344433324`, 2.598030745145927`, 
   6.84962621619767`};

don1 = {871.4281994478697`, 2358.9651127499164`, 
   497.0197383100749`, -940.3646592912628`, -739.5054930991755`, \
-1492.3180092337025`, -872.4843915093261`, -807.4571701991008`, \
-1051.7738241220868`, -2054.0353238452117`, 1845.0678906068024`, 
   462.55566003359127`, -329.8765141915137`, -1707.3552259982353`, 
   1660.4867031116046`, 1017.803797790395`, 
   711.0912693464415`, -269.40038456466937`, -952.7865411939238`, \
-514.1978049977151`, 680.9316719242015`, 
   859.6573038472379`, -780.5624685756338`, 59.709725844848435`, 
   84.38908186389745`, -1188.6162931806248`, 136.07855613612628`, 
   409.79006512267733`, 
   257.78393246168343`, -272.9260069138363`, -723.128703503171`, \
-377.5180831523867`, -155.24777831126994`, -432.05064088310246`, \
-67.65773696268661`, 
   193.24578222735`, -495.23616890942867`, -885.320612323234`, 
   812.5870090051285`, 868.6291241513609`, 560.2177206343404`, 
   967.5225791749835`, 566.0707853469139`, 2780.472100597479`, 
   26.222127021410415`, 1628.19479341435`, 113.34966858870757`, 
   292.3958115184505`, 
   1151.8488521254912`, -535.5242493191618`, -1240.155476238113`, \
-694.4329951865366`, 3.9872914187872084`, 535.0210633722745`, 
   1872.2482295022128`, 1744.9986746091017`, 555.1551401387915`, 
   293.87713749144314`, 947.3013172212959`}; 

and build a 2-d vector time series

Don = TemporalData[{Transpose@{Range@Length@don1, Standardize@don1}, 
   Transpose@{Range@Length@don1, Standardize@don2}}]
DateListPlot[%, PlotRange -> All] 

I thought the list resulting from CorrelationFunction[Don, {30}] corresponds to the empirical cross-covariance between the variables. But while

In[10]:= Correlation[don1, don2]

Out[10]= 0.740266

we have that :

In[13]:= QuantityMagnitude@
 Last@Transpose@First@CorrelationFunction[Don, {30}]["Paths"]
DateListPlot[CorrelationFunction[Don, {30}], 
 PlotRange -> All] (* Croisé *)

Out[13]= {1., 0.337196, 0.0717911, 0.0248392, 0.0893278, -0.00237899, \
-0.0203818, -0.128466, -0.170179, -0.0440539, 0.00504939, -0.114143, \
-0.0579385, 0.0900887, 0.135494, 0.0894005, 0.0555025, 0.0411966, \
-0.0582309, 0.0361019, 0.0501823, -0.0542087, -0.0280744, -0.0237793, \
-0.0048104, 0.0363897, 0.0376791, 0.109378, 0.0411235, -0.0551814, \
-0.141162}

But with lag 0, the correlation should be 0.74! So, it seems that the function above is the autocovariance of don1*don2, which is different from their cross-covariance. Am I right?

Thanks in advance,

Claude

POSTED BY: Claude Mante
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract