Question
Problem #2 Recall from the lecture notes that the coefficients in an exponential function y = a0e a1x can be determined by converting the exponential
Problem #2 Recall from the lecture notes that the coefficients in an exponential function y = a0e a1x can be determined by converting the exponential into a linear regression problem. a) Write a user-defined function that takes two vectors as its input arguments that contain the values of xi and yi i = 1, . . . , N in the data set, performs the linear regression, and returns the values of the coefficients a0 and a1. b) Consider the following data giving the population of the earth in billions for selected years between 1850 and 2000: Year: 1850, 1900, 1950, 1980 2000 Population :1.3, 1.6, 3.0, 4.4, 6.0 . Assuming that this population growth data follows roughly an exponential growth curve, use your user-defined function from part (a) to determine the best-fit values of the coefficients a0 and a1 in the exponential function. c) Use a built-in function in Python (curve fit), to determine the coefficients in the exponential function directly, i.e. without using linear regression, and compare with your result in part (b).d) Plot the data and your best-fit curve. Using the best-fit curve [from part (b) or (c)], estimate the population in the year 1970.
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