Write the missing functions myAverage, myStandardDev, myMin, and myCorrelation in the following code. The formulas for...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the missing functions myAverage, myStandardDev, myMin, and myCorrelation in the following code. The formulas for average (mean), standard deviation and correlation are given below. X + x, + + x. mean deviation = n-1 (x, -xXy,- ) 1-1 import math import random def myAvearage(1st): def myStandardDev(1st): def myMin(1st): def myCorrelation(x, y): def main(): alist = (10, 20, 30, 5e, 80, 90, 100, 15, 125, 128, 150, 185, 200, 240, 260, 280] Blist = [13, 25, 28, 45, 79, 85, 111, 115, 125, 256, 16e, 195, 230, 270, 280, 320] clist - blist.copy() clist.reverse() dlist = [random.randint(1,99) for x in range(1len(alist))] print("Lists:") print("List A = " + str(alist)) print("ListB = " + str(blist)) print("List c = " + str(cList)) print("List D = " + str(dList)) print() print("List A Average = " + str(myAvearage(alist))) print("Standart Deviation of List A = " + str(myStandardDev(alist))) print("Minimum of List A = " + str(myMin(alist))) print() print("List B Average = " + str(myAvearage(alist))) print("Standart Deviation of List B = " + str(myStandardDev(alist))) print("Minimum of List B = " + str(myMin(alist))) print() print("Correlation of List A and B = " + str(myCorrelation(alist, blist))) print("Correlation of List A and C = " + str(myCorrelation(alist, CList))) print("Correlation of List A and D = " + str(myCorrelation(alist, dList))) main() Write the missing functions myAverage, myStandardDev, myMin, and myCorrelation in the following code. The formulas for average (mean), standard deviation and correlation are given below. X + x, + + x. mean deviation = n-1 (x, -xXy,- ) 1-1 import math import random def myAvearage(1st): def myStandardDev(1st): def myMin(1st): def myCorrelation(x, y): def main(): alist = (10, 20, 30, 5e, 80, 90, 100, 15, 125, 128, 150, 185, 200, 240, 260, 280] Blist = [13, 25, 28, 45, 79, 85, 111, 115, 125, 256, 16e, 195, 230, 270, 280, 320] clist - blist.copy() clist.reverse() dlist = [random.randint(1,99) for x in range(1len(alist))] print("Lists:") print("List A = " + str(alist)) print("ListB = " + str(blist)) print("List c = " + str(cList)) print("List D = " + str(dList)) print() print("List A Average = " + str(myAvearage(alist))) print("Standart Deviation of List A = " + str(myStandardDev(alist))) print("Minimum of List A = " + str(myMin(alist))) print() print("List B Average = " + str(myAvearage(alist))) print("Standart Deviation of List B = " + str(myStandardDev(alist))) print("Minimum of List B = " + str(myMin(alist))) print() print("Correlation of List A and B = " + str(myCorrelation(alist, blist))) print("Correlation of List A and C = " + str(myCorrelation(alist, CList))) print("Correlation of List A and D = " + str(myCorrelation(alist, dList))) main()
Expert Answer:
Answer rating: 100% (QA)
import math Library for sqrt import math import random library for random number ge... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Given a normal random variable X with mean 20 and variance 9, and a random sample of size n taken from the distribution, what sample size n is necessary in order that P(19.9 < X < 20.1) = 0.95?
-
The mean and standard deviation for a random variable x are 5.0 and 2.0, respectively. Find the mean and standard deviation if a. each value of x is increased by 3 b. each value of x is multiplied...
-
Hut-to-Palace Ltd. undertook a contract in last year. In the agreement between the Hut- to-Palace Ltd. and the contractee, there is a clause stating that Hut-to-Palace Ltd. will receive total cost...
-
Stock W, X and Y have expected returns of 9.0%, 16.1% and 11.3% respectively. Based on this and the attached information, what is the expected return of your portfolio? Stock W X Y Number of Shares...
-
From the following accounts of Resch Restore, Inc. prepare the businesss statement of retained earnings for the year ended January 31, 2013: Retained Earnings Dividends Clo 10,000 Feb 1 77,000 Apr 30...
-
Suppose that the quantity of corn supplied depends on the price of corn (P) and the amount of rainfall (R). The demand for corn depends on the price of corn and the level of disposable income (I)....
-
Describe the staffing process in an MNE. How does it differ from that of a domestic-only corporation?
-
Kroger, Safeway Inc., and Whole Foods Markets, Inc. are three grocery chains in the United States. Inventory management is an important aspect of the grocery retail business. Recent balance sheets...
-
Selected transactions for Carla Vista Corporation during its first month in business are presented below. Sept. 1 Issued common stock in exchange for $ 2 1 , 8 0 0 cash received from investors. 5...
-
On December 1, Year 1, John and Patty Driver formed a corporation called Susquehanna Equipment Rentals. The new corporation was able to begin operations immediately by purchasing the assets and...
-
Exercise 5: +In the following program, convert form disp to fprintf cleacaclca * = 5; y = 10; 2 = 25; a = x*z/y; disp(a)
-
On her way home from the school board meeting, Kelly fills up her car. She likes the idea of using gasoline with ethanol, but thinks her car can only handle 50% ethanol. At the gas station, she can...
-
Draw the front. And the. Back. And explanation of your new anti-counterfeiting measures PBL: ANTI-COUNTERFEITING ACTIVITY Chapter 10 Directions: Design your own $100 dollar bill. Please incorporate...
-
Find dy dx for the given function. y = x - sec(x) +4 dy dx =
-
Chase went for a hike. He left 8 : 0 0 am . At 1 0 : 0 0 am , he took half hour rest. chase returned home at 1 2 : 0 0 pm ( noon ) . While walking Chase averaged 5 km / h . How far did he hike ?
-
This question is based on the "Find_SR_Again tab of spreadsheet. a) Fill in the highlighted cells using appropriate formulas. b) Can you explain why the two numbers highlighted in red are different?...
-
Not every report needs to include a(n) survey Orecommendation executive summary title page (CSLO 4, 5, 7, 11)
-
A regular deposit of $100 is made at the beginning of each year for 20 years. Simple interest is calculated at i% per year for the 20 years. At the end of the 20-year period, the total interest in...
-
Compounds of europium, Eu, are used to make color television screens. The europium nucleus has a charge of +63. How many electrons are there in the neutral atom? in the Eu3+ ion?
-
One can often see sunbeams passing through the less dense portions of clouds. What is the explanation for this?
-
A salt solution has an osmotic pressure of 17 atmospheres at 22C. What is the freezing point of this solution? What assumptions must be made to solve this problem?
-
a. Show that the mean-squared forecast error \(E\left[\left(\hat{y}_{T+1}-y_{T+1} ight)^{2} \mid I_{T} ight]\) for a forecast \(\hat{y}_{T+1}\), that depends only on past information \(I_{T}\), can...
-
Consider the AR(1) model \(y_{t}=\delta+\theta y_{t-1}+e_{t}\) where \(|\theta|)=0\) and \(\operatorname{var}\left(e_{t} \mid I_{t-1} ight)=\sigma^{2}\). Let \(\bar{y}_{-1}=\sum_{t=2}^{T} y_{t}...
-
Consider a stationary model that combines the \(\operatorname{AR}(2)\) model \(y_{t}=\delta+\theta_{1} y_{t-1}+\theta_{2} y_{t-2}+e_{t}\) with an \(\mathrm{AR}(1)\) error model \(e_{t}=ho...
Study smarter with the SolutionInn App