# Re: Compute a weighted correlation

*From*: "Ray Koopman" <koopman@xxxxxx>*Date*: 13 Feb 2006 14:57:15 -0800

youngjin.michael@xxxxxxxxx wrote:

Hello,

Is there a way to assign weights to data before compute a simple

correlation?

I was googling, but not able to find any answer to this.

Thanks in advance.

Young-Jin

Weighted Mean:

m[x;w] = (sum_i w_i*x_i)/(sum_i w_i)

Weighted Covariance:

c[x,y;w] = (sum_i w_i*(x_i - m[x;w])*(y_i - m[y;w]))/(sum_i w_i)

Weighted Correlation:

r[x,y;w] = c[x,y;w]/sqrt(c[x,x;w]*c[y,y;w])

.

**References**:**[Q] Compute a weighted correlation***From:*youngjin . michael

- Prev by Date:
**Question: how do I know if my simulation program works?** - Next by Date:
**Re: Question: probability, unfair coin** - Previous by thread:
**[Q] Compute a weighted correlation** - Next by thread:
**Question: how do I know if my simulation program works?** - Index(es):