Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python 3.7 Question 4: (25 points) Dedie a fumetion called i.corar that calculates the sample covariance between two variables. Here are des of the two
python 3.7
Question 4: (25 points) Dedie a fumetion called i.corar that calculates the sample covariance between two variables. Here are des of the two wariables: 7 = 11.5.5.7.8. 12. -2.7.-5.4.8.91 10.1.1.5.0.8. -4.2.2.2.-9.4.-19). Hist: Define two on and ye wing the values above. Then write a function that has the two vectors inputs and value as output. The formula for the sample covariance is Cory :- ) - ) h a d the areas of the x and y vector values, respectively and are the number of observations in your data in the sumber of values you have in your x-vector). Here is the algorithm description in was you can use it as a structure to build your function: 1 Caleate the age of x vector values and assign this value to variable xbar 2. Caleate the average of y vector values and assign this value to variable ybar. 3 S et the w e b from all the values in the vector and store the results in vector S et the w y bar from all the valses in the y vector and store the results is vector Mult i way writion and store is vector sylty with o ut waste divide this wm byl where is the number of values - a with the tell vectos sabo, s. call your f.Covar function with xv and y s you really need to program this function by hand. Do not call a Question 4: (25 points) Dedie a fumetion called i.corar that calculates the sample covariance between two variables. Here are des of the two wariables: 7 = 11.5.5.7.8. 12. -2.7.-5.4.8.91 10.1.1.5.0.8. -4.2.2.2.-9.4.-19). Hist: Define two on and ye wing the values above. Then write a function that has the two vectors inputs and value as output. The formula for the sample covariance is Cory :- ) - ) h a d the areas of the x and y vector values, respectively and are the number of observations in your data in the sumber of values you have in your x-vector). Here is the algorithm description in was you can use it as a structure to build your function: 1 Caleate the age of x vector values and assign this value to variable xbar 2. Caleate the average of y vector values and assign this value to variable ybar. 3 S et the w e b from all the values in the vector and store the results in vector S et the w y bar from all the valses in the y vector and store the results is vector Mult i way writion and store is vector sylty with o ut waste divide this wm byl where is the number of values - a with the tell vectos sabo, s. call your f.Covar function with xv and y s you really need to program this function by hand. Do not call a Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started