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 […]

# Tag archives: MATLAB

## matlab rant 2

So I just read this great rant about Matlab by Olivia Guest, and it reminded me to update my previous rant about Matlab, so here it is. For the record, I don’t disagree with anything Olivia said, and I’m not overly defending Matlab. I am trapped in its local minima and am slowly reaching escape velocity, moving over […]

## Bayesian analysis toolbox for delay discounting, version 1.3

Posterior predictive checks The toolbox now calculates 2 measures of “goodness of fit” of the models. This is a useful quantitative reassurance that the models describe the participant discounting behaviour better than chance. In turn, this is important when we come to deciding which (if any) data files we should exclude. You can go and […]

## Bayesian analysis toolbox for delay discounting, version 1.2

I’ve just released Version 1.2 of the toolbox ‘Bayesian analysis toolbox for delay discounting.’ The main feature of this release was the addition of new models. For example, you can now estimate discount rates (ignoring the magnitude effect). So you can obtain estimates of the discount rate k, which is very useful if your primary […]

## Probabilistic programming: a tentative first encounter

While I have some experience with probabilistic programming in the flavour of Bayesian Networks, and have published papers using them, I am interested in the super-class of generic probabilistic programs. That is, right now I am happy with conducting inference on Bayesian Networks, but I want to learn how to conduct inference on generic programs. As […]

## 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 […]

## 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. Which results in this output. So we have a good […]

## Pimp your research code using UML class diagrams

Ideally, all research code should be made available at the point of submitting a paper. I’ve found that the way I write my research code has changed for the better now that I’ve made a commitment to making it open. However it can somewhat opaque and time consuming to understand, so how can we help those wanting to review, use, […]

## Hierarchical Bayesian estimation and hypothesis testing for delay discounting tasks

I am happy to announce my 3rd paper of the year, accepted for publication in Behavior Research Methods. Following my initial foray into writing review papers (2 earlier this year), this is my first methods paper, and also my first contribution to higher-level decision making.

## A tutorial on Bayesian models of perception

Vincent, B. T. (2015) A tutorial on Bayesian models of perception, Journal of Mathematical Psychology, 66:103–114.

## 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 […]

## Software for MCMC

If you’ve decided to join the increasing number of people using MCMC methods to conduct Bayesian inference, then one important decision is which software to use. This decision will be influenced by your programming language of choice, see Figure below. If you use Matlab, then really your best choice at the moment is JAGS. You use it […]

## Start coding. Do it.

This is not a fair, even-handed review of all possible languages for all purposes. The intended audience is undergraduate psychology students who cannot code. What is coding? Why learn to code? Excellent arguments are made in this person’s blog post “Why every (psychology) student should learn to code“. The main points are: If you want […]

## Goodbye Matlab

In the last few months I’ve decided to break off a ~15 year relationship with Matlab. We’ve been through many important times together and it’s not been an easy decision to make, but I think this is the best for both of us. Matlab saw me through my DPhil, helping me code up neural network […]

## 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) […]