MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo

Slides:



Advertisements
Similar presentations
Chapter 12 Simple Linear Regression
Advertisements

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Chapter 10 Curve Fitting and Regression Analysis
Definition  Regression Model  Regression Equation Y i =  0 +  1 X i ^ Given a collection of paired data, the regression equation algebraically describes.
P M V Subbarao Professor Mechanical Engineering Department
A Short Introduction to Curve Fitting and Regression by Brad Morantz
Mechanisms Design MECN 4110
Regression Regression: Mathematical method for determining the best equation that reproduces a data set Linear Regression: Regression method applied with.
Read Chapter 17 of the textbook
Curve Fitting and Interpolation: Lecture (IV)
Function Approximation
Least Square Regression
Curve-Fitting Regression
Least Square Regression
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 17 Least Square Regression.
Part 4 Chapter 13 Linear Regression
Engineering Computation Curve Fitting 1 Curve Fitting By Least-Squares Regression and Spline Interpolation Part 7.
Probability & Statistics for Engineers & Scientists, by Walpole, Myers, Myers & Ye ~ Chapter 11 Notes Class notes for ISE 201 San Jose State University.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 CURVE.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Classification and Prediction: Regression Analysis
Calibration & Curve Fitting
Least-Squares Regression
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Regression Analysis Regression analysis is a statistical technique that is very useful for exploring the relationships between two or more variables (one.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Mechanical Measurement and Instrumentation MECN 4600
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
MECN 3500 Inter - Bayamon Lecture 7 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
CISE301_Topic41 CISE301: Numerical Methods Topic 4: Least Squares Curve Fitting Lectures 18-19: KFUPM Read Chapter 17 of the textbook.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Chapter 8 Curve Fitting.
MECN 3500 Lecture 4 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
ES 240: Scientific and Engineering Computation. Chapter 13: Linear Regression 13. 1: Statistical Review Uchechukwu Ofoegbu Temple University.
Curve-Fitting Regression
MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
CHAPTER 3 Model Fitting. Introduction Possible tasks when analyzing a collection of data points: Fitting a selected model type or types to the data Choosing.
10B11PD311 Economics REGRESSION ANALYSIS. 10B11PD311 Economics Regression Techniques and Demand Estimation Some important questions before a firm are.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
Numerical Methods for Engineering MECN 3500
EE3561_Unit 4(c)AL-DHAIFALLAH14351 EE 3561 : Computational Methods Unit 4 : Least Squares Curve Fitting Dr. Mujahed Al-Dhaifallah (Term 342) Reading Assignment.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MECN 3500 Inter - Bayamon Lecture 8 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
MECN 3500 Inter - Bayamon Lecture 6 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Curve Fitting Pertemuan 10 Matakuliah: S0262-Analisis Numerik Tahun: 2010.
Curve Fitting Introduction Least-Squares Regression Linear Regression Polynomial Regression Multiple Linear Regression Today’s class Numerical Methods.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
ABE425 Engineering Measurement Systems Ordinary Least Squares (OLS) Fitting Dr. Tony E. Grift Dept. of Agricultural & Biological Engineering University.
OLS Regression What is it? Closely allied with correlation – interested in the strength of the linear relationship between two variables One variable is.
Chapter 14 Introduction to Regression Analysis. Objectives Regression Analysis Uses of Regression Analysis Method of Least Squares Difference between.
Fitting Equations to Data Chapter 7. Problems Classwork: 7.1, 7.8, 7.13, 7.22 Homework: 7.2, 7.9, 7.16, 7.23, 7.28.
Regression and Correlation of Data Summary
Chapter 4 Basic Estimation Techniques
Fitting Equations to Data
Part 5 - Chapter
Part 5 - Chapter 17.
Chapter 12 Curve Fitting : Fitting a Straight Line Gab-Byung Chae
Part 5 - Chapter 17.
MATH 2140 Numerical Methods
Linear regression Fitting a straight line to observations.
Least Squares Fitting A mathematical procedure for finding the best-fitting curve to a given set of points by minimizing the sum of the squares of the.
Nonlinear Fitting.
Discrete Least Squares Approximation
Least Square Regression
Mechanical Engineering Majors Authors: Autar Kaw, Luke Snyder
SKTN 2393 Numerical Methods for Nuclear Engineers
Presentation transcript:

MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus

Lecture 9 MECN 3500 Inter - Bayamon 2 Tentative Lectures Schedule TopicLecture Mathematical Modeling and Engineering Problem Solving 1 Introduction to Matlab 2 Numerical Error 3 Root Finding System of Linear Equations 7-8 Least Square Curve Fitting 9 Polynomial Interpolation Numerical Integration Ordinary Differential Equations

Lecture 9 MECN 3500 Inter - Bayamon Least-Squares Regression Curve Fitting 3

Lecture 9 MECN 3500 Inter - Bayamon  To Describes techniques to fit curves (curve fitting) to discrete data to obtain intermediate estimates. 4 Course Objectives

Lecture 9 MECN 3500 Inter - Bayamon Curve fitting techniques are used to fit curves to data to obtain intermediate estimates or to derive a simpler function from a complicated function. Least squares regression is used when the data exhibits a significant degree of error or noise. Interpolation is used to fit curves that pass directly through each of the points. Introduction 5

Lecture 9 MECN 3500 Inter - Bayamon Least-squares regression techniques used to fit a curve to experimental data. These techniques used to derive an approximate function that fits the shape or general trend of the data. Techniques: linear regression, polynomial regression, multiple linear regression Linear Regression 6

Lecture 9 MECN 3500 Inter - Bayamon Linear Regression Fit a straight line to a set of paired observations (x 1,y 1 ), (x 2,y 2 ), …, (x n,y n ) The mathematical expression for the straight line is y = a 0 + a 1 x + e e is called the error or “residual” The residual is the difference between the observation and the line: e = y  a 0  a 1 x What are the values of a 0 and a 1 ? 7

Lecture 9 MECN 3500 Inter - Bayamon 1.Minimize the sum of the residual errors Criteria for a Best Fit NO GOOD 8

Lecture 9 MECN 3500 Inter - Bayamon Criteria for a Best Fit 2.Minimize the sum of the absolute values of the residual errors NO GOOD 9

Lecture 9 MECN 3500 Inter - Bayamon Criteria for a Best Fit 3.Minimax: minimize the maximum error NO GOOD 10

Lecture 9 MECN 3500 Inter - Bayamon Criteria for a Best Fit 11 4.Minimize the sum of the squares of the residuals This criterion yields a unique line for a given set of data.

Lecture 9 MECN 3500 Inter - Bayamon Least-Squares Fit of a Straight Line 12 To determine the values of a 0 and a 1, differentiate S r with respect to each of the coefficients and set to zero: The equations become: The normal equations are

Lecture 9 MECN 3500 Inter - Bayamon Least-Squares Fit of a Straight Line 13 The slope and the y-intercept are given by y = a 0 + a 1 x + e a 0 is the intercept a 1 is the slope

Lecture 9 MECN 3500 Inter - Bayamon Least-Squares Fit of a Straight Line 14 The slope and the y-intercept are given by y = a 0 + a 1 x + e a 0 is the intercept a 1 is the slope

Lecture 9 MECN 3500 Inter - Bayamon Example Fit a straight line to the data xixi yiyi

Lecture 9 MECN 3500 Inter - Bayamon 16

Lecture 9 MECN 3500 Inter - Bayamon Quantification of Error of Linear Regression 17 To quantify the error reduction due to describing the data in terms of a straight line, we use the coefficient of determination which is defined as It represents the fraction of variability in y that can be explained by the variability in x (how close the points are to the line). For r 2 = 1, it signifies the line explains 100% of the variability of the data.

Lecture 9 MECN 3500 Inter - Bayamon Example Compute the coefficient of determination for the linear regression in previous example S t = S r = r 2 = This indicates that 86.8% of the original uncertainty is explained by the linear model. Answer

Lecture 9 MECN 3500 Inter - Bayamon Linearization of Nonlinear Relationships 19 Transformations can be used to express the data in a form that is compatible with the linear regression.

Lecture 9 MECN 3500 Inter - Bayamon Linearization of Nonlinear Relationships 20 Example 1: Suppose the relationship between x and y is It can be linearized by taking the ln of both sides: Example 2: Consider It can be transform into the linear form

Lecture 9 MECN 3500 Inter - Bayamon Linearization of Nonlinear Relationships 21 Example 3: Consider It can be linearized by inverting both sides

Lecture 9 MECN 3500 Inter - Bayamon Linearization of Nonlinear Relationships 22

Lecture 9 MECN 3500 Inter - Bayamon Example Fit to the data Answer xy x'y'

Lecture 9 MECN 3500 Inter - Bayamon Polynomial Regression 24 We need to fit a polynomial to data using polynomial regression. A second-order polynomial or quadratic fit is y = a 0 + a 1 x + a 2 x 2 +  The sum of squares of the residues: Differentiate S r with respect to all parameters:

Lecture 9 MECN 3500 Inter - Bayamon Polynomial Regression 25 Set the partials to zero and arrange These equations are called the normal equations. They form a system of linear equations with 3 equations and 3 unknowns. In general, an mth order polynomial requires solving a system of m+1 linear equations.

Lecture 9 MECN 3500 Inter - Bayamon 26

Lecture 9 MECN 3500 Inter - Bayamon Example Fit a second-order polynomial to the data xy

Lecture 9 MECN 3500 Inter - Bayamon Multiple Linear Regression 28 Multiple Linear Regression The function y is a linear function of 2 or more independent variables, such as y = a 0 + a 1 x 1 + a 2 x 2 +  The sum of the squares of the residuals To minimize S r,

Lecture 9 MECN 3500 Inter - Bayamon Multiple Linear Regression 29 The normal equations are

Lecture 9 MECN 3500 Inter - Bayamon 30

Lecture 9 MECN 3500 Inter - Bayamon Example Fit the data with multiple linear regression x1x1 x2x2 y

Lecture 9 MECN 3500 Inter - Bayamon Regression in Matlab and Excel 32 Use the polyfit function Regression in Excel Use Add Trendline Regression in Matlab

Lecture 9 MECN 3500 Inter - Bayamon Homework7  Omar E. Meza Castillo Ph.D. 33