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....
-
a. Verify the equation for these data: SS(x) 0 9 2 4
-
In Fig. 19-53, suppose C1 = C2 = C3 = 16.0 F. If the charge on C2 is Q2 = 24.0C, determine the charge on each of the other capacitors, the voltage across each capacitor, and the voltage V across the...
-
A certain data set contains 27 points. The least-squares regression line is computed, with the following results: Construct a 95% confidence interval for 1. b = 5.78, s = 1.35, and (x - x) = 3.4. Se
-
One end of a uniform 4.00-m-long rod of weight Fg is supported by a cable. The other end rests against the wall, where it is held by friction, as in Figure P12.23. The coefficient of static friction...
-
Under the "standardized measurement approach," if a bank's BI amount is 0.9 billion, and its BI component and loss component are respectively $99 million and $120 million, then the required capital...
-
Frank is looking at a new sausage system with an installed cost of $560,000. This cost will be depreciated straight line to zero over the projects five-year life, at the end of which the sausages...
-
An invoice of $2,500 from a supplier has 210, net 30 terms. What amount should be remitted to the supplier if the invoice is paid within the discount period? $2,550.00$ 2,450.00$ 2250.00$ 2150.00$
-
The following adjusted trial balance for Bell Servicing was prepared at the end of the fiscal year, December 3 1 , 2 0 2 3 3 1 , 2 0 2 3 : Account Debit Credit 1 0 1 1 0 1 Cash $ 7 , 3 0 0 7 , 3...
-
Raner, Harris and Chan is a consulting firm that specializes in information systems for medical and dental clinics. The firm has two offices-one in Chicago and one in Minneapolis. The firm classifies...
-
113. Find the correct match for sex determination in Drosophila :- Column-I Column-II (i) 2A+ XXX (a) Male (ii) 3A + XX (b) Super male (iii) 2A + XO (c) Inter sex (iv) 3A+XY (d) Gynandromorph (e)...
-
A mass m attached to the end of a spring on a frictionless horizontal plane is released from rest at t = 0 s from an extended position max. The mass m = 0.2 kg and k = 1 N/m. At wt = 5/4 with w...
-
Provide your personal descriptions by looking below figures: Stock fund (S) Bond fund (B) Risk - free return: Ws 0% 20% 40% 60% 80% 100% Expected Standard Return 15% 9% 1- Ws 100% 80% 60% 40% 20%...
-
Suppose Wesley Publishing's stock has a volatility of 55%, while Addison Printing's stock has a volatility of 20%. If the correlation between these stocks is 75%, what is the volatility of the...
-
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?
-
The peak amplitude of a single-degree-of-freedom system, under a harmonic excitation, is observed to be \(5 \mathrm{~mm}\). If the undamped natural frequency of the system is \(5 \mathrm{~Hz}\), and...
-
A torsional system consists of a disc of mass moment of inertia \(J_{0}=10 \mathrm{~kg}-\mathrm{m}^{2}\), a torsional damper of damping constant \(c_{t}=300 \mathrm{~N}-\mathrm{m}-\mathrm{s} /...
-
The landing gear of an airplane can be idealized as the spring-mass-damper system shown in Fig. 3.52 [3.16]. If the runway surface is described \(y(t)=y_{0} \cos \omega t\), determine the values of...
Study smarter with the SolutionInn App