Category Archives: Bayesian statistics

Bayesian ANOVA: Powerful inference with within-group sample size of 1

By | March 9, 2017

1 Objective 2 The data 3 Fixed-effects ANOVA in JAGS 4 Relaxing the assumption of constant variance 5 Conclusion This post is inspired by a question by Dylan Craven that he raised during my Bayesian stats course. 1 Objective My aim here is to demonstrate that, in Bayesian setting, one can make powerful inference about… Read More »

Kéry & Royle have a new book on hierarchical modeling in ecology. It's good

By | January 7, 2016

Marc Kéry's books are as important for learning (and teaching) hierarchical modeling as Crawley's The R Book is for learning R. I hold Kéry's Introduction to WinBUGS high for the uncompromising didactic clarity. J. Andrew Royle is one of the founding minds (with James Nichols and Darryl MacKenzie) of the so called occupancy modeling, and… Read More »

Survival analysis: basic terms, the exponential model, censoring, examples in R and JAGS

By | May 13, 2015

I have put together some basic material on survival analysis. It is available as: .html document with highlighted syntax here. Printer-ready .pdf document here. GitHub repository with all the source files here. Main motivation was that I wanted to learn the basics myself; also, it's tricky to find simple examples of survival models fitted in… Read More »

Species Distribution Models on the right track. Finally.

By | September 2, 2014

Species Distribution Models (SDM) a.k.a. Niche Models have always been a busy pile of confusion, ideology and misguided practices, with the real mess being the “presence only” SDMs. Interestingly, when you go to conservation or biogeography symposiums, you can hear the established SDM gurus starting their talks with: “During the last ten years SDMs have… Read More »

Spatial autocorrelation of errors in JAGS

By | February 10, 2014

In the core of kriging, Generalized-Least Squares (GLS) and geostatistics lies the multivariate normal (MVN) distribution – a generalization of normal distribution to two or more dimensions, with the option of having non-independent variances (i.e. autocorrelation). In this post I will show: (i) how to use exponential decay and the multivariate normal distribution to simulate… Read More »

Poisson regression fitted by glm(), maximum likelihood, and MCMC

By | October 30, 2013

The goal of this post is to demonstrate how a simple statistical model (Poisson log-linear regression) can be fitted using three different approaches. I want to demonstrate that both frequentists and Bayesians use the same models, and that it is the fitting procedure and the inference that differs. This is also for those who understand… Read More »

The joy and martyrdom of trying to be a Bayesian

By | August 30, 2013

Some of my fellow scientists have it easy. They use predefined methods like linear regression and ANOVA to test simple hypotheses; they live in the innocent world of bivariate plots and lm(). Sometimes they notice that the data have odd histograms and they use glm(). The more educated ones use generalized linear mixed effect models.… Read More »

Direct support for hypotheses is finding its way to high-profile journals

By | April 23, 2013

In this week's Nature paper, Tingley & Huybers report that recent temperature extremes at high northern latitudes are unprecedented in the past 600 years. Besides the scientific relevance (which I do not discuss here) it has one remarkable methodological aspect: it uses hierarchical Bayesian modelling. Moreover, what is really exciting is the way the authors… Read More »

Predictors, responses and residuals: What really needs to be normally distributed?

By | February 18, 2013

Introduction Many scientists are concerned about normality or non-normality of variables in statistical analyses. The following and similar sentiments are often expressed, published or taught: "If you want to do statistics, then everything needs to be normally distributed." "We normalized our data in order to meet the assumption of normality." "We log-transformed our data as… Read More »

Data-driven science is a failure of imagination

By | January 2, 2013

Professor Hans Rosling certainly is a remarkable figure. I recommend watching his performances. Especially the BBC's "Joy of Stats" is exemplary. Rosling sells passion for data, visual clarity and great deal of comedy. He represents the data-driven paradigm in science. What is it? And is it as exciting and promising as the documentary suggests? Data-driven scientists… Read More »

Downscaling species distributions using multi-scale logistic model

By | September 27, 2012

These are teaching materials to demonstrate how a simple Species Distribution Model can be made multi-scale. We published the methods presented here in the following paper: Keil et al. in Methods in Ecology and Evolution. This post is not entirely self-explanatory, it is going to be used during a lab seminar. Figure 1 Graphic representation… Read More »

Linear regression in OpenBUGS

By | August 19, 2012

I always wondered why is it so difficult to find an OpenBUGS example of simple linear regression on the Web. Curiously, such example is even missing in the OpenBUGS help. The only nice example so far is in the book by Marc Kéry. I have simplified the code. You need to have OpenBUGS (or WinBUGS)… Read More »