Tuesday, November 23, 2004

Geometrical Shapes

Sometimes my coworkers and I draw pictures on each other's whiteboards. Here is a picture of what might be the result of unbridled creativity.




For the record, I did Octogenarian, the interSEPTor, and Hex Hex.

Friday, November 12, 2004

The dog who is called Daisy

In case anyone was wondering, the picture in my blog profile is our border collie, Daisy. You can see more pictures on my home page.




My favourite quote about Daisy is this: "Everybody knows your name, day-ZEEEEE"

How many US Supreme Court Justices can you name??

With the news about the Chief Justice of the Supreme Court being ill, I wondered how many of the nine current US Supreme Court justices I could name.

I got 4 out of 9 - a failing grade by any measure. But, I still bet that's better than say, 90% of the US population. I think it's kinda funny, how everyone knows the name of our President, and probably lots of people can name several of his cabinet members, but when it comes to the judicial branch, there is little interest at all.

Quick, before you read the answer, how many can you name?

Here's the answer.


Send me an email (jigawatt[at]jigawatt.us), and tell me how you did.

Monday, November 08, 2004

nth order polynomial regression

Here is the solution to an nth order polynomial regression equation.

nth order polynomial regression

Suppose you have a set of data points, or ordered pairs (yi, xi). You want to fit a curve to that set of data points. Using this equation, you can find the function y(x) that best fits that set of points to whatever order you wish. For example, if you wanted to do a quadratic regression, you would get:

y(x) = a*x^2 + b*x + c

And my equation would give you the values for a, b, and c. So, from this you could plot the data points along with the quadratic and make predictions about future data, or to interpolate.

If you wanted to do a 5th order polynomial, you would get:

y(x) = a5*x^5 + a4*x^4 + a3*x^3 + a2*x^2 + a1*x + a0
And my equation would give you the values for a5, a4, a3, a2, a1 and a0.


You may now rest easy at night knowing that if you're ever in a life and death situation where you need to find the nth order polynomial regression equation, you'll know right where to look.

Friday, November 05, 2004

Quadratic Regression (Least Squares) Part 2

I derived the formula for a quadratic regression, but the margins are not big enough to publish it. Ok, the real reason is that erbob's scanner is not working, and I forgot about it at home.

For now, let's say that you have a set of k ordered pairs (yi, xi). The quadratic equation, y = a*x^2 + b*x + c that best fits these ordered pairs is given by the equations below:

a = [sum(yi*xi^2) - b*sum(xi^3) - c*sum(xi^2)] / sum(xi^4)

b = [sum(yi*xi) - a*sum(xi^3) - c*sum(xi)] / sum(xi^2)

c = [sum(yi) - a*sum(xi^2) - b*sum(xi)] / k

The summations have an index of i, and they go from 1 to k.


The equations can be solved by Gaussian elimination or by inverting the matrix.