3 Problem 3 Download the file salmon_data.csv included with the homework. Make sure this file is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3 Problem 3 Download the file salmon_data.csv included with the homework. Make sure this file is in the same folder as your homework file. This file contains the annual Chinook salmon counts taken at Bonneville on the Columbia river (in the second column) from the years 1938 to 2021 (in the first column) 2. In this problem, we will fit this data with a curve to predict salmon populations. (a) Load salmon_data.csv in your solution script. The data has two vectors: year is the year and salmon is the salmon count in the corresponding year. You do NOT need to upload this file to Gradescope. Your code will be tested using the counts for another species of salmon. Because of this, your code should not have any answers hard-coded in: your code needs to work for whatever data set is provided. 2Data from www.cbr.washington.edu (b) Use polyfit to find the line of best fit (degree 1). Save the coefficients for the polynomial as an array to the variable A22. (c) Use polyfit to find the best-fit polynomial of degree 3 for this data. Save the coefficients for the polynomial as an array to the variable A23. (Note: you may get a warning here, ignore it.) (d) Use polyfit to find the best-fit polynomial of degree 5 for this data. Save the coefficients for the polynomial as an array to the variable A24. (Note: you may get a warning here, ignore it.) (e) You now have three models for predicting the number of salmon in a given year: a degree-1 polynomial, a degree-3 polynomial, and a degree-5 polynomial. Call these three polynomials p, p3, and p5 respectively. Let's see how these models extrapolate to the future. The number of Chinook Salmon in 2022 was 752638. For each of the three polynomials, find the percentage error between what your polynomial predicts is the number of salmon in 2022 and the true number of salmon. In other words, calculate err1 = err3 = err5 = p1 (2022) 752638| - 752638 |P3 (2022) 752638| 752638 P3 (2022) 752638| - 752638 Save erri as A25, err3 as A26, and err5 as A27. Warning: Make sure that you are evaluating p(2022) using the built-in python function for doing so, otherwise your answer will not be within the Gradescope error tolerance. (f) Which of these 3 models should we choose based on their abilities to extrapolate? Save A28 as either 1, 3, or 5, based on which model is best based on our errors. 3 Problem 3 Download the file salmon_data.csv included with the homework. Make sure this file is in the same folder as your homework file. This file contains the annual Chinook salmon counts taken at Bonneville on the Columbia river (in the second column) from the years 1938 to 2021 (in the first column) 2. In this problem, we will fit this data with a curve to predict salmon populations. (a) Load salmon_data.csv in your solution script. The data has two vectors: year is the year and salmon is the salmon count in the corresponding year. You do NOT need to upload this file to Gradescope. Your code will be tested using the counts for another species of salmon. Because of this, your code should not have any answers hard-coded in: your code needs to work for whatever data set is provided. 2Data from www.cbr.washington.edu (b) Use polyfit to find the line of best fit (degree 1). Save the coefficients for the polynomial as an array to the variable A22. (c) Use polyfit to find the best-fit polynomial of degree 3 for this data. Save the coefficients for the polynomial as an array to the variable A23. (Note: you may get a warning here, ignore it.) (d) Use polyfit to find the best-fit polynomial of degree 5 for this data. Save the coefficients for the polynomial as an array to the variable A24. (Note: you may get a warning here, ignore it.) (e) You now have three models for predicting the number of salmon in a given year: a degree-1 polynomial, a degree-3 polynomial, and a degree-5 polynomial. Call these three polynomials p, p3, and p5 respectively. Let's see how these models extrapolate to the future. The number of Chinook Salmon in 2022 was 752638. For each of the three polynomials, find the percentage error between what your polynomial predicts is the number of salmon in 2022 and the true number of salmon. In other words, calculate err1 = err3 = err5 = p1 (2022) 752638| - 752638 |P3 (2022) 752638| 752638 P3 (2022) 752638| - 752638 Save erri as A25, err3 as A26, and err5 as A27. Warning: Make sure that you are evaluating p(2022) using the built-in python function for doing so, otherwise your answer will not be within the Gradescope error tolerance. (f) Which of these 3 models should we choose based on their abilities to extrapolate? Save A28 as either 1, 3, or 5, based on which model is best based on our errors.
Expert Answer:
Related Book For
Integrated Accounting
ISBN: 978-1285462721
8th edition
Authors: Dale A. Klooster, Warren Allen, Glenn Owen
Posted Date:
Students also viewed these programming questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Explain the benefits of graphs over tables in presenting data.
-
Howard Realty adjusts its accounts monthly but closes them only at the end of the calendar year. Below are the adjusted balances of the revenue and expense accounts at September 30 of the current...
-
What are the reasons why, even if it is in the best interests of every other country to limit prescription drug prices, it might not be in the best interests of the United States to limit those...
-
Jack DeCoster owned Quality Egg, LLC, an Iowa egg production company. Jacks son, Peter DeCoster, served as the companys chief operating officer. Jack also owned and operated several egg production...
-
Given the following network with activity times in months, determine the earliest start and finish times, latest start and finish times, and slack for each activity. Indicate the critical path and...
-
Draw a diagram with the wage-setting relation and price-setting relation. Label your wage-setting curve WS and your price setting line PS. Label the y axis the Real Wage and the x axis the...
-
Knowing your audience is one of the initial steps to being able to create a persuasive argument. Given that this class is about business plan development, identify who the potential audiences of your...
-
A debt of $2,500 at 5% simple interest is due two years from today. debtor makes a payment of $650 six months from now and 10 months after this payment makes a second payment of $1000, Calculate the...
-
A sample of 148 male general managers of three-star andfour-star hotels had mean BSRI femininity score x-bar= 5.29 . Themean score for the general male population is ?=5.19 . Do hotelmanagers, on the...
-
For an assignment this week for my Java class I am supposed to use a provided sample code that cannot be edited, and add a method called isPalindrome. The full code is supposed to retrieve string...
-
One basketball statistic is the "assist-to-turnover" ratio(assists are good, turnovers are bad). During part of theseason, Emma had 3 assists and 6 turnovers, Molly had13 assists and 18 turnovers,...
-
The profit on investment earned by Super Constructions Company for five successive years was: 20 percent, 30 percent, -30 percent, 50 percent and 300 percent. What is the geometric mean rate of...
-
5.00 mole of nitrogen (N 2 ) gas and 5.00 mole of argon (Ar) gas are in separate, equal-sized, insulated containers at the same temperature. The containers are then connected and the gases (assumed...
-
Before the latest financial crisis and recession, when was the largest recession of the past 50 years, and what was the cumulative loss in output over the course of the slowdown?
-
The following problem provides practice of the applications described in this chapter. Step 1: Remove the Audit Test Questions 1-B at the end of this problem and fill in the answers as you work...
-
In this problem, you will process transactions involving fixed assets for Savoy Merchandise Co. for the month of November 2013. In addition, you will complete the monthly accounting cycle. The...
-
What is the purpose of the Tax Tables tab in the Setup Accounting System window?
-
Why has subordinate legislation come to prominence?
-
What are the advantages of a settlement over a court trial?
-
Define appellant ; respondent ; counterclaim ; counsel ; bench ; writ ; settlement ; pleadings ; party and party costs ; res judicata .
Study smarter with the SolutionInn App