ABE425 Engineering Measurement Systems Ordinary Least Squares (OLS) Fitting Dr. Tony E. Grift Dept. of Agricultural & Biological Engineering University.

Slides:



Advertisements
Similar presentations
Things to do in Lecture 1 Outline basic concepts of causality
Advertisements

Ordinary Least-Squares
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
1 Chapter 13 Curve Fitting and Correlation This chapter will be concerned primarily with two separate but closely interrelated processes: (1) the fitting.
Statistical Techniques I EXST7005 Simple Linear Regression.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
6-1 Introduction To Empirical Models 6-1 Introduction To Empirical Models.
Chapter 10 Curve Fitting and Regression Analysis
Ch11 Curve Fitting Dr. Deshi Ye
Definition  Regression Model  Regression Equation Y i =  0 +  1 X i ^ Given a collection of paired data, the regression equation algebraically describes.
EGR 105 Foundations of Engineering I
Read Chapter 17 of the textbook
Lecture 3 Cameron Kaplan
Section 4.2 Fitting Curves and Surfaces by Least Squares.
Curve Fitting and Interpolation: Lecture (IV)
EGR 105 Foundations of Engineering I Fall 2007 – week 7 Excel part 3 - regression.
Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological.
Week Lecture 3Slide #1 Minimizing e 2 : Deriving OLS Estimators The problem Deriving b 0 Deriving b 1 Interpreting b 0 and b 1.
Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean.
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Linear regression models in matrix terms. The regression function in matrix terms.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Chapter 10 Real Inner Products and Least-Square (cont.)
Non-Linear Simultaneous Equations
Least-Squares Regression
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Linear Regression Analysis Additional Reference: Applied Linear Regression Models – Neter, Kutner, Nachtsheim, Wasserman The lecture notes of Dr. Thomas.
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
CPE 619 Simple Linear Regression Models Aleksandar Milenković The LaCASA Laboratory Electrical and Computer Engineering Department The University of Alabama.
Simple Linear Regression Models
1 1 Slide Multiple Regression n Multiple Regression Model n Least Squares Method n Multiple Coefficient of Determination n Model Assumptions n Testing.
Scientific Computing Linear Least Squares. Interpolation vs Approximation Recall: Given a set of (x,y) data points, Interpolation is the process of finding.
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
1 1 Slide © 2004 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
MTH 161: Introduction To Statistics
Curve-Fitting Regression
Thomas Knotts. Engineers often: Regress data  Analysis  Fit to theory  Data reduction Use the regression of others  Antoine Equation  DIPPR.
2014. Engineers often: Regress data  Analysis  Fit to theory  Data reduction Use the regression of others  Antoine Equation  DIPPR We need to be.
1 Multiple Regression A single numerical response variable, Y. Multiple numerical explanatory variables, X 1, X 2,…, X k.
Systems of Equations and Inequalities Systems of Linear Equations: Substitution and Elimination Matrices Determinants Systems of Non-linear Equations Systems.
1 11 Simple Linear Regression and Correlation 11-1 Empirical Models 11-2 Simple Linear Regression 11-3 Properties of the Least Squares Estimators 11-4.
Linear Equations in Two Variables A Linear Equation in Two Variables is any equation that can be written in the form where A and B are not both zero.
Ch14: Linear Least Squares 14.1: INTRO: Fitting a pth-order polynomial will require finding (p+1) coefficients from the data. Thus, a straight line (p=1)
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
Engineers often: Regress data to a model  Used for assessing theory  Used for predicting  Empirical or theoretical model Use the regression of others.
Regression Analysis1. 2 INTRODUCTION TO EMPIRICAL MODELS LEAST SQUARES ESTIMATION OF THE PARAMETERS PROPERTIES OF THE LEAST SQUARES ESTIMATORS AND ESTIMATION.
Lecture 8: Ordinary Least Squares Estimation BUEC 333 Summer 2009 Simon Woodcock.
Slide 1- 1 Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
MathematicalMarketing Slide 5.1 OLS Chapter 5: Ordinary Least Square Regression We will be discussing  The Linear Regression Model  Estimation of the.
REGRESSION MODELS OF BEST FIT Assess the fit of a function model for bivariate (2 variables) data by plotting and analyzing residuals.
CORRELATION-REGULATION ANALYSIS Томский политехнический университет.
Linear Regression. Regression Consider the following 10 data pairs comparing the yield of an experiment to the temperature at which the experiment was.
Regression Analysis Part A Basic Linear Regression Analysis and Estimation of Parameters Read Chapters 3, 4 and 5 of Forecasting and Time Series, An Applied.
Plotting in Excel Ken youssefi Engineering 10.
Plotting in Excel KY San Jose State University Engineering 10.
The simple linear regression model and parameter estimation
Chapter 7. Classification and Prediction
11-1 Empirical Models Many problems in engineering and science involve exploring the relationships between two or more variables. Regression analysis.
Ch12.1 Simple Linear Regression
Statistical Methods For Engineers
The Regression Model Suppose we wish to estimate the parameters of the following relationship: A common method is to choose parameters to minimise the.
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 regression.
5.4 General Linear Least-Squares
M248: Analyzing data Block D UNIT D2 Regression.
Regression Lecture-5 Additional chapters of mathematics
Discrete Least Squares Approximation
11C Line of Best Fit By Eye, 11D Linear Regression
Presentation transcript:

