Before the first debate there was much talk about the "failure" of the Kerry campaign. I do not believe that Kerry has run a bad campaign up till now.
All the historical factors are in Bush's favour. The nation is at war, always a plus for Republicans. The fact that the war is being prosecuted incompetently is irrelevant, wars often are, it doesn't make a lot of difference. Bush is incumbent, the political equivalent of home advantage. The economy is doing okay, a critical indicator of the President's electoral fortunes. That is arguably not much to do with the president, but again, that hasn't historically made a lot of difference.
Any statistical model based on past data is going to predict a huge Republican victory under these conditions. That may still occur, but up to this point it is clear that Kerry has been outperforming expectations.
Much was made of the failure to exploit the Bush administration's weaknesses on Iraq, while Kerry is accused of flip-flopping. This is not accurate in my view. Had Kerry come out with an anti-war message, he would have been annihliated. It is the oldest trick in the book for a president at war to unite the country under a banner of patriotism, and paint his peaceknik challenger as an attacker not of war but of the nation itself. The nation would have a real choice of course, but the challenger would have chosen electoral suicide.
Kerry's ambiguous attitude to war is portrayed as a weakness, but in electoral terms it is an asset. Many floating voters backed the invasion of Iraq during its initial stages only to become disillusioned with the reconstruction period. Ambivalent arguments may be perceived as a weak, but if a significant strategically important section of the population shares that ambivalence it works in your favour.
I am also beginning to wonder about the SVBT campaign against Kerry. I am not sure that it was actually effective. It may have simply coincided with the expected downturn in Kerry's fortunes. Political analysts are no smarter than gamblers when it comes to finding false correlations. SVBT also increases the impression that Republicans are rather bitter and negative people, base sentiment not likely to curry favour with an electorate that essentially prefers to celebrate hope and vision.
The campaign emphasizes the fact that Kerry did actually serve in Vietnam, while the memogate affair serves to emphasize that Bush did not. That might ultimately work in Kerry's favour despite the apparent shifting of allegiances which occurred at the time.
There were a lot of manholes the Democratic campaign could have fallen into. It seems to have negotiated them all successfully. I believe that, regardless of the election result, that the democrat campaign team has done pretty well.

