Re: correlation of random variables
- From: John D'Errico <woodchips@xxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 13:53:22 GMT
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
--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945
Those who can't laugh at themselves leave the job to others.
Anonymous
.
- Follow-Ups:
- Re: correlation of random variables
- From: Jeroen
- Re: correlation of random variables
- References:
- correlation of random variables
- From: Peter
- Re: correlation of random variables
- From: Jeroen
- Re: correlation of random variables
- From: John D'Errico
- Re: correlation of random variables
- From: Jeroen
- correlation of random variables
- Prev by Date: RBF neural networks
- Next by Date: Re: for the first time user
- Previous by thread: Re: correlation of random variables
- Next by thread: Re: correlation of random variables
- Index(es):
Relevant Pages
|