diff --git a/pointprocesses/exercises/pointprocesses-1.tex b/pointprocesses/exercises/pointprocesses-1.tex index a27704c..7b28e6a 100644 --- a/pointprocesses/exercises/pointprocesses-1.tex +++ b/pointprocesses/exercises/pointprocesses-1.tex @@ -158,20 +158,25 @@ \question \qt{Statistics of spike counts} Now let's have a look at the statistics of the spike counts. \begin{parts} - \part Write a function that counts and returns a vector with the - number of spikes in windows of a given width $W$. + \part \label{counts} Write a function that counts with the number + of spikes in windows of a given width $W$. The spikes are passed + to the function as a cell array containing vectors of spike times. + The function returns a single vector with all the spike counts. + \begin{solution} + \lstinputlisting{counts.m} + \end{solution} - Use this function to generate a properly normalized histogram of - spike counts for the data of the three types of neurons. Use - 100\,ms for the window width. + \part Generate a properly normalized histogram of spike counts for + the data of the three types of neurons. Use 100\,ms for the window + width and the function from (\ref{counts}) for computing the spike + counts. - Compare the distributions with the Poisson distribution expected - for a Poisson spike train: + In addition, compare the distributions with the Poisson + distribution expected for a Poisson spike train: \[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \; , \] where $\lambda$ is the rate of the spike train that you should estimate from the data. \begin{solution} - \lstinputlisting{counts.m} \newsolutionpage \lstinputlisting{spikecountshists.m} \colorbox{white}{\includegraphics[width=1\textwidth]{spikecountshists}}