Re: correlation of random variables
- From: Peter <peter.b@xxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 10:32:44 -0500
Jeroen wrote:
>
>
> John D'Errico wrote:
>> In article <43de103b$1@cs1>, Jeroen
<no_mail@xxxxxxxxx> wrote:
>>
>>
>>>I agree that for every finite length sample of the random
> processes x
>>>and y, the theoretical statistics are only approached by the
> practical
>>>calculations. But the value of 0.75 is indeed a result of
the
> fact that
>>>x and y both have a (theoretic) mean of 0.5. If I eliminate
this
> mean:
>>>
>>>xcorr(x-0.5,y-0.5,0,'coeff')
>>>
>>>Then I get -4.531932291179145e-004, which approaches zero
(as
>>>theoretically expected). According your first statement:
>>>
>>> > No! The means of a pair of random variables have
absolutely
>>> > nothing to do with their correlation.
>>>
>>>this should also lead to 0.75.
>>>
>>> Jeroen
>>
>>
>> Yes, that which xcorr produces does indeed reflect the mean
>> of the variables, but only because xcorr does not compute
>> the true correlation coefficient between two random variables.
>>
>> It produces the dot product of those variables, as shown by
>> doc xcorr. When 'coeff' is used, it scales by the standard
>> deviations. This is still NOT the true statistical coefficient
>> of correlation between two variables, nor does the xcorr
>> document imply that.
>>
>> <http://mathworld.wolfram.com/CorrelationCoefficient.html>
>>
>> The coefficient of correlation between two random variables
>> is given by
>>
>> sum((x-mean(x)).*(y-mean(y)))/(std(x)*std(y))
>>
>> This is the number that a function like corrcoef will produce.
>> Also note that adding any constant to x or y will have no
>> impact on the coefficient of correlation.
>>
>> The problem is the original poster asked about a correlation
>> coefficient, but then was looking at the output of xcorr.
>>
>> Yes, it is true that the output of xcorr (as opposed to the
>> coefficient of correlation) will have a non-zero component
>> due to the non-zero mean of its inputs.
>>
>> John
>>
>>
>
> Which is also true :) Things can get messed up easily by using
> wrong
> function. Sometimes I'm just too sloppy... I hope that the OP is
> helped
> by both our postings here.
>
> Jeroen
>
yes it is exactly whatI was looking for...
Thanx again
Peter
.
- References:
- Re: correlation of random variables
- From: Jeroen
- Re: correlation of random variables
- From: John D'Errico
- Re: correlation of random variables
- From: Jeroen
- Re: correlation of random variables
- From: John D'Errico
- Re: correlation of random variables
- From: Jeroen
- Re: correlation of random variables
- Prev by Date: Re: How to submit request for added functionality [was: Problems in loading a big .mat file]
- Next by Date: Re: Determining mex compiler
- Previous by thread: Re: correlation of random variables
- Next by thread: Re: correlation of random variables
- Index(es):
Relevant Pages
|
Loading