R. Kass/Sp07P416/Lecture 71 More on Least Squares Fit (LSQF) In Lec 5, we discussed how we can fit our data points to a linear function (straight line)

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

The Maximum Likelihood Method
Welcome to PHYS 225a Lab Introduction, class rules, error analysis Julia Velkovska.
CmpE 104 SOFTWARE STATISTICAL TOOLS & METHODS MEASURING & ESTIMATING SOFTWARE SIZE AND RESOURCE & SCHEDULE ESTIMATING.
Regression Greg C Elvers.
Physics 114: Lecture 16 Linear and Non-Linear Fitting Dale E. Gary NJIT Physics Department.
Experimental Uncertainties: A Practical Guide What you should already know well What you need to know, and use, in this lab More details available in handout.
G. Cowan Lectures on Statistical Data Analysis 1 Statistical Data Analysis: Lecture 10 1Probability, Bayes’ theorem, random variables, pdfs 2Functions.
Maximum likelihood Conditional distribution and likelihood Maximum likelihood estimations Information in the data and likelihood Observed and Fisher’s.
Engineering Computation Curve Fitting 1 Curve Fitting By Least-Squares Regression and Spline Interpolation Part 7.
Lecture 5 Curve fitting by iterative approaches MARINE QB III MARINE QB III Modelling Aquatic Rates In Natural Ecosystems BIOL471 © 2001 School of Biological.
Linear and generalised linear models
Chi Square Distribution (c2) and Least Squares Fitting
Linear and generalised linear models
Maximum likelihood (ML)
Physics 114: Lecture 17 Least Squares Fit to Polynomial
Least-Squares Regression
Physics 114: Lecture 15 Probability Tests & Linear Fitting Dale E. Gary NJIT Physics Department.
Introduction l Example: Suppose we measure the current (I) and resistance (R) of a resistor. u Ohm's law relates V and I: V = IR u If we know the uncertainties.
LINEAR REGRESSION Introduction Section 0 Lecture 1 Slide 1 Lecture 5 Slide 1 INTRODUCTION TO Modern Physics PHYX 2710 Fall 2004 Intermediate 3870 Fall.
T-test Mechanics. Z-score If we know the population mean and standard deviation, for any value of X we can compute a z-score Z-score tells us how far.
880.P20 Winter 2006 Richard Kass Propagation of Errors Suppose we measure the branching fraction BR(Higgs  +  - ) using the number of produced Higgs.
Chapter 15 Modeling of Data. Statistics of Data Mean (or average): Variance: Median: a value x j such that half of the data are bigger than it, and half.
880.P20 Winter 2006 Richard Kass 1 Confidence Intervals and Upper Limits Confidence intervals (CI) are related to confidence limits (CL). To calculate.
880.P20 Winter 2006 Richard Kass 1 Maximum Likelihood Method (MLM) Does this procedure make sense? The MLM answers this question and provides a method.
R. Kass/W03P416/Lecture 7 1 Lecture 7 Some Advanced Topics using Propagation of Errors and Least Squares Fitting Error on the mean (review from Lecture.
Lecture 3: Inference in Simple Linear Regression BMTRY 701 Biostatistical Methods II.
Section 8.1 Estimating  When  is Known In this section, we develop techniques for estimating the population mean μ using sample data. We assume that.
Physics 114: Exam 2 Review Lectures 11-16
LECTURE 2. GENERALIZED LINEAR ECONOMETRIC MODEL AND METHODS OF ITS CONSTRUCTION.
R Kass/SP07 P416 Lecture 4 1 Propagation of Errors ( Chapter 3, Taylor ) Introduction Example: Suppose we measure the current (I) and resistance (R) of.
LECTURER PROF.Dr. DEMIR BAYKA AUTOMOTIVE ENGINEERING LABORATORY I.
Lecture 4 Basic Statistics Dr. A.K.M. Shafiqul Islam School of Bioprocess Engineering University Malaysia Perlis
20 March 2009College Algebra Ch.41 Chapter 4 Exponential & Logarithmic Functions.
Ch4 Describing Relationships Between Variables. Section 4.1: Fitting a Line by Least Squares Often we want to fit a straight line to data. For example.
Curve-Fitting Regression
Lab 3b: Distribution of the mean
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
Error and Error Analysis. Types of error Random error – Unbiased error due to unpredictable fluctuations in the environment, measuring device, and so.
© Copyright McGraw-Hill Correlation and Regression CHAPTER 10.
Summary Part 1 Measured Value = True Value + Errors = True Value + Errors Errors = Random Errors + Systematic Errors How to minimize RE and SE: (a)RE –
LECTURE 3: ANALYSIS OF EXPERIMENTAL DATA
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
NON-LINEAR REGRESSION Introduction Section 0 Lecture 1 Slide 1 Lecture 6 Slide 1 INTRODUCTION TO Modern Physics PHYX 2710 Fall 2004 Intermediate 3870 Fall.
1 Introduction to Statistics − Day 4 Glen Cowan Lecture 1 Probability Random variables, probability densities, etc. Lecture 2 Brief catalogue of probability.
Machine Learning 5. Parametric Methods.
Sampling Design and Analysis MTH 494 Lecture-21 Ossam Chohan Assistant Professor CIIT Abbottabad.
R.Kass/F02 P416 Lecture 1 1 Lecture 1 Probability and Statistics Introduction: l The understanding of many physical phenomena depend on statistical and.
Chapter 3 Exponential & Logarithmic Functions. 3.1 Exponential Functions Objectives –Evaluate exponential functions. –Graph exponential functions. –Evaluate.
G. Cowan Lectures on Statistical Data Analysis Lecture 9 page 1 Statistical Data Analysis: Lecture 9 1Probability, Bayes’ theorem 2Random variables and.
PHYSICS 2150 LABORATORY Dr. Laurel Mayhew TA: Geruo A Lab Coordinator: Jerry Leigh Lecture 4b February 27, 2007.
CHAPTER- 3.2 ERROR ANALYSIS. 3.3 SPECIFIC ERROR FORMULAS  The expressions of Equations (3.13) and (3.14) were derived for the general relationship of.
CHAPTER- 3.1 ERROR ANALYSIS.  Now we shall further consider  how to estimate uncertainties in our measurements,  the sources of the uncertainties,
R. Kass/W03 P416 Lecture 5 l Suppose we are trying to measure the true value of some quantity (x T ). u We make repeated measurements of this quantity.
CHAPTER 4 ESTIMATES OF MEAN AND ERRORS. 4.1 METHOD OF LEAST SQUARES I n Chapter 2 we defined the mean  of the parent distribution and noted that 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,
Fundamentals of Data Analysis Lecture 11 Methods of parametric estimation.
The Maximum Likelihood Method
Physics 114: Lecture 13 Probability Tests & Linear Fitting
Ch3: Model Building through Regression
The Maximum Likelihood Method
The Maximum Likelihood Method
Correlation and Regression
Today (2/16/16) Learning objectives (Sections 5.1, 5.2, and 5.3):
Chi Square Distribution (c2) and Least Squares Fitting
Lecture 4 Propagation of errors
5.2 Least-Squares Fit to a Straight Line
5.4 General Linear Least-Squares
Propagation of Error Berlin Chen
MGS 3100 Business Analysis Regression Feb 18, 2016
Presentation transcript:

R. Kass/Sp07P416/Lecture 71 More on Least Squares Fit (LSQF) In Lec 5, we discussed how we can fit our data points to a linear function (straight line) and get the "best" estimate of the slope and intercept. However, we did not discuss two important issues: I) How to estimate the uncertainties on our slope and intercept obtained from a LSQF? II) How to apply the LSQF when we have a non-linear function? Estimation of Errors on parameters determined from a LSQF Assume we have data points that lie on a straight line: y =  +  x Assume we have n measurements of the x’s and y's. For simplicity, assume that each y measurement has the same error, . Assume that x is known much more accurately than y.  ignore any uncertainty associated with x. Previously we showed that the solution for the intercept  and slope  is: Some Advanced Topics using Propagation of Errors and Least Squares Fitting

