Thursday, April 21, 2011

Reflection on teaching modeling, or why should non-modelers try to model?

At the moment, I believe that non-modelers (students or faculty) benefit from attempting to model simple systems. I believe that it helps them become better scientists.

I am near the end of a semester in which we tried to incorporate a little bit of modeling into an otherwise basic graduate level ecosystems course. I think I would like to reflect a bit.

For years I have helped teach a population/community grad course, where we included basic population and food web models, and a smidgen of other stuff. In that course, we started everyone out making the same assumption of ignorance for all, and we taught just enough for students to implement simple models in R. I am not sure how satisfactory it is. I think I want to teach more basic R so that students learn about R in a modeling context, not just their stats classes. I think by learning R they will learn about models even more effectively.

This semester (Winter/Spring 2011), in the ecosystems course, we started students thinking along two tracks, one of conceptual models of ecosystems and the other learning the R language. Our thought was that by the time they had learned enough about ecosystems, to create conceptual models, they would have learned enough R to begin formalizing their conceptual models. However, that has not been the case, for at least two reasons.

The first cause of sub-optimal pedagogy may have been that students new to a language (e.g., R) need to work with it at least three days/week (preferably 4-6), but I did not structure the assignments that way. They need both carrots and sticks, and assignments that require daily turn-around (e.g., automated release and deadlines, or email with 24 hours to upload answers). I would not even have to grade every one of them - just mark them turned in or not, perform spot checks, and provide detailed answers. Why didn't I do this? Several not-very-good reasons:
  • I felt sorry for them,
  • I wasn't 100% convinced that I should push programming and math that hard,
  • it would have been more work for me,
  • not everyone needed that kind of practice,
  • those that needed that kind of practice COULD have done self-study.
The second reason for suboptimal pedagogy was that I tried to be more flexible with the modeling assignments than I was easily capable of -- I could create stuff, but some of it took longer than was convenient. In brief, we asked students to come up with a scientific question, explain what is known and unknown regarding that question and their study system, and design a conceptual model that captures the essence of their question and/or system. Students were then asked to formalize their conceptual model using mathematics or computer code or both. The students conceptual models were not all ecosystem models with merely pools and fluxes of all the same units and element(s). Rather, most were a hodge-podge of different sorts of variables that related typically in a mechanistic fashion, but were not comprised of, for instance, pools and fluxes of carbon. Therefore, the relatively low programming ability of the students (see first reason, above) and my desire to be flexible with regard to acceptable topics meant that I had to invent lots of unique code for each different student. And that, Virignia, is the second reason why my pedagogy was sub-optimal.

However, I think that forcing students to formalize their conceptual models has helped them see and understand their own conceptual models to a greater degree. Formalization helps them become ever more specific with regard to their conceptual model and this helps them generate more testable predictions. Formalization helps them understand what a mathematical model is and and how mathematical models provide structure to theory. The process helps show them how models are used in Science, and last, it helps them see indirect connections more clearly and accurately. Well, ... I hope it does all that.

Friday, April 16, 2010

What is your Bayesian prior on non-human animal emotion?

Although humans have a strong ability to communicate with other humans, we lack the ability to communicate as well with non-human animals. As a result, we know far more about the internal emotional states of other humans than we know about the internal emotional states of non-human animals. Where do we begin to make inferences about the internal states of non-human animals? What is the appropriate Bayesian prior for making inferences about the unknown internal states of non-human animals?

