Question: Exercise 1 Write a function variance(x) that calculates the sample variance of the variable in the list x. The formula for the variance is n

Exercise 1 Write a function variance(x) that calculates the sample variance of the variable in the list x. The formula for the variance is n Var(x) (xi 7)? n i=1 where n is the number of items in the list x and T is the average of x. Exercise 2 Write a function covariance(y, x) that calculates the sample covariance of the variables in the lists y and x. The formula for the covariance is n Cov(x) (yi )(xi ), n i=1 where the lists y and x both have length n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
