Optimal allocation of students to modules

The problem One of my tasks as head of our final undergraduate year on our Psychology MA/BSc programme is to allocate students to elective modules. We have in the order of 80-100 undergraduates in our final year, and ignoring their undergraduate dissertation, most of them must take 3 modules. There are exceptions however for joint …

Workshop report: What is Attention?

On April 21st – 22nd 2017, we held a workshop at Carnegie Mellon University, called What is Attention? The core organising group was Wayne Wu (Carnegie Mellon University), Britt Anderson (University of Waterloo), Rich Krauzlis (National Eye Institute), and myself Ben Vincent (University of Dundee). We had an esteemed set of attendees (see below) who …

Slice sampling Matlab demo

So far we’ve had a look at rejection sampling and importance sampling. Here we take a quick look at slice sampling, although rather than implementing it ourselves, we will use the built in Matlab slicesample function. Using our parameter estimation example, we will use slice sampling to estimate the mean and sigma of some samples from …

Importance sampling Matlab demo

Importance sampling is related to rejection sampling, which I looked at in the last post. Here is a short demo. %% true probability distribution true_func = @(x) betapdf(x,1+1,1+10); %% Do importance sampling N = 10^6; % uniform proposal distribution x_samples = rand(N,1); proposal = 1/N; % evaluate for each sample target = true_func(x_samples); % calculate importance …

Rejection sampling Matlab demo

I’ve been using MCMC, but I’ve wanted to flesh out my knowledge and explore the space of sampling approaches a little more. One very simple, yet inefficient method, is rejection sampling. Here is a little Matlab example I put together after seeing how easy it was. %% true probability distribution true_func = @(x) betapdf(x,1+1,1+10); %% Do …

Cognitive modelling 3: the importance of a script

One of the key things we must avoid is mess and confusion. In the last post I briefly covered one possible template for a research project. One of the reasons why cognitive modelling projects might be a little tricky is because you are not just using an off the shelf software package. For example, if …

Cognitive modelling 2: project structure

What we definitely want to do is avoid confusion and mess. Having a clear project structure and workflow has many advantages. While there is no one single correct way to organise a project, putting a bit of thought into it, and learning from past projects can help a lot. This is the workflow that works for …

Cognitive modelling 1: programming problems

This is the first post in a series exploring programming practice in cognitive modelling. While I have over a decade of experience in cognitive modelling, I am in no way an expert and have no formal computer science training. I am not an authority on this, I am feeling my way. Comments welcome. This post may …

Plotting posterior predictive distributions

I’ve just released a small bit of Matlab code on GitHub which helps automate the job of plotting posterior predictive distributions. If you are inferring posterior distributions of parameters of a 1D function (e.g. y=mx+c) then this code will plot the posterior predictive distribution for you. This should be handy for you to eyeball how well a model …

Book review: Bayes’ Rule, by James V Stone

  Until recently, many texts on Bayesian inference assumed the reader had a strong background in mathematics or statistics. I found that really frustrating and it really got in my way of understanding this stuff. But this concise book (~160 pages) is a really great introduction. If I had this book when I was learning, …

Free GitHub private repos for academics

GitHub is a great online repository and version control platform for your code. I’ve only started using it recently and I really like it so far. The only downside is that their free account does not allow for private repositories. This is a bit not good if you want to work on code for a research …

Collaborative paper writing in LaTeX

Collaborative paper writing is a logistical nightmare. Perhaps one of the most common methods is for people to email versions of the document back and forth between collaborators. I know people who do this, and I have done it in the past. But this is a bad idea because: if your collaborator is taking their …

Energy efficient receptive field code

[UPDATE: February 2014] The files and instructions are now hosted on GitHub.   Energy efficient receptive field code by Benjamin Vincent is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Unported License. This minimal set of MATLAB functions will set up a simple neural network to learn receptive fields. These receptive fields minimise an energy function which involves a) …