doubt regarding covariance

38 views
Skip to first unread message

Tanuja Nair

unread,
Nov 10, 2020, 9:50:46 AM11/10/20
to Discussion forum for Statistics for Data Science I
Good evening,

I am still finding difficulty in calculating the sample and population covariance. Can you please explain this to me?

Thank you

Malabika Guha Mustafi

unread,
Nov 10, 2020, 10:56:13 AM11/10/20
to Discussion forum for Statistics for Data Science I, Tanuja Nair
@ Tanuja , it is quite straight.
 First step. take mean of x variables.
compute  (xi-x mean) for each element.

Same things for y variable also.
Take mean of y variable  and compute (yi-ymean) for each element.

Now, multiply the two values for each corresponding data point.
That mean if you take first data point for x ( xi-x mean) where x=1
then it should be multiplied by (yi-y mean) where I=1 for y value.

Then take the sum of this each data points product ( xi-x mean) *( yi-y mean).

Finally, for population covariance just divide the sum by N( n is the total observations).
For , sample covariance just divide the sum by (n-1)[n is the total observations).

Tanuja Nair

unread,
Nov 10, 2020, 11:07:00 AM11/10/20
to Discussion forum for Statistics for Data Science I, Malabika Guha Mustafi, Tanuja Nair
thank you so much! 

Malabika Guha Mustafi

unread,
Nov 10, 2020, 11:15:21 AM11/10/20
to Discussion forum for Statistics for Data Science I, Tanuja Nair, Malabika Guha Mustafi
Please correct it,
That means if you take first data point for x ( xi-x mean) where i=1
then it should be multiplied by (yi-y mean) where i=1 for y value.
Reply all
Reply to author
Forward
0 new messages