Blog Archives

Short course on Bayesian data analysis and Stan 19-21 July in NYC!

July 7, 2015
By
Short course on Bayesian data analysis and Stan 19-21 July in NYC!

Bob Carpenter, Daniel Lee, and I are giving a 3-day short course in two weeks. Before class everyone should install R, RStudio and RStan on their computers. If problems occur please join the stan-users group and post any questions. It’s important that all participants get Stan running and bring their laptops to the course. Class The post

Read more »

R Recipe: Reordering Columns in a Flexible Way

May 16, 2015
By

Suppose you have a data frame with a number of columns. You want to put the Trader and System columns first but you also want to do this in a flexible way. One approach would be to specify column numbers. This does the job but it's not very flexible. After all, the number of columns The post

Read more »

Recent Common Ancestors: Simple Model

May 15, 2015
By
Recent Common Ancestors: Simple Model

An interesting paper (Modelling the recent common ancestry of all living humans, Nature, 431, 562–566, 2004) by Rohde, Olson and Chang concludes with the words: Further work is needed to determine the effect of this common ancestry on patterns of genetic variation in structured populations. But to the extent that ancestry is considered in genealogical The post

Read more »

Comrades Marathon Finish Predictions

April 23, 2015
By
Comrades Marathon Finish Predictions

* If you see a bunch of errors, you might want to try opening the page in a different browser. I have had some trouble with MathJax and Windows Explorer. There are various approaches to predicting Comrades Marathon finishing times. Lindsey Parry, for example, suggests that you use two and a half The post

Read more »

A Sankey Plot with Uniform Coloured Edges

April 7, 2015
By
A Sankey Plot with Uniform Coloured Edges

Following up on my previous post about generating Sankey plots with the riverplot package. It's also possible to generate plots which have constant coloured edges. Here's how (using some of the data structures from the previous post too): The post A Sankey Plot with Uniform Coloured Edges appeared first on Exegetic Analytics.

Read more »

Bags, Balls and the Hypergeometric Distribution

April 3, 2015
By
Bags, Balls and the Hypergeometric Distribution

A friend came to me with a question. The original question was a little complicated, but in essence it could be explained in terms of the familiar urn problem. So, here's the problem: you have an urn with 50 white balls and 9 black balls. The black balls are individually numbered. Balls are drawn from The post

Read more »

Bags, Balls and the Hypergeometric Distribution: Update

April 2, 2015
By

So... the Hypergeometric distribution (as used in one of my previous posts). That was a bit of overkill, wasn't it? To recap the problem: we have an urn filled with a selection of white and black balls. We want to calculate the probability that all of the white balls and all but one of the The post

Read more »

The Price of Fuel: How Bad Could It Get?

April 1, 2015
By
The Price of Fuel: How Bad Could It Get?

The cost of fuel in South Africa (and I imagine pretty much everywhere else) is a contentious topic. It varies from month to month and, although it is clearly related to the price of crude oil and the exchange rate, various other forces play an influential role. According to the Department of Energy the majority The post

Read more »

Dealing with a Byte Order Mark (BOM)

March 11, 2015
By
Dealing with a Byte Order Mark (BOM)

I have just been trying to import some data into R. The data were exported from a SQL Server client in tab-separated value (TSV) format. However, reading the data into R the "usual" way produced unexpected results: Those weird characters in the first record... where did they come from? They don't show up in a The post

Read more »

Book Review: R for Business Analytics

January 28, 2015
By
Book Review: R for Business Analytics

The book R for Business Analytics by Ajay Ohri sets out to look at "some of the most common tasks performed by business analysts and helps the user navigate the wealth of information in R and its 4000 packages." In my opinion it succeeds in covering an extensive range of topics but fails to provide The post

Read more »