The Julia Language is the Way of the Future

Recent surveys have shown that the R Language for statistical computing is undergoing an explosion in popularity among scientists, researchers, and other data-analyzing types. There are good reasons for this: R is Free, easy to use (as much as any programming language can be, anyway), can create beautiful graphics straight out of the box, and has a huge ecosystem of user-contributed libraries covering almost any statistical analysis you could dream of doing. It is becoming the lingua franca in many fields, especially in biology and ecology. For many students and scientists I know, “learning R” and “learning to program” are used almost interchangeably. There are more than 8,000 add-on packages available on CRAN, and some of the best, like those in the Hadleyverse, are changing the way people use the language for the better. We are currently living in the Golden Age of R.

But I don’t think R is the way of the future. The future, I believe, belongs to a very new scientific programming language called Julia.

(If you think the future belongs to Matlab, you are probably beyond hope).

Continue reading

Posted in Quantitative, Uncategorized | Tagged , , , | 2 Comments

Albatross enclosures and the Large Hadron Collider

A particle collision from the Large Hadron Collider. Image: CERN.

In my last post on the value and possible non-existence of “mesocosms,” I closed with a quote from Stommel’s 1963 paper on scale in physical oceanography.  Stommel’s point, which I echoed, is that certain natural processes take place on space or time scales that may not be observable or manipulable, at least with our present capabilities.  Ecologists often run up against these limits.  As I said in the comments, a common response to criticism along these lines goes something like “Yes, I’m aware of that issue, but for obvious practical/logistical reasons we couldn’t do any better. Ecology is hard.”

This may be true, but it isn’t a good argument.  Just because a certain experiment–in or out of a mesocosm–is the only one possible doesn’t necessarily mean its worth doing.  There are some species, ecological systems, and processes that are just not amenable to mesocosms.

For instance: how would you do an experiment on competition and resource partitioning between breeding Laysan and black-footed albatrosses in a mesocosm? It would need to be three thousand miles wide, which is impractical. But for obvious reasons, nobody would buy the results of an albatross experiment done in practical 50-m enclosures.

This albatrosses-in-cages idea is intentionally stupid, but my sense is that there are cases where experimenters make less extreme versions of similar errors. The ability to do controlled, randomized experiments is great…until the conditions necessary for control start fundamentally changing the characteristics of the system.  We should be able to recognize when this is the case, and stop ourselves, before we do the experiment.

An analogy to particle physics may be helpful. Until the Large Hadron Collider was built, physicists couldn’t test for the existence of the Higgs boson. According to the predictions of the Standard Model, the Higgs boson would not appear unless protons were smashed with a certain amount of energy, which was beyond the capabilities of  all the existing particle accelerators.

The physicists did not try to do Higgs experiments in the existing accelerators, because it would have been an utter waste of time. To do the experiments, they required a bigger instrument, which required in turn decades of effort from thousands of scientists, technicians, laborers, and engineers.  They and their funders thought it was worth it, and made it happen.

If you think a three-thousand-mile enclosure is necessary to really understand albatross foraging, God bless your little heart, and good luck with the grant application (not to mention your IACUC…).  A lot of big ecological questions do require big investments, either in long-term observing systems (think satellites, ocean observatories, CalCOFINEON, e-bird…) or experimental setups (like the ELA in Canada).   Many small-scale experiments are useful, and there are a number of good approaches that can bridge the gap between small-scale experiments and large-scale predictions.  But experiments at the wrong scale are just not among them.

Posted in Ramblings | Tagged , , , , | 11 Comments

There’s no such thing as a mesocosm

I don’t know about those experiments.  They were all done in mesocosms…or as I call them, “bags.”

–Anonymous limnologist

Last week, the eminent population ecologist Charley Krebs, channeling the sentiment expressed in the quote above, wrote a blog post on something he dubbed the “Volkswagen syndrome” in ecology.  He points out that ecologists are bad at prediction, and wonders if our shortcomings in this department may be due in part to over-reliance on simplified models, labratory microcosms, and field mesocosm studies.  The name alludes to VW’s recent attempts to, er, “simplify” the results of their cars’ emissions tests.  Krebs wonders if we should declare a partial moratorium on microcosm studies until some kind of meta-analysis can show whether, or under what conditions, they are worthwhile.

This post drew a strong reaction from Jeremy Fox at Dynamic Ecology.  Fox does much of his work with protists in microcosms, and so I think he (understandably) felt a bit defensive about what may have sounded like an attack on his whole research program.  Fox argues that there are examples of micro/mesocosm work that have generalized to nature, and links to an older post defending micro/mesocosms against a list of common criticisms (which I get the sense he hears a lot).  Morgan Ernest at Jabberwocky Ecology also had this less-strong response to Krebs’s post.

This is all interesting, but at this point, I’m getting a sinking feeling. This debate is drifting into familiar territory for ecology. Continue reading

Posted in Ramblings | Tagged , , , , , , | 10 Comments

Research in the National Interest

James Clerk Maxwell

Young James Clerk Maxwell (Wikimedia Commons)

The House Committee on Science, Space, and Technology approved legislation today that would require the National Science Foundation to explain, for every research grant it awards, how that grant is “in the national interest.” This is a new chapter in a long-running serial.

Things that are “in the national interest,” according to H.R. 3293, have “the potential to increase economic competitiveness, advance health and welfare, develop a competitive STEM workforce, increase public scientific literacy, increase partnerships between academia and industry, support national defense or promote scientific progress.” A lot of research could be said to contribute to these goals. Notably absent from the list are anything to do with the environment, climate, conservation, or natural resources. Even more notably absent is the pursuit of knowledge for its own sake.

