Friday, June 27, 2008

On Rambo

I caught Rambo on DVD this evening. A few thoughts:

The Christian missionaries were poorly drawn. Let's start with the easy one: what was the girl Sarah doing on this trip? These were supposed to be medical missionaries, but the most constructive thing she did during the whole movie was "hand me a bandage." For the rest, she was either wandering around aimlessly, or running in terror. If Michael, the team leader, had really made four trips into Burma, then he would have known perfectly well that it was no place for a woman without skills.

More importantly, Evangelicals don't talk the way these people talk. Their Christianity has been watered down to the most New-Agey claptrap imaginable. At one point, Sarah asks Rambo if he has "lost his faith in people." No properly educated Christian has faith in people. (It could be that I haven't sufficiently kept pace with the decline of Evangelicalism.) Also, Michael is shown objecting to Rambo's early use of violence to protect them from Burmese pirates, saying "it's never okay to take a life." Granted, there are Christians that actually believe this, but they tend not to be Evangelicals from Colorado.

The mercenaries are poorly drawn. Lewis, the merc leader, is "old school SAS", but spends his first 15 minutes of screen time whining about being in the jungle. Somewhat implausibly, he knows Rambo works locally catching snakes, but evidently doesn't know that Rambo is former SF, and rags on him for no apparent reason. This appears to be a staple of action movies: no matter what their obvious physicality, the heros get picked on by people manifestly weaker than themselves.

More broadly, what is this bunch of guys with these kinds of skills doing freelancing in Thailand? For missionaries? They should be working for Blackwater; or if their records are dirty, then providing security to drug smuggling.

The effects were so over the top, they reminded me of the Rambo parody in the movie UHF: sniper bullets decapitating people, bodies bursting like water balloons, that kind of thing. Couldn't they have done this right?

The Burmese military is shown to be really bad, but completely without context. Nary a word is uttered about the Burmese Muslim persecution of Christians; we're supposed to believe that the army randomly uses civilians for target practice.

In its favor, Stallone is half-way plausible as a burned out 'Nam vet, and the combat sequences are marginally more realistic than those of the previous films, but that's not saying much. If I was still 14 years old, I would probably not be complaining. But it would have been easy to make this a serious film about a serious issue, and what we got instead was a cartoon version of reality.

Thursday, June 26, 2008

A Victory for the 2nd Amendment

SCOTUS struck down the DC Gun ban. Full opinion here; HT: Ace.

We now have a legal context in which to evaluate gun control laws, and an important benchmark is now established: outright prohibition is not constitutionally permissible. Does this mean that I'll be able to buy a chain gun at Walmart? No, but somewhere between that world and the world of DC and NYC is where our laws will find a balance, much in the same way that we find a balance in the context of the 1st Amendment.

It follows that much legal work remains. For instance, Mrs. Φ asked, "does this mean that DC residents can buy guns?" Not quite: it means they can own guns. But to buy a gun at a gun store, the buyer must possess a driver's license of the state in which he makes the purchase. Does DC have its own DMV? If it does, then its residents must make their retail purchases at DC gun stores. I'd be surprised if such creatures exist. If they do, they are almost certainly prohibited from selling guns to civilians under a network of regulations that SCOTUS didn't address. Now, motivated buyers can make their purchases in private transactions in states where such are unregulated: Virginia for example, but not Maryland. But the point is that motivated governments can, at present, throw up all kinds of obstacles in the face of their citizens, and these obstacles will need to be litigated one by one.

Politically speaking, this decision should provide a litums test by which Republican senators should evaluate the judicial nominees of the upcoming Obama administration. If the Democrats can "Bork" any nominee not swearing fealty to Roe v Wade, then Republicans can return the favor to any nominee not upholding the 2d Amendment. Sauce for the goose, and all that, with the added advantage that the right to keep and bear arms is, you know, actually in the Constitution.

Monday, June 16, 2008

On Bias

A while back, I made a comment over at Bobvis to the effect that the word bias had a very specific mathematical meaning: it was the tendency to consistently over-estimate or under-estimate a parameter.

To illustrate this concept, let's return to the Poisson distribution from my last math post. You will recall that the Poisson pdf,

p(n|a) = an·exp(-a)

n!
(1)
is related to the probability of some number of events n, known to occur at average rate a, occuring within the time period specified by a. In my last example, we spoke of the number of busses that would drive by a bus stop. We could also use the example of the number of photons received by a telescope, given they arrive at average rate a. We also showed that the expected value of n was a, and that the variance of n was also a.

But: what if we don't know the parameter a? Can we calculate it? Indeed, the straightforward calculation of the expected value of a is:

