The accurate characterization of spike firing rates including the determination of when changes in activity occur is a fundamental issue in the analysis of neurophysiological data. Here we describe a state-space model for estimating the spike rate function that provides a maximum likelihood estimate of the spike rate, model goodness-of-fit assessments, as well as confidence intervals for the spike rate function and any other associated quantities of interest. Using simulated spike data, we first compare the performance of the state-space approach with that of Bayesian adaptive regression splines (BARS) and a simple cubic spline smoothing algorithm. We show that the state-space model is computationally efficient and comparable with other spline approaches. Our results suggest both a theoretically sound and practical approach for estimating spike rate functions that is applicable to a wide range of neurophysiological data.
When does a neuron respond to an external sensory stimulus or to a motor movement? When is its maximum response to that stimulus? Does that response change over time with experience? Neurophysiologists and statisticians have been trying to develop approaches to address these questions ever since this experimental approach was developed. One of the most widely used approaches used to determine when and if a neuron fired to the stimulus is to use a peristimulus time histogram (PSTH), simply averaging the responses over some time bin over all the trials collected. However, because there is no principled way of choosing the bin size for the PSTH, its interpretation is difficult. An even more challenging question is characterizing neural activity of responses to a stimulus if it changes over time as is the case in learning. Again, averaging techniques are typically used to characterize changes across trials, but averaging across 5 or 10 trials severely limits the temporal resolution of this kind of analysis. Beyond averaging techniques, a range of more sophisticated statistical methods have been applied to characterize neural activity including regression or reverse correlation techniques [
Recently models have been proposed for the analysis of spike train data using the state-space approach [
To address this issue, we now describe a state-space model for estimating the spike rate function by maximum likelihood using an approximate Expectation-Maximization (EM) algorithm. A major advance of this model over our previous model is that we can now assess model goodness-of-fit and compute confidence intervals for the spike rate function and other associated quantities of interest such as location of maximal firing. In this way, one can determine the precise timing of neural change either within or across trials. Using simulated spike rate data, we first compare our approach with that of Bayesian adaptive regression splines (BARS, [
We assume that the spike rate function of a single neuron is a dynamic process that can be studied with the state-space framework used in engineering, statistics, and computer science [
Assume that during a neurophysiological experiment in which the spiking activity of a single neuron is recorded for
To facilitate presentation of the model, we divide the time period
Using the theory of point processes [
We define
To understand what is accomplished in the EM model fitting, we note that the log of the joint probability density of the spike train data and the state process (
Given the maximum likelihood estimates of the
Approximating the probability density of the state at
An objective of the spike rate function or PSTH analysis is to compare rate functions between two or more time points in the observation interval
An important part of our analysis is to assess how well the model estimates the true function in the presence of noise. To determine this, we designed a simulation study to test our estimation method across a range of rate curves with differing noise levels. We compared the estimated function and true function using the average mean squared error (MSE). For our assessments of goodness-of-fit in the real data cases, we used the chi-squared test. This tests the extent to which the observed number of spikes in a prespecified time interval is consistent with the numbers predicted by the model [
We compare our state-space smoothing methods to two established procedures for data smoothing: cubic splines and Bayesian adaptive regression splines.
Cubic splines are a standard method for smoothing of both continuous-valued and discrete data [
Bayesian adaptive regression splines (BARS) is a recently developed procedure for smoothing both continuous-valued and discrete data [
To illustrate the performance of our methods in the analysis of an actual learning experiment, we analyze the responses of neural activity in a macaque monkey performing a location-scene association task, described in detail in Wirth et al. [
As a second illustration of our methods we consider spike data recorded from the supplementary eye field (SEF) of a macaque monkey [
We first designed a simulation study to compare our state-space smoothing method with BARS and splines. This study tests the ability to reproduce accurately test curves in the presence of noise. We constructed a true function of the form
Test curves for simulation study. The six true functions (denoted Examples 1–6, green curves) are generated using a sigmoid combined with a Gaussian (
To simulate count data, we added to each of the 6 test curves zero-mean, Gaussian noise with a variance of either
For this study, we compared our state-space model estimates with those of BARS and splines using the mean squared error computed from
We considered two formulations for our state-space model. For the first naïve model (SS1), we estimated the initial rate at
For the lowest noise case
Average mean squared errors (MSEs) computed for the simulation study. We show results for SS1 (red), SS2 (black), BARS (blue) and splines (green) for Examples 1–6 at three different noise levels. With SS1 and splines the MSE increases as the noise level increases whereas SS2 and BARS give more consistent results across the range of noise levels.
As the noise variance increases to
Example of performance of all four techniques applied to data from Example 6 with noise variance of 3. We show SS1 (a), SS2 (b), BARS (c), and splines (d). On each figure we show the raw count data (blue), mean estimated count (red), and true function used to generate the data (green). Each panel shows the 10 raw data curves and 10 estimated counts superposed. The SS1 and splines methods tend to track the noise whereas SS2 and BARS have more smoothing.
Because SS1 appears to track the noise in the data without sufficient smoothing, we use only the SS2 approach for the following cases applied to real data.
As a first illustration of our method applied to real data, we take the data from one hippocampal cell from the macaque monkey performing the location-scene association task described in Section
One current strategy for estimating changes in firing rate as a function of time from the start of each trial is to employ the peristimulus time histogram (PSTH). The PSTH sums the observed spikes across trials and displays them as a histogram-type plot of counts occurring within fixed intervals of time. The choice of time interval or bin width is often made somewhat arbitrarily by the experimenter based on the desired degree of smoothing.
First, we applied our state-space algorithm to the count data summed (Figure
To assess how well each model fits the data we carried out the
To examine the effects of choice of bin width on the analysis of this data, we resorted the raw data into bins with widths of 10 milliseconds (gray bars, Figure
A major advantage of the SS approach over the other options is that it provides confidence bounds (red dashed curves, Figure
An important question here is whether the instantaneous firing rate is significantly different across the 1700-millisecond length of the experiment. Using the Monte Carlo algorithm presented in Appendix
Using a similar Monte Carlo approach (see Appendix
(a) Raster plot of raw spike data for a single cell over 55 trials. The four behavioral periods (baseline, scene, delay, and response) are delineated by the vertical dashed lines. (b) Peristimulus time histogram (PSTH) for the data with bin size of 1 millisecond. (c) Firing rates computed by state-space model (blue), BARS (green), and splines (red). The 95% confidence bounds for the state-space model are shaded in gray.
State-space approach applied to data from previous figure binned at different time precisions. We show data bin widths of 10 (a), 20 (b), and 50 (c). The estimated mean firing rate (blue curves) tends to be smoother as the bin width increases. The 95% confidence bounds (red dashed curves) remain relatively constant in width for all three cases.
Trial-by-trial comparison between firing rates shown in Figure
Uncertainty in the maximal firing rate for hippocampal data in Figure
In our second example, we consider the same data as the previous example only here we are interested in tracking neural activity as a function of trial number. The neural data is divided into distinct time periods based on the timing of the stimuli shown in the trail. Each trial is initiated with the animal fixating a central fixation spot. These time periods include a baseline period (0–300 milliseconds after fixation), a scene period (301–800 milliseconds after fixation), a delay period (801–1500 milliseconds after fixation) and a response period (1501–1700 milliseconds after fixation). We seek in this example to determine the earliest trial where we can say that the firing rate during the delay period is significantly above that in the baseline period. Thus, we analyze the count data for the delay and baseline periods as a function of trial number in the session (Figure
From examination of the median firing rate estimates from our state-space model, it is evident that the rate from the delay period (broad black curve, Figure
In addition to comparing the delay rate with the baseline rate, we can also employ the algorithm in Appendix
We carried out a
(a) Firing rates with 95% confidence limits in delay period (black) and baseline period (blue). Raw count data is shown as dots for delay (black) and baseline (blue). BARS (splines) results for delay and baseline are red (green). (b) Probability of the two firing rates estimated using the state-space method in panel A being different as a function of trial. By trial 21, the ideal observer can be confident that the firing rate in the delay period is significantly different
As a third example of our technique applied to real data, we consider the supplementary eye field data from Olson et al. [
The PSTH of the raw data (gray bars, Figure
The results of the chi-squared goodness-of-fit tests indicate that the state-space method (
One important feature of this experiment was to find the location and magnitude of the maximal firing rate. To find the estimated maximal firing rate, we used Monte Carlo simulation (Appendix
(a) PSTH of raw data (gray bars) from SEF study in Olson et al. [
We present a state-space approach that allows the experimenter to input data at the precision of the measurements and provides a computationally efficient estimate of the firing rate and its confidence limits. The approach also allows the experimenter to investigate particular features of the firing rate curve such as when it differs significantly from baseline. It also provides confidence limits on features of interest in the firing rate such as the location and magnitude of the peak. These additional features provide a powerful set of tools with which one can analyze a wide range of neurophysiological experiments. This framework for analyzing spike train data can also be easily integrated with results from an analogous state-space model developed to analyze changes in behavioral learning [
The state-space approach compares favorably with the other two smoothing techniques considered. The confidence intervals are consistent across a range of reasonable bin width values for the PSTH (Figure
For our simulation study we considered two formulations for our state-space model. We found that using a naive estimate of initial firing rate based on a few initial data points led to a random walk model that tracked the data so well that there was practically no smoothing. This model would perform poorly in real data situations where there is noise. We modified our approach by introducing a preprocessing step. By making use of the Markov-properties of the model, we reversed the data, made a maximum likelihood estimate of our end point and then used this value as a fixed initial condition for our implementation of the model. This resulted in a smoother estimate of firing rate, more consistent with the true data in the simulation study. A similar count data model [
As illustrated in the examples taken for the location-scene association task, this state-space algorithm provides an accurate way to describe the within trial dynamics as well as the across trial dynamics illustrated in the raster plot of Figure
In the future this model can be extended to include an arbitrary level of smoothness. This might be done by increasing the order of the autoregressive model in (2), thereby adjusting the stochastic smoothness criterion in the final (penalty) term in the likelihood (
The use of the EM algorithm to compute the maximum likelihood estimate of parameters
Given
Given the filter algorithm in (
We estimated the initial conditions
Given
For
For each
Compute the lower and upper limits of the
We take
To compare whether the spike rate function at one time is significantly greater than the rate function at another time, we note that the approximate posterior probability density of the state process is a
set
draw
if
We compute
Given
For
For each
Compute
Compute
Compute the lower and upper limits of the
We take
The authors are grateful to Rob Kass for helpful discussions on the implementation and interpretation of BARS. Support was provided by NIDA grant DA015644, NIMH grants MH59733, MH61637, MH071847 and DP1 OD003646-01 to E. N. Brown. Support was provided by NIDA grant DA01564, NIMH grant MH58847, a McKnight Foundation Grant and a John Merck Fund grant to W. Suzuki. Support was also provided by the Department of Anesthesiology, UC Davis (A. C. Smith) and CAPES, Ministry of Education, Brazil (J. D. Scalon).