Download presentation
Presentation is loading. Please wait.
Published byPreston Ralf Hodges Modified over 9 years ago
1
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 1 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Chabot Mathematics §7.4 Least Squares Regression
2
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 2 Bruce Mayer, PE Chabot College Mathematics Review § Any QUESTIONS About §7.3 → Optimization of 2-Variable Functions Any QUESTIONS About HomeWork §7.3 → HW-05 7.3
3
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 3 Bruce Mayer, PE Chabot College Mathematics §7.4 Learning Goals Explore least-squares approximation of data as an optimization problem involving a function of two variables Examine several applied problems using least-squares approximation of data Discuss nonlinear curve-fitting techniques using least-squares approximation
4
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 4 Bruce Mayer, PE Chabot College Mathematics Scatter on plots on XY-Plane A scatter plot usually shows how an EXPLANATORY, or Independent, variable affects a RESPONSE, or Dependent Variable Sometimes the SHAPE of the scatter reveals a relationship Shown Below is a Conceptual Scatter plot that could Relate the RESPONSE to some EXCITITATION
5
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 5 Bruce Mayer, PE Chabot College Mathematics Linear Fit by Guessing The previous plot looks sort of Linear We could use a Ruler to draw a y = mx+b line thru the data But which Line is BETTER? and WHY?
6
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 6 Bruce Mayer, PE Chabot College Mathematics Least Squares Curve Fitting Many Software programs Calculate “fitted” Values of m & b How does the Software Make these Calcs? How Good is the fitted Line Compared to the Data? Most automated curve fitters, use the “Least Squares” Criterion
7
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 7 Bruce Mayer, PE Chabot College Mathematics Least Squares To make a Good Fit, MINIMIZE the |GUESS − data| distance by one of data Best Guess-y Best Guess-x
8
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 8 Bruce Mayer, PE Chabot College Mathematics Least Squares Minimziation To Minimize J take Simultaneously The above produces Two Eqns in the Two UnKnown “Fitting” Parameters, m 0 & b 0
9
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 9 Bruce Mayer, PE Chabot College Mathematics Least Squares cont It is Typical to Minimize the VERTICAL distances; i.e.: Note that The Function J contains two Variables; m & b Recall from the previous text sections that to MINIMIZE a Function of 2-Vars set the 1 st partial Derivatives equal to Zero
10
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 10 Bruce Mayer, PE Chabot College Mathematics Goodness of Fit The Distance from The Best-Fit Line to the Actual Data Point is called the RESIDUAL For the Vertical Distance the Residual is just δy If the Sum of the Residuals were ZERO, then the Line would Fit Perfectly Thus J, after finding m & b, is an Indication of the Goodness of Fit
11
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 11 Bruce Mayer, PE Chabot College Mathematics Goodness of Fit cont Now J is an indication of Fit, but we Might want to SCALE it relative to the MAGNITUDE of the Data For example consider –DataSet1 with x&y values in the MILLIONS –DataSet2 with x&y values in the single digits In this case we would expect J1 >> J2 To remove the affect of Absolute Magnitude, Scale J against the Data Set mean; e.g mean1 = 730 000 mean2 = 4.91
12
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 12 Bruce Mayer, PE Chabot College Mathematics Goodness of Fit cont The Mean-Scaling Quantity is the Actual-Data Relative to the Actual-Mean Finally the Scaled Fit-Metric, “r-squared’ As before the Squaring Ensures that all Terms in the sum are POSITIVE
13
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 13 Bruce Mayer, PE Chabot College Mathematics r 2 = Coeff of Determination The r 2 Value is Also Called the COEFFICIENT OF DETERMINATION J Sum of Residual (errors) –May be Zero or Positive S Data-to-Mean Scaling Factor –Always Positive if >1 Data-Pt and data not “perfectly Horizontal” If J = 0, then there is NO Distance Between the calculated Line and Data Thus if J = 0, then r 2 = 1; so r 2 = 1 (or 100%) indicates a PERFECT FIT
14
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 14 Bruce Mayer, PE Chabot College Mathematics Meaning of r 2 The COEFFICIENT OF DETERMINATION Has This Meaning The coefficient of determination tells you what proportion of the variation between the data points is explained or accounted for by the best line fitted to the points. It indicates how close the points are to the line.
15
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 15 Bruce Mayer, PE Chabot College Mathematics WhiteBoard Derivation Linear Regress Express MTH16_Lec-07a_sec_7-4_Linear-Regression_Least-Squares_Tutorial.pptx
16
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 16 Bruce Mayer, PE Chabot College Mathematics Example Least Squares C p The following data was recorded in an experiment which measured the variation of the specific heat of a chemical with temperature. It is expected that the specific heat (C p ) should depend linearly on the temperature, T T (°C)50 60 70 80 90 100 C p (J/mol-°C)1.61.641.631.651.671.681.71.721.711.721.711.74
17
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 17 Bruce Mayer, PE Chabot College Mathematics Example Least Squares C p For this situation Plot the data on a scatter Graph Fit a straight line to the data by eye; find the slope and intercept of this line; write an equation for this line. Perform a linear regression analysis on the C p data. Write an equation for this line Use the Regression Line Equation to Estimate the specific heat of this chemical when the temperature is 75 & 115 °C.
18
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 18 Bruce Mayer, PE Chabot College Mathematics Example Least Squares C p SOLUTION: The scatter diagram shows each datum plotted with C p on the Y-axis, the Temperature plotted on the X-Axis Now employ software (MATLAB or Excel), or a calculation by hand, to compute the CoEfficients of the Least- Squares Regression Line.
19
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 19 Bruce Mayer, PE Chabot College Mathematics C p Scatter Plot
20
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 20 Bruce Mayer, PE Chabot College Mathematics C p EyeBall & Regression Plots By Regression
21
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 21 Bruce Mayer, PE Chabot College Mathematics C p Interp & Extrap by Regression Using the Regression Equation Interpolate WithIn the Known Data At 75 °C find C p ≈ 1.6808 J/(mol°C) Extrapolate OutSide the Known Data At 115 °C find C p ≈ 1.7705 J/(mol°C) Note that Interpolation is generally much more reliable than Extrapolation
22
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 22 Bruce Mayer, PE Chabot College Mathematics Data Scaling - Normalization The Significance of ANY Data Set Can be Improved by Normalizing Normalize Scale Data such that the Values run: 0 →1 0% → 100% Steps to Normalization 1.Find the MAX & MIN values in the Data Set; e.g., z max & z min 2.Calculate the Data Range, R D R D = (z max – z min ) 3.Calc the Individual Data Differences Relative to the MIN Δz k = z k - z min
23
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 23 Bruce Mayer, PE Chabot College Mathematics Data Scaling – Normailzation cont 4.Finally, Scale the Δz k relative to R D Ψ k = Δz k /R D 5.Scale the corresponding “y” values in the Same Manner to produce say, Φ k 6.Plot Φ k vs Ψ k on x & y scales that Run from 0→1 Example – Do Frogs Croak More on WARM Nites? Temperature (ºF) Croaks/Hr 88.620.0 71.616.0 93.319.8 84.318.4 80.617.1 75.215.5 69.714.7 82.017.1 69.415.4 83.316.2 78.615.0 82.617.2 80.616.0 83.517.0 76.314.1
24
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 24 Bruce Mayer, PE Chabot College Mathematics Normalization Example Normalize T → Θ CPH → Ω Now Compare Plots CPH vs T Ω vs Θ
25
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 25 Bruce Mayer, PE Chabot College Mathematics Plots Compared T-CPH Plot Ω-Θ Plot The Θ-Ω Plot Fully Utilizes Both Axes
26
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 26 Bruce Mayer, PE Chabot College Mathematics Basic Fitting Use MATLAB’s AutoMatic Fitting Utility to Find The Best Line for the the Frog Croaking Data SEE: Demo_Frog_Croak_BasicFit_1110.m
27
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 27 Bruce Mayer, PE Chabot College Mathematics WhiteBoard Work No Problems From §7.4 Did Regression Derivation Instead
28
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 28 Bruce Mayer, PE Chabot College Mathematics All Done for Today m 0 =0 b 0 = y avg
29
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 29 Bruce Mayer, PE Chabot College Mathematics Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Chabot Mathematics Appendix –
30
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 30 Bruce Mayer, PE Chabot College Mathematics P7.1-47 Skin Surface Area Skin Area Formula based on easy to perform Measurements Where –S ≡ Surface Area in sq-meters –W ≡ Person’s mass in kg –H ≡ Height in CentiMeters (cm) Make Contour Plot S(W,H), and find Height for W=18.37kg & S=0.048m2
31
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 31 Bruce Mayer, PE Chabot College Mathematics S(15.8kg,87.11cm) By MuPad S := 0.0072*(W^0.425)*(H^0.725) Sa = subs(S,W=15.83,H=87.11) –In Sq-Meters
32
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 32 Bruce Mayer, PE Chabot College Mathematics
33
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 33 Bruce Mayer, PE Chabot College Mathematics
34
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 34 Bruce Mayer, PE Chabot College Mathematics
35
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 35 Bruce Mayer, PE Chabot College Mathematics Basal Metabolism The Harris-Benedict Power Eqns for Energy per Day in kgCalories Human Males Human Females –h ≡ hgt in cm, A ≡ in yrs, w ≡ weight in kg
36
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 36 Bruce Mayer, PE Chabot College Mathematics Basal Metabolism a)Find Ba := subs(Bm, w=90,h=190,A=22 b)Find Bb := subs(Bf, w=61,h=170,A=27)d
37
BMayer@ChabotCollege.edu MTH16_Lec-01_sec_6-1_Integration_by_Parts.pptx 37 Bruce Mayer, PE Chabot College Mathematics Basal Metabolism c)Find Ac := subs(Am, wm=85, hm=193, Bmm=2108) d)Find Ad := subs(Af, wf=67, hf=173, Bff=1504)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.