Physics 114: Lecture 14 Linear Fitting

Slides:



Advertisements
Similar presentations
Modeling of Data. Basic Bayes theorem Bayes theorem relates the conditional probabilities of two events A, and B: A might be a hypothesis and B might.
Advertisements

Chapter 10 Curve Fitting and Regression Analysis
P M V Subbarao Professor Mechanical Engineering Department
Regression Analysis Using Excel. Econometrics Econometrics is simply the statistical analysis of economic phenomena Here, we just summarize some of the.
Read Chapter 17 of the textbook
Linear fits You know how to use the solver to minimize the chi^2 to do linear fits… Where do the errors on the slope and intercept come from?
Chi Square Distribution (c2) and Least Squares Fitting
Linear Simultaneous Equations
Linear Functions.
Calibration & Curve Fitting
Physics 114: Lecture 17 Least Squares Fit to Polynomial
EGR 1101 Unit 7 Systems of Linear Equations in Engineering (Chapter 7 of Rattan/Klingbeil text)
Least-Squares Regression
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Physics 114: Lecture 15 Probability Tests & Linear Fitting Dale E. Gary NJIT Physics Department.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Physics 114: Exam 2 Review Lectures 11-16
Linear Regression James H. Steiger. Regression – The General Setup You have a set of data on two variables, X and Y, represented in a scatter plot. You.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
GG 313 Geological Data Analysis Lecture 13 Solution of Simultaneous Equations October 4, 2005.
Scientific Computing General Least Squares. Polynomial Least Squares Polynomial Least Squares: We assume that the class of functions is the class of all.
GRAPHING AND RELATIONSHIPS. GRAPHING AND VARIABLES Identifying Variables A variable is any factor that might affect the behavior of an experimental setup.
Graphing Most people at one time or another during their careers will have to interpret data presented in graphical form. This means of presenting.
Economics 173 Business Statistics Lecture 10 Fall, 2001 Professor J. Petry
Math 4030 – 11b Method of Least Squares. Model: Dependent (response) Variable Independent (control) Variable Random Error Objectives: Find (estimated)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
1 Simple Linear Regression and Correlation Least Squares Method The Model Estimating the Coefficients EXAMPLE 1: USED CAR SALES.
WEEK 6 Day 1. Progress report Thursday the 11 th.
MathematicalMarketing Slide 5.1 OLS Chapter 5: Ordinary Least Square Regression We will be discussing  The Linear Regression Model  Estimation of the.
Richard Kass/F02P416 Lecture 6 1 Lecture 6 Chi Square Distribution (  2 ) and Least Squares Fitting Chi Square Distribution (  2 ) (See Taylor Ch 8,
Statistics 350 Lecture 2. Today Last Day: Section Today: Section 1.6 Homework #1: Chapter 1 Problems (page 33-38): 2, 5, 6, 7, 22, 26, 33, 34,
CSE 330: Numerical Methods. What is regression analysis? Regression analysis gives information on the relationship between a response (dependent) variable.
An Inverse Function.
Physics 114: Lecture 16 Least Squares Fit to Arbitrary Functions
Physics 114: Lecture 13 Probability Tests & Linear Fitting
Equations Quadratic in form factorable equations
Statistical Data Analysis - Lecture /04/03
Physics 114: Lecture 14 Linear Fitting
Physics 114: Exam 2 Review Weeks 7-9
The Inverse of a Square Matrix
FE Exam Tutorial
OPSE 301: Lab13 Data Analysis – Fitting Data to Arbitrary Functions
Physics 114: Exam 2 Review Material from Weeks 7-11
LESSON 21: REGRESSION ANALYSIS
Chi Square Distribution (c2) and Least Squares Fitting
Physics 114: Lecture 11 Error Analysis, Part II
GRAPHS AND RELATIONSHIPS
Systems of Linear Equations in Engineering
Linear regression Fitting a straight line to observations.
Computer Engineering Majors Authors: Autar Kaw, Luke Snyder
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.
Use Inverse Matrices to Solve 2 Variable Linear Systems
The Simple Linear Regression Model: Specification and Estimation
John Federici NJIT Physics Department
PRELIMINARY MATHEMATICS
5.2 Least-Squares Fit to a Straight Line
5.4 General Linear Least-Squares
M248: Analyzing data Block D UNIT D2 Regression.
Regression Lecture-5 Additional chapters of mathematics
The quadratic formula.
Discrete Least Squares Approximation
Mathematical Sciences
Learning Targets Students will be able to: Compare linear, quadratic, and exponential models and given a set of data, decide which type of function models.
Lecture # 2 MATHEMATICAL STATISTICS
Equations Quadratic in form factorable equations
Objectives Compare linear, quadratic, and exponential models.
Using matrices to solve Systems of Equations
Regression and Correlation of Data
Presentation transcript:

Physics 114: Lecture 14 Linear Fitting John Federici NJIT Physics Department

New Jersey Trivia Which of the following inventions/ discoveries were NOT made at Bell Laboratories? Discovery of cosmic microwave background radiation – Evidence of the Big Bang Invention of the Transistor Cooling and Trapping of atoms using laser light Invention of CCD (charge –coupled device) semiconductor imaging sensors The telephone Unix computer operating system Electron Diffraction which demonstrated wave nature of matter The programming languages C and C++ https://en.wikipedia.org/wiki/Bell_Labs

New Jersey Trivia Which of the following inventions/ discoveries were NOT made at Bell Laboratories? The telephone – Alexander Graham Bell’s invention which started AT&T. https://en.wikipedia.org/wiki/Bell_Labs

Least Squares Fit to a Straight Line There are many situations where we can measure one quantity (the dependent variable) with respect to another quantity (the independent variable). For instance, we might measure the position of a car vs. time, where the position is the dependent variable and time the independent variable. If the velocity is constant, we expect a straight line Let us generically call the dependent variable y for this discussion, and the independent variable x. Then we can write such a linear relationship as , where a and b are constants. Here is a plot of points with noise, showing a linear relationship, and a straight line that goes through the points.

Least Squares Fit to a Straight Line Here are several plots with lines through the points. Which one do you think is the best fit? It is surprisingly easy to see by eye which one fits best, but what does your brain do to determine this? It is minimizing c2! Let’s go through the problem analytically.

Minimizing Chi-Square We start with a smooth line of the form which is the “curve” we want to fit to the data. The chi-square for this situation is To minimize any function, you know that you should take the derivative and set it to zero. But take the derivative with respect to what? Obviously, we want to find constants a and b that minimize , so we will form two equations:

Minimizing Chi-Square Now we can rearrange these two equations to obtain two equations in two unknowns (a and b): You can solve this set of simultaneous equations any way you wish. One way is to use Cramer’s Rule of matrix theory, which says Ratios of determinants.

Alternative Math Solution Inverse Matrix Identity Matrix

Linear Regression The solution, then, is where Note that if the errors are all equal (i.e. ), then when you take the ratio of these determinants the errors cancel and we get simpler expressions NOTE: these equations can be shown to be the SAME as given in OPENSTAX textbook page 681.

In Class Exercise Find the linear fit (y=a+xb) to the experimental data listed in the syllabus for this weeks lectures. What is the best fit a and b? What is the value of χ2? Plot on the same graph the experimental data as data points and the BEST FIT to the data as a straight line. For this exercise, do NOT use Matlabs built-in fitting functions. Instead SUM the vectors using the SUM function.