Nonlinear Regression Models and Exponential Models

regression reading while skimming the lines n.w
1 / 56
Embed
Share

Discover the world of nonlinear regression models and exponential models in data analysis. Learn about popular models like exponential, power, saturation growth, polynomial, and logistic. Explore how to find the constants of an exponential model through differentiation and second derivative tests.

  • Regression
  • Nonlinear
  • Exponential
  • Models
  • Data Analysis

Uploaded on | 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) 4

  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+ + ???? ? 5. Logistic model: ? = 1+?(?0+?1?) 6 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 7 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 8 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 ?. 9 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 10 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 11 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 12 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 13 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. 14 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 ? 15 http://nm.MathForCollege.com

  14. Constants of the Model ? = ???? The value of ?is found by solving the nonlinear equation ?(?) = ? ?????? ?2??? ? = ?=1 ? ?=1 16 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 ? 17 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 18 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? 19 http://nm.MathForCollege.com

  18. Plot of data and regression curve ? = 0.9885? 0.02561? 20 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? 22 http://nm.MathForCollege.com

  21. Test 1 score vs attendance Test score vs attendance 100 90 80 70 60 50 40 30 20 y = 0.0873x + 64.045 R = 0.014 10 0 0 20 40 60 80 100

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

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

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

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

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

  27. 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

  28. 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

  29. Is this adequate? Straight Line Model

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

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

  32. 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?

  33. 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

  34. 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

  35. 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).

  36. Check 3: Using Coefficient of Determination

  37. 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).

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

  39. 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.

  40. 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

  41. Is variation of residuals as a function of independent variable random? 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

  42. Do the residuals follow normal distribution?

  43. 06.XX Parting Thoughts http://nm.mathforcollege.com

More Related Content