Nonlinear Regression Models and Constants

Nonlinear Regression Models and Constants
Slide Note
Embed
Share

From exponential to power models, this content explores various nonlinear regression models and the process of finding constants for them. The focus is on understanding the relationships between data pairs and fitting the best model to the given data. The discussion includes techniques like differentiating with respect to variables and conducting tests to determine solutions. Embrace a deeper understanding of nonlinear regression through this informative content.

  • Regression Models
  • Constants
  • Nonlinear
  • Data Fitting
  • Regression Analysis

Uploaded on Apr 04, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Regression Reading While Skimming the Lines

  2. 6.04 Nonlinear Regression http://nm.mathforcollege.com

  3. Nonlinear Regression Without Transformation of Data (Untransformed Data) 3

  4. Nonlinear Regression Popular nonlinear regression models. Given ? data pairs ?1,?1, ?2,?2, . . . ??,?? 1. Exponential model: ? = ???? 2. Power model: ? = ??? ?? ?+? 3. Saturation growth model: ? = 4. Polynomial model: ? = ?0+ ?1? + ?2?2+ + ???? 4 http://nm.MathForCollege.com

  5. Nonlinear Regression Given ?1,?1, ?2,?2, . . . ??,??, best fit ? = ?(?) to the data. (??,??) (?2,?2) ? = ?(?) (??,??) ?? ?(??) (?1,?1) Figure. Nonlinear regression model for discrete y vs. x data 5 http://nm.MathForCollege.com

  6. Exponential Model Given ?1,?1, ?2,?2, . . . ??,??, best fit ? = ???? to the data. The variables ? and ? are the constants of the exponential model. (?1,?1) ? = ???? ?? ????? (??,??) (?2,?2) (??,??) Figure. Exponential model of nonlinear regression for y vs. x data 6 http://nm.MathForCollege.com

  7. Finding Constants of Exponential Model ? 2 ?? ????? ??= ?=1 ??? ??= 0 ??? ??= 0 Follow this by 1) second derivative test to show solution corresponds to local minimum 2) showing above gives only one acceptable real solution 3) Recognizing that ?? is a differentiable function of ? and ?. 7 http://nm.MathForCollege.com

  8. Finding Constants of Exponential Model ? 2 ?? ????? ??= ?=1 Differentiate with respect to ? ? 2 ?? ????? ??? ??= ???? ?=1 ? 2??????+ 2??2??? = ?=1 ? ? 2??????+ 2??2??? = ?=1 ?=1 ??? ??= 0 ? ? Equation 1 2??????+ 2??2???= 0 ?=1 ?=1 8 http://nm.MathForCollege.com

  9. Finding Constants of Exponential Model ? 2 ?? ????? ??= ?=1 Differentiate with respect to ? ? ??? ??= 2 ?? ????? ??????? ?=1 ? 2?????????+ 2?2???2??? = ?=1 ? ? 2?????????+ 2?2???2??? = ?=1 ?=1 ??? ??= 0 ? ? 2?????????+ 2?2???2???= 0 Equation 2 ?=1 ?=1 9 http://nm.MathForCollege.com

  10. Finding Constants of Exponential Model ? ? Equation 1 2??????+ 2??2???= 0 ?=1 ?=1 ? ? ??????+ 2? ?2???= 0 2 ?=1 ?=1 ? ? ?2???= 2 ?????? 2? ?=1 ?=1 ? ?????? ?2??? ? = ?=1 ? ?=1 10 http://nm.MathForCollege.com

  11. Finding Constants of Exponential Model ? ?????? ?2??? ? = ?=1 ? ?=1 ? ? Equation 2 2?????????+ 2?2???2???= 0 ?=1 ?=1 ? ? ????????+ 2?2 ???2???= 0 2? ?=1 ?=1 ? ? ????????+ ? ???2???= 0 ?=1 ?=1 ? ? ? ?????? ?2??? ????????+ ?=1 ???2???= 0 ? ?=1 ?=1 ?=1 11 http://nm.MathForCollege.com

  12. Example - Exponential Model 0 10 0.76 20 0.58 30 0.45 45 0.31 90 0.12 ? 1.0 ? Use the regression model y = ????. Estimate the regression constants ? and ? without transforming the data. 12 http://nm.MathForCollege.com

  13. Plot of data 0 10 0.76 20 0.58 30 0.45 45 0.31 90 0.12 ? 1.0 ? 13 http://nm.MathForCollege.com

  14. Constants of the Model ? = ???? The value of ?is found by solving the nonlinear equation ?(?) = ? ?????? ?2??? ? = ?=1 ? ?=1 14 http://nm.MathForCollege.com

  15. Setting up the Equation in MATLAB ?(?) = 0 10 0.76 20 0.58 30 0.45 45 0.31 90 0.12 ? 1.0 ? 15 http://nm.MathForCollege.com

  16. Setting up the Equation in MATLAB ?(?) = x=[0 10 20 30 45 90] y=[1.0 0.76 0.58 0.45 0.31 0.12] syms b real sum1=sum(y.*x.*exp(b*x)); sum2=sum(y.*exp(b*x)); sum3=sum(exp(2*b*x)); sum4=sum(x.*exp(2*b*x)); f=-sum1+sum2/sum3*sum4; b_soln=vpasolve(f,b); ? = 0.02561 16 http://nm.MathForCollege.com

  17. Calculating the Other Constant ? = 0.02561 The value of ?can now be calculated ? = ?=1 ?=1 6 ?????? ?2???= 0.9885 6 The exponential regression model is ? = 0.9885 ? 0.02561? 17 http://nm.MathForCollege.com

  18. Plot of data and regression curve ? = 0.9885? 0.02561? 18 http://nm.MathForCollege.com

  19. Transformed vs Untransformed Data 0 10 0.76 20 0.58 30 0.45 45 0.31 90 0.12 ? 1.0 ? Untransformed data model ? = 0.9885 ? 0.02561? Transformed data model ? = 0.9395? 0.02294?

  20. Classwork/Homework: Transformed vs Untransformed Data ? 0 10 1.0 0.76 0.58 20 30 0.45 45 0.31 90 0.12 ? What if the model was ? = ???? What is the solution with and without transformation? Untransformed data model ? = ? 0.02605? Transformed data model ? = ? 0.02400? 20 http://nm.MathForCollege.com

  21. What polynomial model to choose if one needs to be chosen?

  22. Which model to choose? ? = 0.00001228?2+ 0.006196? + 6.015 ? = 0.009387? + 6.025

  23. Optimum Polynomial: Wrong Criterion Both graphs are same Left one starts at m=1 Right one starts at m=2

  24. Optimum Polynomial: Correct Criterion Both graphs are same Left one starts at m=1 Right one starts at m=2

  25. 6.05 Adequacy of Linear Regression Models http://nm.mathforcollege.com

  26. Data y vs x 6.5 6 5.5 5 4.5 y 4 3.5 3 2.5 2 -350 -300 -250 -200 -150 -100 -50 0 50 100 x

  27. Therm exp coeff vs temperature ? is in ?? ? is in ???/??/ ?? T 80 6.47 T -140 4.91 60 6.36 -160 4.72 40 6.24 -180 4.52 20 6.12 -200 4.30 0 6.00 -220 4.08 -20 5.86 -240 3.83 -260 3.58 -40 5.2 -280 3.33 -60 5.58 -300 3.07 -80 5.43 -320 2.76 -100 5.28 -340 2.45 -120 5.09

  28. Is this adequate? Straight Line Model

  29. Quality of Fitted Data Does the model describe the data adequately? How well does the model predict the response variable predictably?

  30. Linear Regression Models Limit our discussion to adequacy of straight-line regression models

  31. Four checks 1. Does the model look like it explains the data? 2. Do 95%of the residuals fall with 2 standard error of estimate? 3. Is the coefficient of determination acceptable? 4. Does the model meet the assumption of random errors?

  32. Check 1:Plot Model and Data T 80 T -140 6.47 4.91 -160 4.72 60 6.36 -180 4.52 40 6.24 -200 4.30 20 6.12 -220 4.08 0 6.00 ? = 6.0248 + 0.0093868? -240 3.83 -20 5.86 -260 3.58 -40 5.2 -280 3.33 -60 5.58 -300 3.07 -80 5.43 -320 2.76 -100 5.28 -340 2.45 -120 5.09

  33. Check 2: Using Standard Error of Estimate ? = (6.0248 + 2 0.1700) + 0.0093868? ? = 6.0248 + 0.0093868? ? = (6.0248 2 0.1700) + 0.0093868? ?? ??/?= ??/?=0.1700 ? 2

  34. Problem Assigned Given (2,4), (2,5), (3,5) and (3,6) as data points 1) Regress to a general straight line, ? = ?0+?1?. (Answer: y=1x+2.5) 2) Find the standard error of estimate (Ans: 0.7071). 3) Find the scaled residuals (Answer: -0.7071 0.7071 -0.7071 0.7071).

  35. Check 3: Using Coefficient of Determination

  36. Final Exam Grade Final Exam Grades 100 90 80 Final Exam Grade 70 60 50 40 0 10 20 30 40 50 60 Student No

  37. Final Exam Grade vs Pre-Req GPA 100 90 FInal Exam Scores 80 70 60 50 40 1 1.5 2 2.5 3 3.5 4 4.5 5 y = 9.8669x + 41.75; R = 0.2227 R=0.4719 Pre-Requisite GPA

  38. Problem Assigned Given (2,4), (2,5), (3,5) and (3,6) as data points (extension of previous problem) 1) Find the sum of the square of the differences with the mean (Ans: 2). 2) Find the sum of the square of the residuals. (Ans: 1) 3) Find the coefficient of determination (Ans: 0.5). 4) Find the correlation coefficient (Ans: 0.7071).

  39. Check 4. Does the model meet assumption of random errors?

  40. Model meets assumption of random errors Residuals are negative as well as positive Variation of residuals as a function of the independent variable is random Residuals follow a normal distribution There is no autocorrelation between the data points.

  41. Are residuals negative and positive? 0.3 0.2 0.1 Residual 0 -0.1 -0.2 -0.3 -0.4 -350 -300 -250 -200 -150 -100 -50 0 50 100 T

More Related Content