R. Kass/Sp07P416/Lecture 72 Since  and  are functions of the measurements (y i 's) we can use the Propagation of Errors technique to estimate   and  . Assume that:a) Each measurement is independent of each other (  xy =0). b) We can neglect any error (  ) associated with x. c) Each y measurement has the same , i.e.  i = . See lecture 4 (general formula for 2 variables) assumption a) assumption b) assumption c) plugging our formula for 

R. Kass/Sp07P416/Lecture 73 We can find the variance in the slope (  ) using exactly the same procedure: variance in the intercept

R. Kass/Sp07P416/Lecture 74 n If we don't know the true value of  we can estimate the variance using the spread between the measurements (y i ’s) and the fitted values of y: n  2= number of degree of freedom = number of data points  number of parameters (  ) extracted from the data n If each y i measurement has a different error  i : The above expressions simplify to the “equal variance” case. Don't forget to keep track of the “n’s” when factoring out equal  ’s. For example: variance in the slope weighted slope and intercept

R. Kass/Sp07P416/Lecture 75 x y  y x Previous fit to: f(x,b)=1+bx, b=1.05 New fit to: f(x,b)=a+bx, a =1.158 ± b=1.011 ± Example: Fit to straight line (same data as Lec 6) Errors on a and b calculated using: a and b calculated using weighted fit (Taylor, P 198) χ 2 =0.65 for 2 degrees of freedom P(χ 2 >0.65 for 2dof) = 72%

R. Kass/Sp07P416/Lecture 76 l LSQF with non-linear functions: u For our purposes, a non-linear function is a function where one or more of the parameters that we are trying to determine (e.g. ,  from the straight line fit) is raised to a power other than 1. n Example: functions that are non-linear in the parameter  : However, these functions are linear in the parameters A. u The problem with most non-linear functions is that we cannot write down a solution for the parameters in a closed form using, for example, the techniques of linear algebra (i.e. matrices). n Usually non-linear problems are solved numerically using a computer. n Sometimes by a change of variable(s) we can turn a non-linear problem into a linear one. Example: take the natural log of both sides of the above exponential equation: lny=lnA-x/  =C+Dx Now a linear problem in the parameters C and D! In fact it’s just a straight line! To measure the lifetime  (Lab 7) we first fit for D and then transform D into . u Example: Decay of a radioactive substance. Fit the following data to find N 0 and  : n N represents the amount of the substance present at time t. n N 0 is the amount of the substance at the beginning of the experiment (t = 0). n  is the lifetime of the substance.  = -1/D

R. Kass/Sp07P416/Lecture 77 i titi NiNi y i = ln N i n The intercept is given by: C = 4.77 = ln A or A = Lifetime Data time, t ln[N(t)]

R. Kass/Sp07P416/Lecture 78 u Example : Find the values A and  taking into account the uncertainties in the data points. n The uncertainty in the number of radioactive decays is governed by Poisson statistics. n The number of counts N i in a bin is assumed to be the average (  ) of a Poisson distribution:  = N i = Variance n The variance of y i (= ln N i ) can be calculated using propagation of errors: n The slope and intercept from a straight line fit that includes uncertainties in the data points: If all the  's are the same then the above expressions are identical to the unweighted case.  =4.725 and  =  = -1/  = -1/ = sec n To calculate the error on the lifetime (  ), we first must calculate the error on  : The experimentally determined lifetime is:  = ± 12.3 sec. Taylor P198 and problem 8.9

R. Kass/Sp07P416/Lecture 79 Least Squares Fitting-Exponential Example We can calculate the  2 to see how “good” the data fits an exponential decay distribution: For this problem: lnA=4.725  A= and  = sec Poisson approximation The chi sq per dof is 1.96 The chi sq prob. is 4.9 % Mathematica Calculation: Do[{csq=csq+(cnt[i]-a*Exp[-x[i]/tau])^2/(a*Exp[-x[i]/tau])},{i,1,10}] Print["The chi sq per dof is ",csq/8] xvt=1-CDF[ChiSquareDistribution[8],csq]; Print["The chi sq prob. is ",100*xvt,"%"] This is not such a good fit since the probability is only ~4.9%.

R. Kass/Sp07P416/Lecture 710 The Error on the Mean Error on the mean (review from Lecture 4) Question: If we have a set of measurements of the same quantity: What's the best way to combine these measurements? How to calculate the variance once we combine the measurements? Assuming Gaussian statistics, the Maximum Likelihood Method says combine the measurements as: If all the variances (   1 =   2 =   3..) are the same: The variance of the weighted average can be calculated using propagation of errors: weighted average unweighted average  x =error in the weighted mean And the derivatives are:

R. Kass/Sp07P416/Lecture 711 If all the variances are the same: The error in the mean (  x ) gets smaller as the number of measurements (n) increases. Don't confuse the error in the mean (  x ) with the standard deviation of the distribution (  )! If we make more measurements: The standard deviation (  ) of the (gaussian) distribution remains the same, BUT the error in the mean (  x ) decreases Lecture 4 Example: Two experiments measure the mass of the proton: Experiment 1 measures m p =950±25 MeV Experiment 2 measures m p =936±5 MeV Using just the average of the two experiments we find: m p =( )/2=943MeV Using the weighted average of the two experiments we find: m p =(950/ /5 2 )/(1/ /5 2 )=936.5MeV and the variance:  2 =1/(1/ /5 2 )=24 MeV 2  =4.9 MeV Since experiment 2 was more precise than experiment 1 we would expect the final result to be closer to experiment 2’s value. m p =(936.5±4.9) MeV