ABE425 Engineering Measurement Systems Ordinary Least Squares (OLS) Fitting Dr. Tony E. Grift Dept. of Agricultural & Biological Engineering University of Illinois

First, we need to talk about linearity In Mathematics, there are linear and non-linear operations: If an operation is linear, the superposition principle can be applied:

Examples Multiplication by a constant c (linear)

Examples Differentiation (linear)

Examples Integration (linear)

Examples Squaring (non-linear)

Examples Square root (non-linear)

Try these:

You collected a set of data pairs (for example temperature versus time >> x=[0:1:10]' >> y = [ ]'

Model is some function of the independent variable and the parameter vector. You choose the model!! The error is the difference between a data point and the corresponding model Error = Data - Model

The idea of using the sum of least squared errors came from Gauss (first published by Legendre): How can we minimize this error with respect to the parameter vector? In other words, how can we find the parameter vector that minimizes the error and maximizes the fit? “Sur la Méthode des moindres quarrés” in Legendre’s Nouvelles méthodes pour la détermination des orbites des comètes, Paris 1805.

The minimum value of the sum of squares is obtained by setting this partial derivative to zero The derivative is partial, because the Sum of residuals S is a function of the error and the error itself is a function of the parameter vector (remember the chain rule):

The minimum value of the sum of squares is obtained by setting this partial derivative to zero Substitution of the results from the previous slide gives: Now, we need to find out what is

The proposed model is linear in the parameters. Here is an polynomial example: For each i th measurement this can be written using a matrix and a parameter vector as follows: This can also be written as:

For all measurement points we obtain: This can also be written in vector form as: Where A is the regressor matrix

From the model definition we can obtain the partial derivative with respect to the parameter vector By replacing the error with the (data – model) we get :

Upon rearrangement these become n simultaneous linear equations, the normal equations.

Here a second order polynomial with intercept was applied

Determine whether the data needs an intercept. Often physical constraints demand that the fit curve passes through the origin! No intercept!

OLS lab function [theta, msq] = fitols(x,y,Ovec) % Fit polynomial function on data in OLS sense % Author : % Date : % Revision : % % Syntax : [theta,msq] = fitols(x,y,Ovec) % % theta : Parameter vector % msq : Mean square error % x : Independent variable % y : Dependent variable % % Ovec indicates terms [1 x x^2..]*Ovec' % Example Ovec = [1 0 1] gives [1 x^2] and not x % If vectors x,y are horizontal, transpose them to make them vertical % Make sure the x and y vector have the same length. If not alert the user % with an error dialog box (type help errordlg ) % Build the matrix of regressors. Check each entry of Ovec, and if it is a % 1, add another column to the regression matrix A. A = []; % Compute the parameter vector theta using the OLS formula % Compute the error vector % Compute the mean square error which indicates how good the fit is % Plot y (Temperature in C) versus x (Current in A). Add labels and title. % Your output should look as shown in the handout.

ABE425 Engineering Measurement Systems Ordinary Least Squares (OLS) Fitting The End Dept. of Agricultural & Biological Engineering University of Illinois