Calling R from Matlab – flat file communication

In the last post I showed how to fit a Bayesian hierarchical model in R to estimate experimental parameters. Our main data analysis pipeline uses Matlab, and we’d like to integrate these two environments for the purpose of analysis. The example involved JAGS, which does have a direct Matlab interface in addition to the more common R one, but more … More Calling R from Matlab – flat file communication

Off-the-shelf optimization functions in Matlab

Estimating a statistical model via maximum likelihood or MAP involves minimizing an error function – the negative log-likelihood or log-posterior. Generic functions built in to Matlab like fminunc and fmincon will often do the trick. There are many other free solvers available, which are often faster, or more powerful: Solvers by Mark Schmidt: there’s a huge collection of functions from Mark … More Off-the-shelf optimization functions in Matlab

Whiten images in Matlab

Previously, I showed how to whiten a matrix in Matlab. This involves finding the inverse square root of the covariance matrix of a set of observations, which is prohibitively expensive when the observations are high-dimensional – for instance, high-resolution natural images. Thankfully, it’s possible to whiten a set of natural images approximately by multiplying the … More Whiten images in Matlab