Grinstead-Snell-Probability · Problem 6.3.25

Sums of Random Variables

Mathematics · correlation

Problem

*When we have pairs of data (xi,yi)(x_i, y_i) that are outcomes of the pairs of dependent random variables XX, YY we can estimate the correlation coefficient ρ\rho by rˉ=∑i(xi−xˉ)(yi−yˉ)(n−1)sXsY ,\bar{r} = \frac{\sum_i (x_i - \bar{x})(y_i - \bar{y})}{(n-1)s_X s_Y}\,, where xˉ\bar{x} and yˉ\bar{y} are the sample means for XX and YY, respectively, and sXs_X and sYs_Y are the sample standard deviations for XX and YY (see Exercise 6.2.17). Write a program to compute the sample means, variances, and correlation for such dependent data. Use your program to compute these quantities for Galton's data on heights of parents and children given in Appendix B. Plot the equal density ellipses as defined in Exercise 23 for r=4,6r = 4, 6, and 88, and on the same graph print the values that appear in the table at the appropriate points. For example, print 12 at the point (70.5,68.2)(70.5, 68.2), indicating that there were 12 cases where the parent's height was 70.5 and the child's was 68.12. See if Galton's data is consistent with the equal density ellipses.

Related theory

Browse the problem library