Question: Let's consider data from soft tissue mechanical testing ( Given below ) . Complete the following curve fitting tasks using PYTHON code. import numpy as

Let's consider data from soft tissue mechanical testing (Given below). Complete the following curve fitting tasks using PYTHON code.
import numpy as np
x=np.array ([1,1.1,1.2,1.3,1.4,1.5,1.6]) #
y= np.array ([20,45,70,150,230,350,500]) # sigma
Create separate figures for questions (a) to (d). Separate the code into sections using " #%%". Submit the code and figures as a single pdf file to Blackboard.
(a) Perform linear regression. Plot data points and the fitted curve. Print coefficient of determination (R2) value on the plot. The R2 value should be clearly visible on the plot. (30 pts )
(b) Perform regression using your personal favorite model equation (cannot be same as part(a) or (c)). However, the model must provide a R2 value better than linear regression. Plot data points and fitted curve. Print coefficient of determination (R2), value and the model equation with best-fit coefficients on the plot. (30 pts )
(c) Perform nonlinear regression using the following model. (40 pts )
=k1k2exp(k2E)-k3k4exp(2k4E)
with upper and lower bounds (from 0 to infinity) for all the parameters k1,k2,k3, and k4. We have shown in class (Lecture 19) that this regression problem could be prone to optimization difficulty known as local optima. To mitigate this issue, we can start with multiple initial guesses.
Use the initial guesses of k1=1,5,10,k2=1,5,10,k3=1,5,10, and k4=1,5,10(these lead to 81 combinations in total), perform regression using all possible combinations of initial parameters, store the regression results (resulting parameters and optimized error function values, a.k.a, sum of squares of residuals) of each initial guess. This can be done by using nested for loops.
Then, print the best parameter set with smallest optimized error function value (consider using numpy.argmin function on the optimized error function values which returns the index of the minimum, the index can be used to retrieve the best parameters). Plot data points with the best fitted curve, and R2 value.
Let's consider data from soft tissue mechanical

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!