Question: 1: Sample Mean and Variance In this problem, you will be asked to use NumPy to calculate sample mean and variance of a data set
1: Sample Mean and Variance In this problem, you will be asked to use NumPy to calculate sample mean and variance of a data set in two ways: 1. First using numpy to perform the calculations indicated by the formulas for these values, and 2. Then using built-in NumPy functions for the mean and variance. We start with a discussion of the necessary formulas. Given a collection of ? numerical observations ?1,?2,...,??, the sample mean ? and sample variance ?2 of the observations are given by the following formulas: Sample mean: ?= 1 ? ? ?? ?=1 =1 ? Sample variance: ?2 = 1 ?1 ? (?1 ?2 ??) (???)2 ?=1 = 1 ?1 Create a code cell to perform the following steps: [(?1 ?)2 (?2 ?)2 (?? ?)2] 1. Create an array x containing the following integers: 10, 16, 26, 12, 17, 22, 14, 12, 21, 16 2. Store the length of this array in a variable n. 3. Calculate the sample mean, storing the result in mean. You may use np.sum() in your calculation. 4. Calculate an array named diff that stores the differences between each value in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
