Articles by petrkeil

Spatial autocorrelation of errors in JAGS

February 10, 2014 | 0 Comments

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 … ... [Read more...]

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

October 29, 2013 | 0 Comments

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 … ... [Read more...]

The joy and martyrdom of trying to be a Bayesian

August 30, 2013 | 0 Comments

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 … ... [Read more...]

Spatial correlograms in R: a mini overview

May 21, 2013 | 0 Comments

Spatial correlograms are great to examine patterns of spatial autocorrelation in your data or model residuals. They show how correlated are pairs of spatial observations when you increase the distance (lag) between them - they are plots of some index…Read more → [Read more...]

Beware: 2 is not always 2 in R

May 14, 2013 | 0 Comments

This post is minimalistic. Consider this: Now let's have look at what's inside x: But is it really true? Here you go. A colleague of mine was once ruined by this for an entire day before we realized what was…Read more → [Read more...]

AIC & BIC vs. Crossvalidation

May 4, 2013 | 0 Comments

Model selection is a process of seeking the model in a set of candidate models that gives the best balance between model fit and complexity (Burnham & Anderson 2002). I have always used AIC for that. But you can also…Read more → [Read more...]

Not all proportion data are binomial outcomes

March 24, 2013 | 0 Comments

It really is trivial. Not every proportion is frequency. There are things that have values  bounded between 0 and 1 and yet they are neither probabilities, nor frequencies. Why do I even bother to write this? Because some kinds of…Read more → [Read more...]

Data-driven science is a failure of imagination

January 2, 2013 | 0 Comments

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…Read more → [Read more...]

Fast Conway’s game of life in R

November 25, 2012 | 0 Comments

Here I demonstrate a simple way to code Conway's game of life (GoL) in R and to produce the animation above. Cellular automata in R are usually painfully slow if you iterate through all grid cells in an array. A…Read more → [Read more...]

Linear regression in OpenBUGS

August 18, 2012 | 0 Comments

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 … Continue reading → [Read more...]

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)