5: Sometimes a value that is much larger or smaller than the rest of the data...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
5: Sometimes a value that is much larger or smaller than the rest of the data (called an outlier) can throw off the mean. In order to handle this, sometimes the minimum and maximum values from a data set are discarded before the mean is computed. Write a function that will return the mean of the values in a vector, not including the outliers. Assume that the values in the vector are unique. It is okay to use the built-in mean function. To test this, create a vector of 10 random integers, each in the range from 0 to 50, and pass this vector to the function. QUESTION 6: Write a local function in your script that will receive data points in the form of x and y vectors. If the lengths of the vectors are not the same, then they can't represent data points, so an error message should be printed. Otherwise, the function will fit a polynomial of a random degree through the points and will plot the points and the resulting curve with a title specifying the degree of the polynomial. The degree of the polynomial must be less than the number of data points, n, so the function must generate a random integer in the range from 1 to n-1 for the polynomial degree. 5: Sometimes a value that is much larger or smaller than the rest of the data (called an outlier) can throw off the mean. In order to handle this, sometimes the minimum and maximum values from a data set are discarded before the mean is computed. Write a function that will return the mean of the values in a vector, not including the outliers. Assume that the values in the vector are unique. It is okay to use the built-in mean function. To test this, create a vector of 10 random integers, each in the range from 0 to 50, and pass this vector to the function. QUESTION 6: Write a local function in your script that will receive data points in the form of x and y vectors. If the lengths of the vectors are not the same, then they can't represent data points, so an error message should be printed. Otherwise, the function will fit a polynomial of a random degree through the points and will plot the points and the resulting curve with a title specifying the degree of the polynomial. The degree of the polynomial must be less than the number of data points, n, so the function must generate a random integer in the range from 1 to n-1 for the polynomial degree.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Write a function that will return a full name string when passed a first name string, a middle name or initial string, and a last name string. If the middle initial is blank, there should be only one...
-
A uniformly distributed random variable has minimum and maximum values of 20 and 60, respectively. a. Draw the density function. b. Determine P(35 < X < 45). c. Draw the density function including...
-
Is the Gini ratio for Australia larger or smaller than that for Brazil and South Africa? Explain your answer. Households (quintile) Market income (percent of total) Lowest 7 Second 13 Third 18 Fourth...
-
Wilson Publishing Company produces books for the retail market. Demand for a current book is expected to occur at a constant annual rate of 7200 copies. The cost of one copy of the book is $14.50....
-
Consider a competitive market for which the quantities demanded and supplied (per year) at various prices are given as follows: a. Calculate the price elasticity of demand when the price is $80 and...
-
The controller for Tender Bird Poultry, Inc. estimates that the companys fixed overhead is $l0, 0000 per year. She also has determined that the variable overhead is approximately $.10 per chicken...
-
What is the internal rate of return of the following cash flow diagram? a. 20 percent b. 18.2 percent c. 17.5 percent d. 15 percent $30 $31 0 1 2 3 $30 $15
-
Selected transactions from the journal of Roberta Mendez, investment broker, are presented below. Instructions (a) Post the transactions to T-accounts. (b) Prepare a trial balance at August 31,2014....
-
What are some of the most effective ways that companies can detect and prevent inventory and noncash assets fraud? How can companies establish robust internal controls over their inventory and asset...
-
The Garden Ornament Company manufactures two types of garden ornament a duck and a heron The information presented in Tables T1 to T5 has been prepared as a result of discussions by line managers for...
-
Let f(r) 5x +5, g(r) = 4x- 2, and m(r) 5x- 15. Find and simplify composite functions f(g(r)) and m(g(f(x)). Clearly label your answers. %3D %3D
-
Rick and Barb were married in 2010. Since the beginning of their marriage, Rick has been contributing his remaining RRSP room into Barb's Spousal RRSP. The contributions are as follows: 2013: $2,500...
-
1. Create a Fruit Tea Ordering System using a Java program and implement a basic Graphical User Interface that allows the user to input items, select items, perform calculations, and show results....
-
Computer services revenue Net sales (of goods) Total sales and revenue Cost of goods sold Net income Quick assets Current assets Total assets Current liabilities Total liabilities Total equity...
-
On February 2, 2023, the We Love Doctor Who Fan Club ("Who Club") orally ordered 500 custom shirts from Pond Classic Shirts ("Pond"). Pond is well-known in the Doctor Who community. The order is...
-
Harry's Pottery Equipment Company Stock pays a $4.30 dividend. The required rate of return by the investors is 8.0%. Based on the preferred stock (no growth) model, what is the price of the stock?
-
The time line below contains an annuity with cash flow at the end of each period. $1,000 $1,000 $1,000 $1,000 0 1 2 3 4 5 The periodic market interest rate is 12%. From the perspective of a potential...
-
Why is disclosure of depreciation or amortization methods and rates so important?
-
After you have studied Economics in the News on pp. 386387, answer the following questions: a. What is the source of revenue for constructing and maintaining the transportation infrastructure? b. Why...
-
The four-firm concentration ratio for audio equipment makers is 30 and for electric lamp makers it is 89. The HHI for audio equipment makers is 415 and for electric lamp makers is 2,850. Which of...
-
How does monopoly arise?
-
Beginning in the 1920s, Russian physicist Pyotr Kapitza or Kapitsa (18941984, Nobel laureate in physics 1978) measured the Paschen-Back effect to an accuracy of 1 percent to 3 percent in various...
-
Consider transitions from a \({ }^{2} D\) state to a \(2 P\) state in the strong field PaschenBack regime. List all allowed transitions and show that there are only three different spectral lines.
-
What is the longest wavelength of the Paschen series spectrum? Would it be visible to the human eye?
Study smarter with the SolutionInn App