Blog Archives

MCMC Diagnostics in R with the coda Package

August 29, 2010
By
MCMC Diagnostics in R with the coda Package

This is a follow up to my recent post introducing the use of JAGS in R through the rjags package. In the comments on that post, Bernd Weiss encouraged me to write a short addendum that describes diagnostic functions that you should use to assess the output from an MCMC sampler. I’ve only been using

Read more »

Blegging for Data

August 28, 2010
By

I’m in the middle of a new project that involves analyzing the packages that are currently on CRAN. As part of my work, I could really benefit from information about which packages are installed on people’s computers. If you’re willing to part with a bit of your time and privacy, I’d very much appreciate you

Read more »

ProjectTemplate

August 26, 2010
By

Introduction As many people already know, I’ve recently uploaded a new R package called ProjectTemplate to GitHub and CRAN. The ProjectTemplate package provides a function, create.project(), that automatically builds a directory for a new R project with a clean sub-directory structure and automatic data and library loading tools. My hope is that standardized data loading,

Read more »

Using JAGS in R with the rjags Package

August 20, 2010
By

Get Everything Set Up I’m going to assume that you have access to a machine that will run JAGS. If you don’t, then you should be able to use WinBUGS, which is very easy to get set up. Unfortunately, the details of what follows may not help you as much if you’re using WinBUGS. To

Read more »

Twifficiency Scores

August 18, 2010
By
Twifficiency Scores

Neil Kodner wrote a great post this morning about yesterday’s Twifficiency scores outbreak. He grabbed all the auto-tweeted scores he could find and plotted their distribution. I was struck by the asymmetry of the resulting distribution, which you can see below: Thankfully, Neil handed me the raw data for his plot, so I was able

Read more »

Unit Testing in R: The Bare Minimum

August 17, 2010
By

Introduction This week I decided to start unit testing my R code, so I taught myself the bare minimum about the RUnit and testthat packages to be able to use them. Here’s what I found necessary to get started writing tests with both packages. RUnit Basic Example I’m going to assume that you’ve got a

Read more »

Doing Maximum Likelihood Estimation by Hand in R

April 21, 2010
By
Doing Maximum Likelihood Estimation by Hand in R

Lately I’ve been writing maximum likelihood estimation code by hand for some economic models that I’m working with. It’s actually a fairly simple task, so I thought that I would write up the basic approach in case there are readers who haven’t built a generic estimation system before. First, let’s start with a toy example

Read more »

The Price of Calculation

March 15, 2010
By

In a world in which the price of calculation continues to decrease rapidly, but the price of theorem proving continues to hold steady or increase, elementary economics indicates that we ought to spend a larger and larger fraction of our time on calculation.1 Over the next ten years, I hope that more and more mathematically

Read more »

Gay Marriage: Another Data Point

January 16, 2010
By

Relevant to my earlier post about the relationship between direct democracy and laws prohibiting gay marriage, Pew Research just published poll data showing that a majority of Americans disapprove of same-sex marriage.

Read more »

Academics’ Slang: Orthogonal

January 12, 2010
By

H. G. Wells famously said that, “statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write.” I think we’re getting closer to that day: even the Supreme Court of the United States plan...

Read more »