Re: correlation of random variables



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
.



Relevant Pages

  • Re: correlation of random variables
    ... the theoretical statistics are only approached by the practical calculations. ... that which xcorr produces does indeed reflect the mean ... the true correlation coefficient between two random variables. ...
    (comp.soft-sys.matlab)
  • Re: correlation of random variables
    ... that which xcorr produces does indeed reflect the mean ... the true correlation coefficient between two random variables. ...
    (comp.soft-sys.matlab)
  • Re: multicollinearity in regression
    ... I could use Analysis of Covariance but 2 of the independent variables ... I'm guessing that in the model with LOGSIZE, the LOGSIZE coefficient is ... multicollinearity: it may be that you can then see a sensible approach ... I always find it helpful to calculate the correlation coefficient ...
    (sci.stat.consult)
  • Re: distribution of sample correlation coefficient
    ... I am wanting to use the measured correlation ... coefficient rho is known and deterministic. ... distribution might be a reasonable model as it is ... A large-sample approximation for the sampling distribution of r can be obtained from Fisher's z. ...
    (sci.stat.math)
  • Re: significance of correlation affected by sample size?
    ... > Thom wrote: ... the coefficient of Xj is r times sy (std. ... > Pearson r for simple regression or the partial correlation between ... > themselves rather useless in the sense already discussed. ...
    (sci.stat.edu)

Loading