E[a] = ó
õ
a p(n|a)p(a)

p(n)
da,
(2)
where
p(n) = p(n|a)p(a)da
(3)

However, calculating the E[a] in this manner not only requires our Poisson distribution, but also requires a priori knowledge of p(a), the distribution of a. In practice, we may not have this formula.

In such a situation, we can't calculate the expected value of a directly. But if we have empirical measurements, we can estimate the parameter a from the data itself. There are, in fact, a number of estimators, but in this case, the estimator of choice would be the Maximum Likelihood estimate, defined as:

^
a
 

ML 
= argmaxa p(n|a) = argmaxa   an·exp(-a)

n!
(4)

The expression argmaxa means the that we will vary a until we maximize the value of the pdf, given that we have made a measurement n of some number of photons (let's say) striking our telescope.

The value of the pdf will take on its maximum value with respect to a when its derivative with respect to a is equal to zero; so

d

da
p(n|a) = d

da
æ
è
  an·exp-a

n!
ö
ø
= (n·an-1-an)exp(-a)

n!
= 0
(5)

Þ n·
^
a
 
n-1
ML 
=
^
a
 
n
ML 
(6)

lnn + (n-1)·ln
^
a
 

ML 
= n·ln
^
a
 

ML 
(7)

ln
^
a
 

ML 
= lnn
(8)

^
a
 

ML 
= n
(9)

In other words, I can estimate the rate of photons a by counting the photons. You might expect that this would be a very poor estimate, and you would be right; it's roughly the same as estimating the mean IQ of China from the IQ of the first Chinaman I meet.

But what if we have a collection of measurements that we will call N = {Ni, i = 1¼M}. In our example, this is like having M telescopes that each make a reading of the number of photons Ni in the relevant time period. Because these measurements are independent, we can write:

^
a
 

ML 
= argmaxa p(N|a) = argmaxa   Õ
p(Ni|a) = argmaxa   Õ
aNi·exp(-a)

Ni!
(10)

= argmaxa  aåNi·exp(-Ma Õ
1

Ni!
(11)

Note: all S's and P's are over the M samples.

As above, the value of the pdf will take on its maximum value with respect to a when its derivative with respect to a is equal to zero; so

d

da
é
ë
aåNi·exp(-Ma Õ
1

Ni!
ù
û
(12)

= é
ë
å
Ni·aåNi-1·exp(-Ma- M·exp(-MaaåNi ù
û
Õ
1

Ni!
=0
(13)

®   å
Ni·
^
a
 
åNi-1
ML 
= M·
^
a
 
åNi
ML 
(14)

Therefore, 
^
a
 

ML 
= 1

M
· å
Ni
(15)

This conclusion may seem unremarkable: that the maximum likelihood estimate for, say, the number of busses driving visiting my bus stop in an hour, or the number of photons collected by my telescope in an hour, is the average number of observations made during a succession of hours.

The question still be answered is whether or not this is an unbiased estimate. Not a perfect estimate, mind you; there of course will be errors. The pertinant question is whether these errors will tend to accumulate in a particular way, predicting too many photons, on average, or too few.

To answer this question, we must calcuate the expected value of the estimate:

E[
^
a
 

ML 
] = E é
ê
ë
å
Ni

M
ù
ú
û
= 1

M
· å
E[Ni] = M·a

M
= a
(16)

Conveniently enough the expected value of the ML estimate of a is ... a. We say then that the esimate is unbiased; in other words, while any single estimate will have an error associated with it, these errors will not, on average, tend either higher or lower in the long run. average of a sufficiently large number of estimates will not be wrong.

But how much can I expect my ML estimate to be wrong? We can gain some insight into this question by estimating the variance. Since the Ni's can vary, our estimate will vary while the true value stays constant. What is the extend of this variation?


var
^
a
 

ML 
= E[(
^
a
 

ML 
- a)2] = E é
ê
ë
æ
ç
è
å
Ni

M
-
å
a

M
ö
÷
ø
2

 
ù
ú
û
(17)

= E é
ë
æ
è
1

M
· å
(Ni - a) ö
ø
2

 
ù
û
= E é
ë
1

M2
· æ
è
å
(Ni - a) ö
ø
2
 
ù
û
(18)

The next step requires some explanation. We have a square-of-sums term that we wish to convert to a sum of squares.

Normally this would generate all kinds of cross terms; however, because our samples our independent, we know that E[(Ni - a)(Nj - a)]=0, so we can write:

var(
^
a
 

ML 
) = 1

M2
·E é
ë
å
(Ni - a)2 ù
û
= 1

M2
· å
E[(Ni-a)2]
(19)

= 1

M2
· å
var(Ni)= Ma

M2
= a

M
(20)

Here is the significance of what we've just done: we've shown that as the number of our observations goes up, the variance associated with our estimate goes down. So the larger the sample size, the closer I will usually be to correctly estimating the parameter I am trying to find.

Why is this? Basically, signals reinforce, noise cancels! To deploy an example that will interest the readers of this blog, if I test the IQ of a random Chinaman, my guess that this IQ is the Chinese average will probably not be a very close one, although my estimate will be unbiased. If I meet a thousand random Chinamen, my guess that their average IQ is the Chinese average will be pretty darn close.

Update: Crap!Crap!Crap!Crap!Crap! My equations look like they went through a blender!

Here's the story: Last week I wrote my first paper in LaTex. Once you learn the syntax, formatting equations in LaTex is mildly easier than in MS Word's Equation Editor or MathType, since it can all be done with control sequences instead of mouse-work. But I was particularly taken with the possibility of converting a LaTex file into HTML using a little bit of freeware called TTH. Unlike, say, the HTML conversion by MS Word, the equations are formatted as real HTML, not gif files.

But there turned out to be numerous problems. First, TTH doesn't recognize all LaTex syntax. The second problem is blogger. When I open the TTH output in a browser, it looks fine. When I save that same output into blogger and read it there . . . well, what you see above is the result of many hours of post-processing on a very complicated source file. And it still removed all my fraction bars. So all those over-under strings that look like they'd be fractions if they had a line beteen them, well . . . they once did.

Never again. If I'm writing for the Web, I'll use word.

Friday, June 06, 2008

On Definitions

I learned something new about the Ten Commandentments yesterday.

You may ask, what's new about them? Haven't they been sitting there in Exodus 20 for, roughly, ever?

The ten commandments are not specifically numbered, and in fact span 15-16 verses in chapter 20, depending on whether or not you count the introduction. Exodus 34, among other places, refers to them as "the Ten Commandments," so there isn't really any disagreement that there are ten. However, it turns out that not everyone divides the Ten Commandments the same way. Significantly, Roman Catholics combine the First Commandment, "Thou shalt have no other God's before me," with the Second Commandment, "Thou shalt not make unto thyself any graven (i.e. engraved) images," into a single commandment. They make up for it on the back end by breaking the 10th Commandment, "Thou shalt not covet," into two parts: Thou shalt not covet thy neighbor's house," and "Thou shalt not covet they neighbor's [everything else]."

The Catholic division, while originally made by Augustine, wasn't made official until the Council of Trent, i.e. the high-water mark of the counter-Reformation. It is not hard to see the motivation. The prohibition against the use of images in workship presents a prima facie problem for Catholic iconography. Yes, properly schooled Catholics understand that they are not worshipping the statues and whatnot, but this is a pretty fine distinction with what they are doing, and anyway, not all Catholics are properly schooled.

This came up because my daughter, a well-catechized Calvinist, had an argument with her best friend, an evidently well-catechized Catholic. I found out about this later, but supposedly her friend was reduced to tears upon hearing that the Second Commandment was not "Thou shalt not take the name of the Lord thy God in vain."

The fun part is that when the adults were asked to resolve the dispute, friend's mom consulted a Catholic catechism. And guess what: it didn't say word one about graven images. I had a hard time believing this when I heard it, so I dug up my own Catholic Catechism from twenty years ago. Sure enough, not one word on graven images.

Now, this isn't the Catholic Church's final word on the subject. The Catholics have several catechisms. They tend to be quite lengthy, and they aren't "catechisms" in the proper sense of being in a question-and-answer format, but are rather confessions, or statements of faith and doctrine. The U.S. Catholic Bishop's online catechism does address the prohibition, though of course it gives a psss to the veneration of images. And at least two Catholic translations-in-good-standing of Exodus 20 contain the passage intact.

But evidently one can be a Catholic in good standing without ever actually, you know, reading the Bible. Friend's family, for instance, are very devout, yet friend's mom hadn't even heard about "graven images" and, upon not finding it in the catechism, said rather decidedly that it wasn't part of the ten commandments!

So . . . the point of this post wasn't to take a whack at Catholics. The point was to use this example as an illustration of how the power to set categories and definitions is also the power to control the discussion. In this instance, by submerging the prohibition on worshiping images as a mere application of the commandment to "have no other Gods," it becomes possible to have it ignored almost completely. So the categories influence the outcome.

This insight has all kinds of applications.