The Method of Least Squares

Recently I got into an on-line “debate” (yes I know, I should have known better, but let’s make this a learning experience for all; shall we?) about the world population. This got me thinking about how useful it would be to show people about “the method of least squares”.

The method of least squares is a mathematical tool used for analyzing scientific data. Here’s how it works: First we take our scientific data. This data could have come from any number of sources. Perhaps it came from some sensor that is used to measure something in a scientific experiment, or perhaps it is just some statistical data about the population; like this chart I made from data I got from here:
population-chart
Now it has been claimed before that the world population is going up exponentially, and who are we to argue with that? Besides it looks kind of like the beginning of exponential growth.
This means that the formula for the world population at any given time will look something kind of like this:
our-formula

Where y is the world population, x is the year, and a, b, and c are some kind of number that we don’t know the values of. Now what if we wanted to predict what the world population will be in the future?
Obviously we need a formula, and obviously we need to find out what a, b, and c are.
Let’s look at that graph again:
population-chart
Did you notice how it’s all bumpy and not a nice smooth curve like this one?
nice-curve
It seems reality doesn’t like making things nice and simple. The people who were finding this world population data probably made a few mistakes. Maybe some people lied on their tax forms (which is probably how they got much of this data) at certain points when their economies were bad, or maybe some people were accidentally counted twice.

In other words these results have some random error in them. This is unfortunately a problem that you face whenever you measure anything: you’re going to get inaccurate results. Whether you’re measuring world population, the charge on fundamental particles, or just distances with a ruler; the result will always be slightly off.

As technology improves measurement tools get more accurate, and don’t introduce as much error, but scientists still have to find some way to deal with this.

So how does one deal with this?
First what we do is take a formula that makes a graph that we think looks like our data. In this case it’s a second degree polynomial; AKA this thing:
our-formula

Now let’s replace a, b, and c with the Greek letter beta (because this will separate the true math nerds from the fakers). So it’ll look like this:
beta-substitute

This way we can maybe we can use this for other crazy formulas in the future like:

crazy-function

What we want to do is find the values of the betas this formula,
beta-substitute

fit the data as closely as possible. So what we could do this for every data point:
least-squares

In other words, every point in that graph is a pair of x and y values. For each one we take the y value, and subtract this from it
the-function
Where x is the x value for that particular pair. This way we’ll find the difference from the value that our theoretical formula gives us, and the actual value from the data. The trick here is to find the beta values that minimize the difference between the theoretical value and the actual value.

If we do this subtraction and squaring for every data point (or more realistically: have a computer do it for us), and add them all up we might end up with something that looks like this horrible mess:
horrible-mess
Not only does this give us what will be the error in our formula, but it’s also the phone number of Satan.

Now we can use calculus and algebra to find out what the betas should be. First we need
to take derivatives with respect to each of the beta variables (here‘s a bunch of Khan Academy videos on how to take derivatives, and what derivatives are. Be sure to look for the videos talking about some rule (like the “exponent rule”, or the “chain rule”)).

Next we set all those derivatives equal to zero.
In this case it’ll look like this crime against nature:
where-did-my-life-go-so-wrong
And yes this will be on the final exam (of your existence).

Next we can use back substitution to find out what the values are. Then that’s it! We’re done! And to think I’ve probably only lost two thirds of my audience when I showed the first picture!
population-formula
This formula will tell us the World population (in billions) at any given time ‘x’. Where ‘x’ is the year.
We can then use the quadratic formula to find out when the we will go extinct from overpopulation!

45 thoughts on “The Method of Least Squares

  1. tuft & needle canada tuft needle review tuft and needle beds
    needle in the bed tuft and needle mattress reviews 2017 tuft and needle bed reviews
    tuft and needle mattress turf and needle tuft and needle bed reviews
    purple mattresses reviews purple mattress purple mattress reviews consumer reports
    purple mattress purple mattress purple mattress
    reviews purple mattress purple mattress reviews 2017 purple reviews
    mattress stores near akron ohio mattress stores in manchester connecticut mattress stores mentor ohio
    mattress stores in manchester nh discount mattress stores columbus ohio mattress stores in mentor ohio
    latex mattress stores madison wisconsin winona minnesota mattress stores mattress store ohio

    tuft & needle bed reviews on mattresses mattresses tuft and needle reviews
    needle and tuft best tuft and needle casper mattress vs tuft and needle
    tuft and needle 10 tuft & needle mattress 2017 tuft needle
    purple mattresses purple mattress discount purple reviews
    purple mattress reviews 2017 purple mattress discount purple mattress reviews
    purple mattress reviews 2017 purple mattress reviews purple mattress
    mattress store madison wisconsin mattress stores near paducah ky dreamweaver mattress store cleveland ohio
    mattress stores medina ohio mattress stores in madison tn mattress store romig rd akron ohio
    mattress stores medford oregon mattress store manchester nh mattress stores north canton ohio

  2. Propecia Side Effects Recession Kamagra Chewable Priligy Generico Sin Receta Dealing With Anger Caused By Cymbalta viagra prescription Cost Of Cialis At Walmart Baclofene Definition Priligy Dapoxetine 60mg Cialis Femminile Zithromax Out Of Pocket Cost Cost Of Levitra Cialis For Sale Canada Amoxil 875 Buy Cialis Online Cheap Propecia Dosis Efectos Adversos Viagra Frau Wikipedia Mail Order Viagra Viagra Generika Ohne Kreditkarte Sale Finasteride Low Price Propecia 1mg 20 Mg Cialis Side Effects

  3. tuft & needle mattresses review tuft & needle canada mattress needle
    tuft and needle mattresses review tuft and needle mattresses reviews casper vs tuft and needle
    tuft and needle bed frame tuft & needle mattress 2016 turf and needles
    purple mattress discount purple mattress purple mattress
    reviews purple mattress purple mattress discount reviews purple mattress
    purple mattress discount purple mattress reviews 2017 purple mattress reviews
    mattress stores medina ohio canton ohio mattress stores mattress store in madison wi
    mattress store modesto ca mattress stores in manchester nh harrison ohio mattress store
    verlo mattress store madison wi verlo factory mattress stores madison wi mattress stores in medford oregon

    reviews on mattresses tuft and needle mattress 2017 tuft and needle vs casper
    tuft & needle mattress reviews tuft and needle shikibuton needle mattress
    casper mattress vs tuft and needle best reviewed mattress reviews on mattresses
    purple reviews purple mattress review purple mattress review
    purple mattress discount purple mattress reviews consumer reports purple reviews
    purple mattress purple mattress reviews purple mattress reviews consumer reports
    mattress store madison wi mattress stores in palm springs area mattress stores mentor ohio
    mattress store akron ohio mattress stores madison wisconsin mattress stores in akron ohio
    mattress stores in mass mattress store palm springs mattress stores in mentor

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 9 =