Category: Matlab examples
-
Poor man’s parallel computing on multiple computers in Matlab
Let’s say that you need to run the same analysis with multiple datasets; for instance, you need to do reverse correlation with multiple cells. This might take a while, so you would like to run the analysis on multiple computers. The computers might be a bit different from each other, as well as the recording…
-
Using a particle filter to decode place cells
In the last post, I discussed using an extended Kalman filter to decode place cells, based on the algorithm published in Brown et al. (1998). The results looked pretty good. EKFs are certainly better than population vector approaches that don’t consider the sequential nature of the decoding task. The fact that the path of the…
-
Using an iterated extended Kalman filter to decode place cells
Decoding neuronal activity is a powerful technique to study how information is encoded in a population and how it might be extracted by other brains areas. Hippocampal place cells are a prime example of a system that can be studied fruitfully from a decoding persepective. In a typical place cell decoding experiment, a population of…
-
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…
-
GLMs and Hidden Markov models for single neurons
I posted recently about modeling neurons with continuous state-space dynamics. It’s also possible to model neurons with Hidden Markov models (HMMs), which are state-space models with discrete rather than continuous states. In this post I’m going to focus on the application of HMMs to single neuron data. Single neurons with simple states Suppose that a…
-
Approximate log determinant of huge matrices
Log determinants frequently need to be computed as part of Bayesian inference in models with Gaussian priors or likelihoods. They can be quite troublesome to compute; done through the Cholesky decomposition, it’s an operation. It’s pretty much infeasible to compute the exact log det for arbitrary matrices > 10,000 x 10,000. Models with that many…