nonlinear regression: untransformed data
TRANSCRIPT
![Page 1: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/1.jpg)
1
Nonlinear Regression: Untransformed Data
http://nm.MathForCollege.comTransforming Numerical Methods Education for STEM Undergraduates
![Page 2: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/2.jpg)
Nonlinear Regression
π¦ πππ¦ ππ₯
π¦ππ₯π π₯
Some popular nonlinear regression models:
1. Exponential model:
2. Power model:
3. Saturation growth model:
4. Polynomial model: π¦ π0 π1π₯ . . . πππ₯
http://numericalmethods.eng.usf.edu2
![Page 3: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/3.jpg)
Nonlinear Regression
Given n data points (x1,y1), β¦β¦ (xn,yn), best fit π¦ π π₯
to the data, where π π₯ is a nonlinear function of π₯
Figure. Nonlinear regression model for discrete y vs. x data
π¦ π π₯
π₯ , π¦
π₯ , π¦
π₯ ,π¦
π₯ , π¦π¦ π π₯
http://numericalmethods.eng.usf.edu3
![Page 4: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/4.jpg)
Exponential Model
π₯ , π¦ , π₯ , π¦ , ... , π₯ ,π¦Given best fit π¦ ππ to the data.
Figure. Exponential model of nonlinear regression for y vs. x data
π¦ ππ
π₯ , π¦
π₯ ,π¦
π₯ ,π¦
π₯ ,π¦ π¦ ππ
http://numericalmethods.eng.usf.edu4
![Page 5: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/5.jpg)
Finding Constants of Exponential Model
ππ π¦ ππ
The sum of the square of the residuals is defined as
Differentiate with respect to a and b
ππππ 2 π¦ ππ π 0
ππππ 2 π¦ ππ ππ₯ π 0
http://numericalmethods.eng.usf.edu5
![Page 6: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/6.jpg)
Finding Constants of Exponential Model
Rewriting the equations, we obtain
π¦ π π π 0
π¦ π₯ π π π₯ π 0
http://numericalmethods.eng.usf.edu6
![Page 7: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/7.jpg)
Finding constants of Exponential Model
π¦ π₯ πβ π¦ πβ π π₯ π 0
πβ π¦ πβ π
Solving the first equation for a yields
http://numericalmethods.eng.usf.edu7
π¦ π₯ π π π₯ π 0
![Page 8: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/8.jpg)
Example 1-Exponential Model
t(hrs) 0 1 3 5 7 91.000 0.891 0.708 0.562 0.447 0.355
Many patients get concerned when a test involves injection of a radioactive material. For example for scanning a gallbladder, a few drops of Technetium-99m isotope is used. Half of the Technetium-99m would be gone in about 6 hours. It, however, takes about 24 hours for the radiation levels to reach what we are exposed to in day-to-day activities. Below is given the relative intensity of radiation as a function of time.
Table. Relative intensity of radiation as a function of time.
πΎ
http://numericalmethods.eng.usf.edu8
![Page 9: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/9.jpg)
Example 1-Exponential Model cont.
Find: a) The value of the regression constants π΄ πandb) The half-life of Technetium-99mc) Radiation intensity after 24 hours
The relative intensity is related to time by the equationπΎ π΄π
http://numericalmethods.eng.usf.edu9
![Page 10: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/10.jpg)
Plot of data
http://numericalmethods.eng.usf.edu10
![Page 11: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/11.jpg)
Constants of the Model
The value of Ξ» is found by solving the nonlinear equation
π π πΎ π‘ πβ πΎ πβ π
π‘ π 0
π΄β πΎ πβ π
πΎ π΄π
http://numericalmethods.eng.usf.edu11
![Page 12: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/12.jpg)
Plotting the Equation in MATLAB
t (hrs) 0 1 3 5 7 9Ξ³ 1.000 0.891 0.708 0.562 0.447 0.355
http://numericalmethods.eng.usf.edu12
![Page 13: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/13.jpg)
Setting up the Equation in MATLAB
t=[0 1 3 5 7 9]gamma=[1 0.891 0.708 0.562 0.447 0.355]syms lamdasum1=sum(gamma.*t.*exp(lamda*t));sum2=sum(gamma.*exp(lamda*t));sum3=sum(exp(2*lamda*t));sum4=sum(t.*exp(2*lamda*t));f=sum1-sum2/sum3*sum4;
http://numericalmethods.eng.usf.edu13
![Page 14: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/14.jpg)
Calculating the Other Constant
The value of A can now be calculated
π΄β πΎ πβ π
0.9998
The exponential regression model then isπΎ 0.9998 π .
http://numericalmethods.eng.usf.edu14
![Page 15: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/15.jpg)
Plot of data and regression curve
.
http://numericalmethods.eng.usf.edu15
![Page 16: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/16.jpg)
Relative Intensity After 24 hrs
The relative intensity of radiation after 24 hours πΎ 0.9998 π .
6.3160 10
This result implies that only6.316 10
0.9998 100 6.317%
radioactive intensity is left after 24 hours.
http://numericalmethods.eng.usf.edu16
![Page 17: Nonlinear Regression: Untransformed Data](https://reader031.vdocuments.us/reader031/viewer/2022012413/616d874bd74ecd10e960574c/html5/thumbnails/17.jpg)
Homework
β’ What is the half-life of Technetium-99m isotope?
β’ Write a program in the language of your choice to find the constants of the model.
β’ Compare the constants of this regression model with the one where the data is transformed.
β’ What if the model was
http://numericalmethods.eng.usf.edu17
πΎ π