Tuesday, July 28, 2009

Coyne reviews Robert Wright's "The Evolution of God"

Jerry Coyne (author of "Why Evolution is True") has a lengthy review of Robert Wright's latest book "The Evolution of God" (Amazon link).

In short: Wright cherry picks examples in an attempt to demonstrate "moral" progress mediated by historical (supposedly evolutionary) changes in (monotheistic) religions, as his previous books attempted to show progress in biological evolution towards greater complexity (and hence mankind). In short this is a classic religious attempt to ascribe purpose and direction to the Universe.

Nevertheless Coyne's review itself is worth reading.

Sunday, July 26, 2009

Gemmel, Quist and Polar Shifts

Fans of British fantasy novels will no doubt remember David Gemmell as being one of the biggest names in fantasy writing between the mid-1980's and his untimely death from heart disease in 2006.

Gemmell's books were a breath of fresh air in the late 80's, washing away the stale Tolkien-imitation that seemed to dominate the field and replacing it with gritty tales of flawed heros, often hopeless odds, and major characters often dying. Sadly, the more books Gemmel wrote the more formulaic this style became.

One re-occurring theme Gemmell used to tie together the different series of his earlier books was of periodic catastrophes that shifted the Earth's rotation, drowning continents and emptying seas. At the time I read his books I assumed these ideas (absurd, but good fodder for fantasy) were Gemmell's own adaptation of Velikovsky's catastrophism, but most of the Polar Shift concepts used in Gemmell's work appear directly taken from Charles Hapgood's "Maps of the Ancient Sea Kings: Evidence of Advanced Civilization in the Ice Age."

The reason I now know this is John McKay's excellent post on Allan Quist's hilarious attempt to disprove global climate change by claiming that ancient maps show an ice-free Antarctica based on Hapgood's work.

Monday, July 6, 2009

numpy/scipy

The more I use numpy and scipy the more I like them. Matplotlib has some quirks, but all in all its easy to quickly write something powerful that just works.

Update (09 July 2009): That said, I am surprised at how simplistic the fitting routines (aka optimization, minimization, etc) are in scipy, and the lack of good generalized fitting packages in python. Its all very well if you want to use the routines provided in scipy.optimize and uncertainties in your data aren't a big issue but that's not at all the realm of data I experience daily.

It may be that scipy.optimize's routines can handle data uncertainties properly through some more complicated interface, but all the examples I've seen don't seem to suggest that as they all totally ignore data errors. Nor do they mention even simple fitting concepts like chi squared (I'd survive with chi squared, I don't need log likelihood all the time).

Update (10 July 2009): OK, you can handle data uncertainties using the scipy.optimize routines, you just make sure the function you want to minimize calculates chi squared or log likelihood, and you effectively have chi^2 fitting or Cash statistic fitting. I haven't yet worked out how to calculate the uncertainties on the fit parameters using scipy.optimize -- the most naive way is to use the covariance matrix (not robust, I know).

Space Telescope's stsci_python provides pytools.nmpfit (a numpy version of python mpfit, itself a version of IDL mpfit). This does Levenberg-Marquardt fitting and does provide estimates of the best-fit parameter uncertainties (using the covariance matrix). After giving it a spin I find it works just as well as scipy.optimize, although at the cost of having to install the entire stsci_python package. More interestingly (n)mpfit has a well developed interface for fixing (and unfixing) fit parameters as well as handling limits on the fit parameters. I ended up using this for the HST ACS data analysis routines I'm writing. Still, none of these approach the sophistication of xspec or sherpa. If it weren't for the huge size of these packages I'd try to link to these behemoths (well, sherpa anyway, as it has a python interface), but I'm trying to (a) use more generalized packages, (b) wean myself away from relying on the same software I've used for years and learn something new...

Sunday, July 5, 2009

This Cat is Awesome!

Pet Jungle Cat (NSFW).

[Original "Cat... is Awesome" from Zooillogix]