A long time ago, Rene Descartes (1649) posited that non-human animals are akin to machines (have no soul or mind and couldn't feel pain). Since then, it has been considered "scientific" to assume non-human animals actually are machines unless there is overwhelming evidence to the contrary. I propose that this is highly unscientific, and that it is an example of argumentum ad ignorantiam, that the absence of evidence is the evidence of absence. That is, Descartes, and millions since then, have found it convenient to presume that an absence of evidence about non-human animal emotion constitutes evidence of absence of non-human animal emotion.

Another approach to understanding non-human animal emotions, universally taken by infants, is to assume that "all others are like me." Indeed, this is how humans learn about each other. In the absence of a lot of knowledge, we assume that other humans (especially those that look like us) think and feel as we do. This is our Bayesian prior for interactions with other humans. Like Descartes's proclamation that non-humans are machines, this could also constitute a prior for understanding non-human animal emotion.

Is emotion likely to be a synapomorphy shared with a wide range of taxa? In my simplistic way of thinking, I propose two lines of reasoning that suggest it is. First, emotion in humans appears to be regulated in a primitive part of the central nervous system, whose structure is shared with a wide variety of taxa. If it looks like beer, smells like beer, tastes like beer, it might be beer. Second, emotions are useful. Fear and pain are widely recognized for their fitness benefit, for their adaptive value. I suggest that other emotions are likely to have similar fitness benefit. If a behavior generates joy or euphoria or happiness, organisms would be inclined to continue that behavior. Emotions could help provide mechanistic links between biochemistry and behavior.

Bayesian inference is useful in that it requires we think hard and think carefully about our prior beliefs. In that sense, it helps us become more scientific and maybe even more moral.

To P or not to P, that is the question...

I think that at least part of the reason most of us have a hard time stating what a frequentist P-value is (and is not) is because we do not know the difference between statisticians' correct definition and our common but erroneous definitions. In addition, or maybe another way of looking at it, is that the ambiguity of words in general (as opposed to math) contributes substantially to the confusion.

Here I take a stab at it.

A frequentist P-value (say, of a t-test for a difference between means) is the probability that a difference as large or larger than the observed difference would occur if our two samples were drawn from the same distribution, and the same experiment were conducted repeatedly ad infinitum (or ad nauseum). "A P value is often described as the probability of seeing results as or more extreme as those actually observed if the null hypothesis were true" (2).

A frequentist P-value of such a t-test is apparently not lots of things we wish it were (1):
  1. it is not the probability that our null hypothesis is true.
  2. it is not the probability that such a difference could occur by chance alone.
  3. it is not the probability of falsely rejecting the null hypothesis.
Each of these leave information out. Important elements of a correct definition include
  • The probability of observing data as extreme or more extreme in ...
  • repeated identical experiments and analyses, given ...
  • the a priori belief that the null hypothesis is true (this is a Bayesian "prior").
Thus we see that the incorrect definitions typically share something with a complete definition, and that under most circumstances, analyses that fit incorrect definitions (e.g., Bayesian posteriors) will be correlated frequentist P-values (see comment by Bolker comment below).

A frequentist confidence interval is a region calculated from our data and our selected confidence level, α, in a manner which would include the "true" population parameter (e.g., the "true" mean) 100(1-α)% of the time if the same experiment and analysis were conducted repeatedly ad infinitum. It is a region which, so calculated, would include the true population parameter in 95% of all hypothetically repeated identical experiments. Thus, the population parameter of interest is fixed (i.e., a "true" value exists), and the interval is random (because it is based on a randomized experiment).

A frequentist confidence interval is not an interval which we are 100(1-α)% certain contains the true parameter. I don't even know what this statement (i.e., 95% certain) means -- what is "certainty"?

A 95% Bayesian credible interval (a.k.a. Bayesian confidence interval) is the a continuous subset (i.e., an interval) of a posterior probability distribution of a parameter of interest (e.g., a mean). A posterior probability distribution is the probability distribution which results from combining of our prior beliefs about the parameter, and a conditional probability distribution of our data, given all possible relevant data sets. It contains all possible values of our parameter of interest (given our priors and our data, and our model). The credible interval is merely an interval which contains a most likely subset. That is, we are not sure what is was while the world turned and our data were collected, but the safest bet is inside the credible interval.

Key differences between frequentist and Bayesian statistics:
  • Parameter of interest (e.g., a mean): fixed (the Platonic archetype exists) vs. random (i.e., subject to the whims of the gods of stochasticity)
  • Prior beliefs: implicit and sometimes hard to discern vs. explicit and plainly stated.
  • Statements of probability: Pr(data|null) vs. Pr(h|data). That is, frequentist P-values are the probability of observing your data (or more extreme data) given that the null hypothesis is true, whereas Bayes posterior probability distributions describe the probability of your scientific hypothesis (not the null), given that your data are true.
  • "P-values": Exist vs. not typically presented (usually misinterpreted; Fisher used it as a "weight of evidence," whereas Neyman used it as a basis to make decisions (yes/no) but not necessarily true/false - I do not understand how or why they can do all that; in the Bayesian context, it is not always clear what such a beast would be because of differences in underlying interpretations).

My problem is that I do not have an intuition about how these things all differ or under what conditions they are likely to differ substantially. Therefore, I cannot keep them clearly differentiated in my head. All I can do is repeat them. It would help to explore the pathological cases where frequentist and Bayesian methods result in very different outcomes differ strongly.

1. http://en.wikipedia.org/wiki/P-value#Frequent_misunderstandings
2. http://www.jerrydallal.com/LHSP/pval.htm

Friday, December 4, 2009

Damschen et al. 2006

This amazing study implements at a landscape scale the type of experimental design more commonly observed in microcosms or old-fields. It is awesome!

An important difference between this experiment and those of microcosms is that microcosms run for many (10-100+) generations of the organisms, whereas this experiment ran (at the time of publication) for probably less than one generation for most of the organisms (recall generation = average age at parenthood). In that sense, it is less likely to confound evolutionary and ecological processes, so in that sense it is analogous to a pulse experiment.

The stats nerd appreciated Fig. 2C (y=Difference in richness between connected and unconnected, x=year). I wish that they reported more results in the text in terms of linear coefficients or effect sizes or actual differences, instead of the F-stats and P values. I would rather see them state biologically meaningful values, such as "The species richness of native species increased over time in connected (ave=4 spp/y +/- 1 spp) but not unconnected plots (ave=0 spp/y +/- 2 spp)."

I know it is a Science paper, but I wanted a lot more info in supplementary docs about which species were where. I am not sure why I want to know -- I should come up with hypotheses before I see the species list.

I could not figure out how they did their Chi-squared analysis (Table S5) which tests differences from expected frequencies of rare and common species in connected vs. unconnected patches. My guess is they did it right, but if not, it wouldn't be the first time if someone published bad stats in a prominent journal.

Adding a connector is simply increasing island area by doubling the size of the island from one patch to two patches. It need not be true that increasing island size increases average &alpha diversity of small samples on an island, but it would be true for a well-mixed island. So -- is this just the effect of area?

Wednesday, November 18, 2009

Suzan et al. 2009 - more benefits of biodiversity

It was a pleasure to read this paper on the effects of biodiversity (Suzan et al. 2009, "Experimental evidence for reduced rodent diversity causing increased hantavirus prevalence." PLoS ONE 4(5):e5461.) Investigators tested whether reduced biodiversity would lead to higher disease prevalence (proportion of rodents that are infected) via higher density-dependent transmission (through higher density), or via frequency-dependent transmission (via higher host-to-host encounters). Their experimental treatment "removed" non-competent rodent hosts via trapping, allowing the remaining two species (competent hosts) to increase in abundance via competitive release. They found evidence for both mechanisms: removing non-competent host species increased both the density and frequency of hosts, and prevalence in the experimental removal areas increased significantly with both host density and frequency.

Questions and comments:
-- To where did they remove the non-competent rodents? To "rodent heaven"? another forest patch?
-- They got their interpretation of Simpson's index of diversity and index of dominance backwards. Dominance, D, is the probability that to individuals drawn at random of the SAME species (not different species, as stated by Suszan et al.). It is 1-D (diversity) that is the probability that two individuals belong to different species. 1/D (inverse: used by Suzan et al. as diversity) has no probabilistic interpretation, but is a measure of entropy, like richness, Shannon-Weiner and Simpson's Index as 1-D (complement).
-- A standard approach to testing their hypotheses would have been to compare mean prevalences in control vs. treatment. This approach would have required that their treatments consistently increased host density and frequency. Instead, they compared the continuous linear relationships between prevalence (y) and density and relative density (x). This required only that their treatment (removals) increased maximum abundance. In this fashion, their treatment merely extended the range of the x-variables, which is a good way to increase the power of the regression. An alternative approach would have been to test mean prevalence, but with a more appropriate error distribution, like Gamma distribution, that tends to hang on to zero, and increase the variance and the mean together.
-- I cannot interpret their Table 1. What are the rows? If rows are treatments, I cannot see what they see. I see no interaction - I simply don't believe it.
-- The caption in figure 4 is incorrect. They have it backwards.
-- This seemed like a really long paper for this journal, although I am not all that familiar with their format. It is seven pages of the smallest font imaginable. I was expecting a Science or Nature-type paper. They included info that I did not think was necessary (e.g., "...and several weeks can go by with no rain at all.")

Very interesting, and the number of mistakes makes me (i) wonder what all of the NINE authors were doing, (ii) helps me relax and know that other people make mistakes too.

Tuesday, November 10, 2009

Sir Ronald Fisher vs. Rev. Bayes -- a comment on Kremen, Williams, and Thorp. 2002. Crop pollination...

A great little PNAS paper from 2002 (Kremen et al. 2002 Crop pollinaiton from native bees at risk from agricultural intensification. PNAS 99:16812-16816). They compared management (organic vs.conventional farms) and isolation from natural habitat (near vs. far), with regard to pollinator visitation rates and efficacy.

This is would be a nice paper for any undergrad class in ecology (nonmajors or majors).

My only issue is very minor: they state that "the effect of isolation from natural habitat appeared potentially to be more important than that of management" and cite a bunch of P-values from pairwise comparisons. I would argue that importance should be judged be effect size (or possible effect size) and definitely NOT based on P-values. Clearly the two are related, and in this case appear consistent with each other. However, confidence intervals, or better yet, credible intervals, would be better.

A totally uninspiring post....

Friday, October 2, 2009