5.1 Introduction to Curve Fitting why do we fit data to a function? the shape of probability distributions when curve fitting - normal, Poisson, and normal with scale changes the method of maximum likelihood as a strategy for optimizing parameters 5.1 : 1/10
Why Curve Fitting? (1) An equation parameter is the end goal of the experiment. As an example, consider a first order chemical reaction, A B, where the concentration of A is measured as a function of time. C(t) = a0exp(-a1t) Let the dependent variable, C(t), have noise following a normal pdf. In such an experiment, the independent variable, t, is for all practical purposes noise-free. The goal of the experiment is to determine the rate constant, a1. To determine a0 and a1, the coefficients are adjusted until a "best fit" is found. For the example shown, the true values were a0 = 2.48 and a1 = 0.312. The best fit values were a0 = 2.60 and a1 = 0.33. a0 and a1 are dependent random variables. 5.1 : 2/10
Why Curve Fitting? (2) Curve fitting is an optimal strategy for testing multiple hypotheses. Consider the determination of molar absorptivity. The simplest strategy is to prepare a solution with an accurate concentration and measure the absorption several times. A preferred strategy is to prepare a series of solutions having different molar concentrations. A plot is then made of A versus C. For a 1-cm pathlength cell, the slope equals e. Ai = A0 + eCi Now two hypotheses can be tested in addition to determining the molar absorptivity. (1) A0 belongs to a pdf having 0 as its mean. This tests for the presence of unsuspected absorbers or instrumental offsets. (2) The data are described well by a straight line. This tests for chemical or instrumental failures of Beer's law. 5.1 : 3/10
f(x) = 2 + 0.5x + 0.3x2 (1) The contour graph at the left shows y as a function of x when g(y) is a normal pdf. The graph at the right shows g(y) for x' = 2 and x' = 8. Note that the width of the pdf is constant. The mean is given by f(x'). 5.1 : 4/10
f(x) = 2 + 0.5x + 0.3x2 (2) The contour graph at left shows y as a function of x when g(y) has a Poisson pdf. A common example would be data from a counting experiment. The graph at the right shows g(y) for x' = 2 and x' = 8. Note that the width of the pdf increases with x'. The mean is given by f(x'). 5.1 : 5/10
f(x) = 2 + 0.5x + 0.3x2 (3) The contour graph at left shows y as a function of x when g(y) is represented by two different normal pdfs. Over the range, 0 x 5, s = 2, while over the range, 5 < x 10, s = 1. The graph at the right shows g(y) for x' = 2 and x' = 8. The width of the pdf changes at x' = 5. This is supposed to reflect how noise might be reduced due to a decrease in instrumental sensitivity. 5.1 : 6/10
f(x) = 2 + 0.5x + 0.3x2 (4) In practice one measurement of y is made for each independently chosen value of x. The graph shows this for 11 values. The goal is to estimate the parameters of the equation. If there were no noise, the parameters could be determined by making three measurements and solving three simultaneous equations. When noise is present a probability-based method is used to estimate the parameters. Because of randomness in y, if a second set of 11 measurements are made, the estimates of the coefficients will vary randomly. 5.1 : 7/10
Probability for a Set of Values Consider the probability of obtaining a single measurement from a Poisson pdf. Now write the product representing the probability of observing N values from the same Poisson pdf. Expand the product in order to collect terms. The numerator can be converted into a summation and brought in front of the product operator. The result is the total probability written in a form more amenable to differentiation. 5.1 : 8/10
Method of Maximum Likelihood The Method of Maximum Likelihood asks the question - what definition of a pdf parameter will maximize the probability of observing the measured set of values? In this example we will ask what definition of m maximizes the probability. Start by taking the partial derivative with respect to the parameter (in this case m) and setting it equal to zero. We then see that the arithmetic average is the estimate of m that yields the highest probability for obtaining the measured set of data. 5.1 : 9/10
Example with m = 12 Two sets of 10 values were obtained from a Poisson pdf having a mean of 12. {10, 12, 18, 14, 16, 12, 16, 12, 14, 14} avg = 13.8 {14, 12, 9, 5, 12, 9, 6, 22,8, 8} avg = 10.5 The total probability graphs are shown below, where ptotal is computed as a function of trial m values. Note that the maximum probability does not correspond to the true value of 12! 5.1 : 10/10