As a practicing scientist, I’ve obviously already bought into the whole value-of-learning-and-exploration thing. But even if you’re more into economic competetiveness, partnerships with industry, and national defense, you had better respect the importance of fundamental research. Continue reading

Posted in Policy etc. | Tagged , , , | 1 Comment

The Northern Cod are Coming Back The Atlantic cod offshore of Newfoundland are at this point the stuff of legend and fable. For five hundred years, they supported one of the largest fisheries in the world, until, in the latter half of the twentieth century, a tangle of new technology, greed, and mismanagement caused the population to crash. In 1992, with enraged fishermen trying to batter down the door, Canada’s Minister of Fisheries declared a moratorium. The fishery was closed.

The closure was expected to last a couple of years, maybe a few, giving the cod population time to rebound. But the rebound didn’t come. For twenty years, cod remained scarce, virtually extinct in ecological terms. Continue reading

Posted in Research Blogging | Tagged , , , , | 1 Comment

Viewers who watched “The Birds” also enjoyed “Field Work on Great Gull Island”

My second summer on Great Gull Island is over, and I’m back on the “Big Island” for good now. I miss being there. Mostly.

Great Gull Island is small, and during the summer it is crowded. Some ten thousand pairs of terns nest on just 17 acres of land. They lay small, brown, speckled eggs on the ground, in nests that are little more than a shallow scrape ringed with some twigs or grasses. You have to walk slowly, watching the ground in front of literally every footstep, to avoid stepping on the nests.

The terns do not really care if you are being careful. They attack you. These attacks involve dive-bombing, lots of noise, projectile defecation, and occasional beak strikes that are sharp enough to draw blood. It’s like The Birds, but with better special effects. But, as LeVar Burton says, don’t take my word for it. I have video.

In the words of one friend after watching this, “Holy shit! You said there were a lot of birds, but I didn’t realize it was like National Geographic out there!”

Posted in Research | Tagged , , , , | 4 Comments

Programming: the Legos of Math

Lego Mobius Strips

Lego® Mobius strips by Andrew Lipson. Click to see more mathematical Lego art on his webpage.

Why should you learn to program? In my (limited) experience in the world of marine science, fisheries, and ecology, programming is more and more becoming part of the expected tool set. Consequently, many grad students in these fields are struggling up the learning curve.

There are a lot of good reasons to learn to program. Many are mentioned in this recent Twitter conversation, prompted by a question from Dan McGlinn: how to justify teaching biology undergraduates R or Python instead of Excel? Most of the responses to this question focused on the ways R (or Python) is a faster and more powerful tool than Excel. Which is absolutely true: programming tools are far more flexible, powerful, and reproducible than spreadsheets. It has been seven years since I first learned to program, and it has been seven years since I last tried to use Excel for any data analysis. But with some perspective on it now, I think the best thing programming has done for me is the confidence it has given me to play with mathematics.

In school I was pretty good at math, but it was never totally easy for me (my anxiety dreams, to this day, are all about being unprepared for 11th grade pre-calc). This began to change, imperceptibly at first, Continue reading

Posted in Ramblings | Tagged , , , | 1 Comment

Do not flip-flop variables to make them work in your #@%*^& ANOVA

I was reading a paper this morning. It included a perversion of a common statistical analysis that is fundamentally wrong, utterly unneccesary, and has an easy solution. This perversion, unfortunately, is also distressingly common. Inspired by O’Hara and Kotze’s 2010 paper Do Not Log-Transform Count Data, I now offer you this blog post/rant, entitled “Do not flip-flop variables to make them work in your #@%*^& ANOVA.”

What set me off was a statement about the presence or absence of a particular fish in alpine lakes (details have been blurred to protect the guilty):

Lakes containing [fish] were lower in elevation…than lakes without [fish].

This statement was followed by the results of a non-parametric ANOVA confirming that lakes with fish were at significantly lower elevations than lakes without them. Can you spot the problem here? This model implies–wait for it–that you can flatten mountain ranges by adding fish to their lakes. Who knew?

Continue reading

Posted in Quantitative | Tagged , , , , | Leave a comment


Hvalreki really should have been the title of my last post. It is my favorite Icelandic word, which I learned visiting that country almost five years ago. It translates to “windfall” in English, and, like that word, originally referred to a concrete event. But where a windfall is some fruit blown from the high branches, a hvalreki is much grander. It literally means “beached whale.”

Back in the old days in Iceland, a hvalreki really was a huge stroke of good luck. (“Olav, come quick! It’s a hvalreki! We can eat this winter!”) For some marine mammal acousticians, it still is. (“Ted! Come quick! It’s a hvalreki! We can ship its head to Utah to CT scan it for a finite-element model!”) But most of the time, these days, a hvalreki is more trouble than it is worth.

That was the opinion of the town of Brookhaven, New York, this past October, when a nearly 60-foot long fin whale (Balaenoptera physalus) washed up at Smith Point County Park on the south shore of Long Island. Continue reading

Posted in Uncategorized | Tagged , , , , , | 1 Comment

Bone Conduction is Better than Pressure, or, Put your Whale in my Rocket Scanner What do a decapitated whale, an x-ray scanner for solid-fuel rockets, and noise pollution have in common? This is not the start of a really weird joke–they are all major elements in a new paper by Ted Cranford and Petr Krysil, published this week in PLOS One. In a word, the first went through the second to help understand the impact of the third.

This was, believe it or not, a very logical plan for a research project. The modern ocean is increasingly filled with man-made noise, and some of them may be affecting marine mammals. Blue whales, for instance, have lowered the pitch of their songs over the past few decades, possibly in reaction to the rising volume of ship noise in the ocean. However, we don’t actually know how well many of the largest whales hear, because there is no way to measure it.

Continue reading

Posted in Research Blogging | Tagged , , , , , , , | 8 Comments