56 3.14 Finding the difference equation from data When we are given data as a number of pairs (x,y), we may expect a relation of the form y = a bx. We have seen that this solution often arises when we seek to solve the difference equation P(t+1) = R P(t) since the solution is then P(t) = P(0) R t. Just as for linear regression and quadratic regression, however, it is usually the case that there is no single curve that exactly includes all the data. In this situation, the best formula y = a bx is called the exponential regression formula. The method of computing it on the calculator is exactly analogous to the method for computing linear or quadratic regression. You enter the data as two lists. The difference is that in the last step there is a different button to obtain exponential regression. Example. Suppose we expect that P(t) = a bt for certain constants a and b. We are given the following data: t P(t) 0 2.336 2 3.055 5 4.515 6 5.163 7 5.821 Use exponential regression to find the best fitting curve. Give the constants to 4 significant figures. Solution. We enter the data as lists L1 and L2. In the TI-85 and TI-86 we use the button EXPR from the STAT/CALC menu. On the TI-83 we use ExpReg (option 0). We find P(t) = 2.344 (1.140)t Note that the best fit does NOT have P(0) = 2.336. The formula for exponential regression allows for the possibility that there is some uncertainty or error in the measured P(0), and it makes a corresponding correction. But for more complicated situations we may not expect a formula P(t) = a bt. Often, instead we have knowledge of the form of the difference equation. The procedure will mimic that in Chapter 2. Our procedure will depend on how many data are given to us: Example. Theory suggests that the population data satisfy the difference equation P(t+1) = a P(t) + b Suppose we know the following data: t P(t) 0 4 1 8 2 14 (a) Find the difference equation. (b) Tell P(3) Solution. (a) We need to find the parameters a and b. We first see what equations they must solve. 57 If we replace t by 0 we obtain P(1) = a P(0) + b. Hence 4a+b=8 If we replace t by 1 we obtain P(2) = a P(1) + b. Hence 8 a + b = 14 These yield two equations in the two unknowns a and b. We solve the system 4a+b=8 8 a + b = 14 From the second equation we have b = 14 - 8 a. Substituting into the first equation we obtain 4 a + (14 - 8a) = 8 -4 a = -6 a = 1.5 From b = 14 - 8 a we obtain b = 14 - 8(1.5) = 2. Hence the difference equation is P(t+1) = 1.5 P(t) + 2 (b) Now P(3) = 1.5 P(2) + 2 = 1.5 (14) + 2 = 23. The procedure in the example works when the number of equations that we can infer from the data equals the number of unknown parameters. When there are more equations than data, we must use regression. Example. Theory suggests that the population data satisfy the difference equation P(t+1) = a P(t) + b Suppose we know t P(t) 0 10 1 14 2 20 3 29 4 36 5 48 (a) Use regression to find the best-fitting difference equation. Give numbers to 3 significant figures. (b) Predict P(6) to 3 significant figures. Solution. We know P(t+1) = a P(t) + b. From t = 0 we have the equation 10 a + b = 14. From t = 1 we have the equation 14 a + b = 20. From t = 2 we have the equation 20 a + b = 29. From t = 3 we have the equation 29 a + b = 36. From t = 4 we have the equation 36 a + b = 48. We are therefore seeking an equation y = a x + b with the (x,y) data pairs being (10,14), (14,20), (20,29), (29,36), (36,48). This corresponds to a linear regression with the data x y 10 14 14 20 20 29 29 36 58 36 48 We perform linear regression using these data, either on the calculator or on the computer. We obtain y = 1.2421 x + 2.3218 Hence regression says, to 3 significant figures, that the best-fitting difference equation of the desired form is P(t+1) = 1.24 P(t) + 2.32 (b) We predict P(6) = 1.24 P(5) + 2.32 = 1.24 (48) + 2.32 = 61.84. The answer, to 3 significant figures, is P(6) = 61.8.