Debt Clock
Frequently Asked Questions
Q. How is the debt calculated?
A. The math for that is something of a kludge. I may refine it someday. The basic way it works is:
- Every 24 hours, the script checks for an update to the U.S. Treasury's report on the national debt.
- The script extracts all the numbers that relate to dates up to a year back from the current day.
- The script computes a linear least-squares fit to these data.
- You invoke the script, it checks the current time, and uses the linear equation derived in the last step to extrapolate a guess as to the current debt.
There are some objections you could make to this methodology. The first is the linear fit to the previous year's data; obviously, the debt may not be growing linearly. In fact, a quick glance at some graphs put together by the author of another debt clock (on whose methodology this one is roughly based) suggests, rather eerily, that it might very well be growing exponentially. Though it's rather difficult to tell since the graph's rather small and not finely graduated.
Another possible objection is that the samples aren't uniformly distributed in time, so there are fewer squares to minimize toward the beginning of the sampling period, which could in theory throw calculations off (I think). I could fix this, but I'm lazy.
My basic attitude is that the script is trying to guess a number that, as I write this, is somewhere in the neighborhood of $7.9 trillion. That's a really honking big number, and it shouldn't be anything like that large anyway, so being a few billion off here or there doesn't really bother me much. Apparently it doesn't bother Congress either.
And yes, for the pedants in the audience, that means there's no point giving values down to the cent, but it looks cool.
Q. Where do you get your figures for the other calculations?
A. Some of them are pretty obvious and solid. I can measure a bottle of Coke. Others are fudged: The price of a 737, for instance, is a guess based on reports of purchases within the last few years and some other guesses floating around on the Net. Others are informal averages: A copy of Quake 4 won't cost you $50 at every retailer, but it will at several.
Q. Will you put the debt in terms of [insert object here]?
A. If it's reasonably solid and predictable in terms of dimensions and price, I might consider it. E-mail me at mark.wilson@case.edu and if I have time and inclination I'll do it.
Q. Why did you do this?
A. Well, it was a pretty easy programming project that I found interesting and amusing. I was sitting in a Software Engineering lecture one day -- my professor was saying some very amusing things about Congress, coincidentally -- and I thought to myself, "Part of the problem with the national debt is that it's so ludicrously macroscopic that it's hard to comprehend, and so people don't think about it." So I wrote a program to make it more comprehensible.
Q. Are you an economist? Do you understand all the complex international implications associated with the national debt?
A. Nope, I'm just a computer programmer, and this seemed like a fun thing to do.
