Category: Matlab
-
Smoothing a non-uniformly sampled surface
Working with 2d data defined on a grid is pretty straightforward in Matlab; you can easily visualize the data with imagesc and smooth it through convolution. Working with data sampled at non-uniform intervals is much trickier. Doing something as simple as visualizing it becomes a pain. One way of getting around this is to resample…
-
Non-negative sparse priors
Sparseness priors, which impose that most of the weights are small or zero, are very effective in constraining regression problems. The prototypical sparseness prior is the Laplacian prior (aka L1-prior), which imposes a penalty on the absolute value of individual weights. Regression problems (and GLMs) with Laplacian priors can be easily solved by Maximum a…
-
Obscure Matlab features #4 – Writing help
Keeping code undocumented now might save you a few minutes, but it will undoubtedly cause you pain and misery when you do revisions 6 months from now. As you surely know, Matlab’s built-in help function parses comments immediately following the function byline and outputs these comments in the command window. It has a couple of…
-
Plexon Matlab API now available for Linux
Regular readers of the blog will remember my previous struggles reading .plx files on platforms other than Windows. I got contacted by none other than Plexon boss Harvey Wiggins about this. I’m happy to report that they’ve posted an updated Matlab offline SDK which compiles on 32- and 64-bit Linux. It may be possible to…
-
Verifying analytical Hessians
When using optimization functions which require Hessians, it’s easy to mess up the math and end up with incorrect second derivatives. While Matlab’s optimization toolbox offers the DerivativeCheck option for checking gradients, it doesn’t work on Hessians. This nice package available on Matlab Central will compute Hessians numerically, so you can easily double check your…
-
Hamiltonian Monte Carlo
I’ve been getting more into MCMC methodology recently. There’s a paper published this year by Ahmadian, Pillow & Paninski on different efficient MCMC samplers in the context of decoding spike trains with GLMs. The same methods could potentially be used, of course, for other purposes, like tracking receptive fields. Of particular interest is a remarkably…