# Common Core Algebra II.Unit 13.Lesson 9.Other Types of Regression

## Middle School / Math / Algebra

Hello, I'm Kirk weiler, and this is common core algebra two. By E math instruction. Today, we're going to be doing unit 13 lesson number 9 on other types of regression. So in the last lesson, we reviewed some basic facts about linear regression. How to take a set of data to data or two variables. And look at how well they relate to each other from a linear perspective. Well, I'll tell you, you can do regression of all types. There's linear, there's quadratic. There's polynomial. There's exponential. There's logarithmic. There's trigonometric. There are tons of them. And which model you predict depends on a lot of different things. It depends on the physics of the situation. It depends on which model fits the data the best, which model should fit the data the best. It even gets into things called residual plots, which you looked at in common core algebra one, but we're not going to go through in common core algebra two. Today, all we're going to do is look at a little bit of exponential regression. And also introduced you to sign regression, also known as trig regression. All right? So let's take a look. Okay. Exercise number one. The population of Jamestown has been recorded for selected years since 2000. The table below gives these populations. Now, population growth is something that we very often model with exponential phenomenon because often it grows exponentially. So in letter a, it says using your calculator to determine a best fit exponential equation of the form Y equals a times B to the X, where X represents the number of years since 2000 and Y represents the population. Round a to the nearest integer, and B to the nearest thousandth. All right. Well, let's bring out our TI 84 plus. All right. Now, I've already put this data into the TI 84 plus to save us a little bit of time. But let's go check it out. Hit our step button. And let's go into the edit menu. Now in L one, you see two, four, 5, 7, et cetera, because X is supposed to represent the years since 2000, not the actual calendar year. And then of course the population is the 5564, 6121, et cetera. So that's all in there. We are ready to do our exponential regression. So let's hit that stat button again. Let's go over to calculate, and now we have to go down a little ways until we see EXP REG. Exponential regression. All right. Now once we find exponential regression, let's hit return. Okay. Now it asks us always a bunch of different questions that asks us, you know, what's our ex list? And that's L one. What's our why list that's L two? It very often asks you where you want to store your equation, and that's if you want to put it in Y one or Y two. I'm not going to do that. I'm just going to manually enter it. So I'm going to make sure all of that's blank and then I'm going to hit enter. All right. Well, let's see, what do I have? A rounded to the nearest integer would be 5158. And B rounded to the nearest thousandth we want a lot more decimals there. 1.04 one. So there's our model. All right. Pretty simple. I'm going to still need my calculator and letter B, where it says sketch a graph of the exponential function for the years 2000 to 2050. Label your window and your Y intercept. All right. Well, I want some kind of a graph. Okay? And I think I'm even going to put a little axis break in there. Because I'm kind of tired of having exponential graphs where I don't really get to see the exponential very well. Now, I think I could set a minimum, it's always a little bit dicey. But I know that my Y intercept is 5158. So I think I'm going to set my Y minimum at 5000. I haven't gone into my window yet. But my Y max is a little bit trickier. I know that this is a growing exponential, so its biggest value should occur at 2050. So what I'm going to do or what I actually already did. Is in my calculator, I put in this calculation, 5158 times 1.041 to the 50th, just so I knew what my population was, sort of at the end of my graph, and it ends up being 38,000 460. So I could make my Y maximum B 40,000. My axis are easy. Those should go from zero to 50. So let's do this. Since we've got the TI 84 plus open, let's go into Y equals. Let's put in 5000 158. Times 1.0 four one parentheses. Raised to the X, make sure you have that raised to the X, otherwise you'll get a linear function. All right. Now let's go in and set our window. Okay. So going into the window, I'm going to set my X minimum at zero. And my X maximum at 50. I'm going to set my Y minimum at 5000, and I'm going to set my Y maximum at 40,000. Okay, so check out your window, X minus zero, X maxx is 50. Why minimum is 5000 Y maximum is 40,000. All right, you ready? Let's hit graph. We get the classic exponential curve. You see if I can. Reproduce it oftentimes it'll look very linear at first. Then we'll start to bend. It says label your window and your Y intercept. We've got the window labeled, but let's show that Y intercept on there, 5158. Okay? Pretty easy. Now let her C says, by what percent does your exponential model predict the population is increasing per year. Explain. All right, this should be something that you can remember from your exponential work. What percent is my population increasing by each year? Hopefully you said 4.1%. So 1.041 is equal to one plus .041. This is the percent increase in decimal. So that gives me a 4.1% increase per year. Now letter D asks us to algebraically, algebraically, determine the number of years to the nearest year for the population to reach 20,000. All right, see if you can do this algebraically, this is a nice review of some exponential algebra, if you will. All right, let's go through it. I don't have a lot of space here. So I'm going to try to write kind of small. We'll see how it goes. So what I need to solve is this equation. 5158. Times 1.041 to the X equals 20,000. Really tiny. Now to get X all by itself, the first thing I'm going to do is divide both sides by 5000. 158. And that's going to give me 1.0 four one to the X this is a time when sometimes I'll leave it as a fraction. Sometimes I'll make it into a decimal. I found it easier in this problem to change it into kind of an obnoxious decimal, but whatever. Now, remember to solve an exponential equation, I really only had two choices I had logarithms, and I had the method of common basis, but that's not going to work very well right now. So I'm going to take the log of both sides. Uh oh. All right, so that number should go in there. Now the whole reason I'm going to do that is that I have the log law that says that then the X can come out front. And I'll get X times the log of 1.041. Equals the log of 3.8 7 7 four. Now I can divide both sides and I'll simply get X equals the log of 3.8774 divided by the log and of course you could be doing this with log base E that's the LN command. But either way, you plug all of that in and it's about 34 years. It's 33.72 years according to my exact calculation, but rounded to the nearest year. 34 years. All right. Pause the video now and write down anything you need to. Okay, I'm going to clear out the text. All right. I think we can well, we'll need the graphing calculator in just a bit. So why not keep it out? All right? Let's move on to the next problem. Exponential regression. Often used in population growth or any non linear growth that accelerates as time progresses. So linear growth is all about growing at the same rate. Exponential is growth that speeds up typically or slows down, but if we're talking about increasing exponentials then it speeds up as time goes on. That leads us to a problem that's pretty simple. Exercise number two, which of the following scatter plots would be best fit with an exponential equation. Oh, think about it. Which one would be best fit? All right. Well, if you said it was choice three, you are on the money, right? Exponential increasing exponential graphs tend to look something like that. This thing, this thing might be a logarithmic fit. It might be a square root fit. This is definitely more on the linear. As well as this is on the linear. But yeah, choice three is exponential. Now you did a lot, a lot of work back in common core algebra one with exponential regression and linear regression. So we're not going to be touching the exponential anymore. What we're going to concentrate on for the rest of the lesson is trigger regression. And that's a little weird. All right? Let's take a look at exercise number three. The temperature of a chemical reaction changes during the reaction. The temperature was measured every two minutes and the data is shown in the table below. All right. So we've got this table that has got time every two minutes and temperature at those time markers. Let her aces, why does it seem like the state might be periodic? Create a quick scatter plot using your calculator to verify. All right, well, let's bring that calculator back up and back out. All right. Somehow magically, even though I didn't do much with it before, I've got now the data back in the calculator. So I've already got this dataset put in there. It's the magic of time lapse like video and things like that. But I've already got the data in there. All right, let's actually go into stat to take a look. So I hit the stat button. And what you'll see is an L one, we've got zero, two, four, 6, 8, et cetera. And we've got the temperature then an L two, 35.7, 38.9, et cetera, et cetera. All right? Now the question is, why does this data seem like it would be periodic IE we would fit it with a sine curve? Well, for that, it's kind of cool to create a scatter plot. So let's walk through doing one of those really quickly. Let's go into not Y equals, but let's go into where we get to the scatter plots, which is right above Y equals stat plot. And let's go into plot one, first thing that's important is to turn it on. I always highlight the on button. And then highlight this symbol, which is the stat plot symbol. Then it asks us typically what is our X state a list, and we have L one. What is our Y data list? That's going to be L two. Now at this point, actually, the calculator is more or less ready to make a stat plot. But we should do a couple more things. Number one, let's deal with the window. Go into the window. Let's set our X minimum to be zero. And let's set our X maximum to be 20. That's pretty easy actually based on the table. Now our Y men and our Y max, this is a little bit different. Kind of scanning across that table. The smallest Y value I see is that 34.2. So I think what I'm going to do is I'm going to make my Y minimum. I'm going to conservatively make it 33. So 33 for my Y min. And then my largest Y value is looks like it's at 42.3. So why don't we make our Y maximum 43? How do we really get to see this data? All right? Now, before we hit the graph button, the last thing I'd like to do is go into Y equals. If you have any equations in there at all at this point, get rid of them. Clear them out. For whatever reason, the calculator sometimes has a problem when trying to graph both data and equations at the same time. It obviously doesn't always have a problem with it, but sometimes it does. We're going to graph our curve in a little bit along with this data. But once you've cleared that all out, hit the graph button. All right. And what you can see based on that graph is that it seems like it's periodic because, you know, it rises. Then falls. Then rises. Then falls. Et cetera. So definitely seems periodic. Now, let's take a look at sine regression. Sine regression is kind of weird. All right? And what I want you to do is I want you to hit the stat button. All right? Go over to the calculate menu. And now we got to go down a long ways. I don't know where it is on other calculators, but on the TI 83 84, it is way down there. You got to hit the down arrow, hit the down arrow, hit the down arrow, hit the down arrow, on my calculator, its option C I mean, I had to go buy options zero through 9 or one through ten or whatever you want to think about it all the way to option C, but there it is. Sine regression. So hit return on that. Now, this is really weird. The first thing it asks us for is iterations. And the process of sign regression is quite tricky, quite tricky. The mathematics are even more complicated than other types of regression. The higher the number of iterations you give it, the longer it will take to produce your equation, but the more accurate your equation will be. I find that three iterations is perfectly good, so let's lay that number at three. It then asks me for an ex list, which is L one. It asks me for a wireless cell two. Then it asks me for the period. Now, this is very specific to a Texas Instruments calculator, but it's also specific to sign regression. If I've put my data in there and the X values are separated by the same interval each time, I don't need to put a period in. All right? I don't have to say what the period of the curve is. And if you recall, actually not just recall, just look. The data is all separated by two minutes each. If you've got that in there, if all the X values are in at regular intervals, I either all two minutes apart or all 5 minutes apart or all ten minutes apart. There's no need to put the period in. So I'm not going to do that here. I'm not going to put the period in. And everything after that is just hitting enter, enter, enter, and getting our results, all right? And here are results. Y equals 3.9 times the sine of 0.4 X minus 0.7 plus 38 oh, I might not fit in there. 38.5. Now, I'd like to actually see how that looks compared to the data. One thing I want to make sure I do right now, though, before I even put the equation is, make sure I'm in radian mode. So hit your mode button. Make sure radians are highlighted. All right. Now let's go into Y equals. Not stat plot, but Y equals. And let's put that equation in. And Y one, let's put in 3.9 times the sine of .4 X -.7 parentheses, all of that is inside of parentheses. Then plus 38.5. All right. We've got all that. Check it over. 3.9 sine of 0.4 X -0.7 plus 38.5. All right, let's hit the graph button. All right. And it does a pretty good job. I mean, it definitely misses some of the data, it definitely does. But that's true of pretty much all regression equations. Pretty much true of all regression equations. Okay? So for the time being, let's put the TI 84 plus away. We don't need it for right now. All right. Letter C, according to this model, what is the range in temperatures the chemical reaction will include? All right, according to the model, don't worry about the table anymore. Now just use this and see if you can remember something about the range of a trick curve. All right, let's go through it. Well, if you recall, this number is the amplitude. Of my trig curve. And this is my midline or average value. So I can always figure out the minimum Y value by taking my midline 38.5. And subtracting my amplitude 3.9, and that gives me 34.6. And then I can always figure out the maximum by doing almost the same calculation, taking my midline, adding my amplitude and getting oops and getting 42.4. So we can now say our range is all Y values greater than or equal to 34.6, less than or equal to 42 .4. Now what's interesting is that there's definitely some data in our table that doesn't fall in that interval, like this guy, right? I think we got, yeah, we got all the data on the higher end, but that one definitely falls out on the lower end. And again, that's because regression models aren't perfect. Letter D according to this model, what is the time it takes for the reaction to complete one full cycle? What are they talking about here? Pause the video and think about this a bit. Ah, they're asking for the period. They want the period. They want P well, what do we know? We know B, right? The frequency. The frequency is 0.4. And remember this, B times P is always two pi. So we have 0.4 times P equals two pi. P must be two pi divided by 0.4. And if I work that out carefully, it comes out. To 15.7. And that's in minutes. All right? So we get a little bit more than one full cycle in this table, right? If it takes 15.7 minutes to complete a full cycle, and the table goes for 20 minutes, then we get a little bit more than one cycle in that table. All right. Well, pause the video now and write down anything you need to. Okay, let me clear out the data. The data. Let me clear out the writing. Let's do one more exercise. And what I mean one more, I mean, just one more. All right, exercise four. The maximum amount of daylight that hits the spot on earth is a function of the day of the year. Taking X equals zero to be January 1st, daylight in hours was measured for 12 different days. The measurement was the number of possible hours of sun from sunrise to sunset. So this isn't about clouds, it's not about eclipses or anything like that. Literally what I'm saying with something like this is on the 98th day of the year, there are 13.1 hours of possible sunlight. That's all. That's all we're saying. Now, what would be the natural period of this dataset? Think about this for a second. It should be 365 days. Because that's how long a year is. Let's not get into leap years and all of that. All right, it would make almost no difference if we used 360 five or 360 six. 365 days. 365 days. Now that's important. Because if you look at this data, this data is not evenly spaced. It's not evenly spaced. And that's important because when the data is not evenly spaced, then at least on the Texas Instruments graphing calculator, you have to put a period in. All right? So let's do this. Let's open up the TI 84 plus again. All right. Now, in the meantime, somehow, I'll just sitting here. I've managed to put that dataset in again. Let's take a look. Let's hit the stat button. Go into edit. All right. There's all the data. Okay. Sitting there already. Let's do that trig regression. Let's hit stat. And let's go over to calculate. And go down, down, down, down, down. This always takes a little while, especially on the electronic calculator on the computer screen. It takes a while. But if you keep hitting that down arrow, you know, botch anything, then eventually you find that there it is. You've got sign regression. So let's hit enter on that. All right. Now, the iterations we're going to keep at three, the X list, we're going to continue to have a S one. The Y list, we're going to continue to have L two. But now because the data is not evenly spread out in the X list, X list only, all right? The problem now becomes that we have to put the period in. So I'm going to put in 365 for the period. Okay? So we've got it. The iterations are three. The X list is L one, the Y list to sell two. The period is 365. And in many modeling contexts, you will know the period. If you don't, then you better be collecting data and evenly spaced X intervals. But let's hit enter. Let's see what we have. All right. So what is our equation? Our equation is Y equals 3.7, I guess we'll just keep it that way. Times the sign, I'm going to take this out quite a few decimal places. 0.13 X -.87. I know that was inconsistent with my last one, but I tried rounding it to .01 and it did a much worse job fitting the data. All right? And that's an interesting conversation all by itself is, you know, I've taken this out a lot of decimal places because when I tried to just do this one, it didn't fit the data nearly as well. All right. In fact, let's create a real quick stat plot and we'll put that in Y one, and we'll see how good the fit is. All right? Let's go into our plot. Our stat plots, both Y equals. Make sure that plot one is on. Let's go into plot one, turn it on. If it's not on from the other one, in our X list is L one or our Y list is L two, that's all set, right? I mean, this is really all set up from a previous stat plot that we did. But let's go into Y equals. If there's anything in Y equals that you don't want there, get rid of it, like, I don't know, the equation from the last one. Okay. Now let's put in 3.7. Times the sine of .013 X. Minus .87 parentheses. Make sure all that's in parentheses. Then plus 11.6. Okay, make sure that looks right. 3.7 sign parentheses .013 X 0.13 X .013 X -.87 parentheses plus 11.6. Now the only thing I should make sure of is that I have a good window now. So let's go into the window. I think since we're talking about the X being the days of the year, I think I'm going to set X minimum to be zero. And I think I'll make X maximum 365. Now the minimum amount of hours I get is 9. So I think I'm going to make Y min 8. And let's see the maximum is around 15.2. So maybe I'll make Y maximum 16. So why men ate Y max 16? All right, I think my window looks good. Make sure yours look good. Yours looks good. And let's hit graph. All right. Can we get that great step plot? And we get a pretty good fit. It's not bad. As I said, when I tried it before, or originally, with the one X, the fit wasn't nearly as good. It's amazing how sensitive, especially, especially phenomenon that have long periods that frequency, the .013 relates to the period, the frequency has to be pretty accurate. Now the last part of this problem should be pretty easy. It just simply asks, what is the maximum amount of daylight hours predicted by the model? Show your calculation. So go for it. Think about this for a minute. All right. Well, this gets back to just that range idea with my oh, there goes my eraser. That was really weird. Y equals let me put that back. 3.7 sign. So it really goes into that whole amplitude midline thing, right? We can always find the maximum output to a sine curve by taking my midline and adding my amplitude. And when I do that, I get a maximum daylight of 15.3 hours. Fits the table pretty well, where I saw the maximum daylight being 15.2 hours. Okay? So 15.3 hours. All right, pause the video now and write down anything you need to. All right, let me clear it out. Oh, it's got rid of the calculator. There goes the text. Let's get rid of our TI 84 plus. Thank you for your service. And let's wrap up this lesson. All right, well, in this lesson, we looked at some other types of regression. We reviewed the very, very common exponential regression, and the very uncommon trig regression. Lots of phenomena are modeled by both exponential and trig equations. But exponential regression tends to be the more common type of regression you see at the high school level. All right. As of this time, this is actually the last lesson in common core algebra two. So I want to thank you for joining me, not just for this lesson. But any of the lessons or videos you might have watched at this time. I know that here and there I made mistakes. Here and there of strange things happened with noises in the background. Maybe occasionally you might have heard a mower or maybe one of my cats make a sound. All of that is just part of what makes E math instruction special. And hey, at least this time, I wore a shirt. Other than just my red shirt. If you look at the common core algebra one videos I did, I think something like 95% of them, I was in this shirt. This time I had quite a few different ones, even if it wasn't always that obvious. All right. Well, thank you again for joining me for this course. My name is Kirk weiler. And until next time, keep thinking. Thank you so many problems.