164 lines
6.1 KiB
TeX
164 lines
6.1 KiB
TeX
\documentclass[12pt,a4paper,pdftex]{exam}
|
|
|
|
\newcommand{\exercisetopic}{Point Processes}
|
|
\newcommand{\exercisenum}{11}
|
|
\newcommand{\exercisedate}{January 19th, 2021}
|
|
|
|
\input{../../exercisesheader}
|
|
|
|
\firstpagefooter{Prof. Dr. Jan Benda}{}{jan.benda@uni-tuebingen.de}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
\begin{document}
|
|
|
|
\input{../../exercisestitle}
|
|
|
|
\begin{questions}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
\question \qt{Statistics of interspike intervals}
|
|
Download the files \code{poisson.mat},
|
|
\code{pifou.mat}, and \code{lifadapt.mat} from Ilias.
|
|
Each of these files contains several trials of spike trains
|
|
of a specific type of neuron. The spike times are measured in seconds.
|
|
|
|
We want to compare the statistics of the interspike intervals of the
|
|
three neurons.
|
|
\begin{parts}
|
|
\part Load the spike trains from the three files.
|
|
Make sure that the data are assigned to different variables.
|
|
|
|
What is the type of the data? How can you access individual spike trains?
|
|
How do you access single spike times?
|
|
\begin{solution}
|
|
\begin{lstlisting}
|
|
clear all
|
|
% not so good:
|
|
load poisson.mat
|
|
whos
|
|
poissonspikes = spikes;
|
|
load pifou.mat;
|
|
pifouspikes = spikes;
|
|
load lifadapt.mat;
|
|
lifadaptspikes = spikes;
|
|
clear spikes;
|
|
% better:
|
|
clear all
|
|
x = load('poisson.mat');
|
|
poissonspikes = x.spikes;
|
|
x = load('pifou.mat');
|
|
pifouspikes = x.spikes;
|
|
x = load('lifadapt.mat');
|
|
lifadaptspikes = x.spikes;
|
|
clear x;
|
|
\end{lstlisting}
|
|
\end{solution}
|
|
|
|
\newsolutionpage
|
|
\part Write a function that illustrated the spike times of the
|
|
first $t_{max}$ seconds in a raster plot. Each spike train is one
|
|
row in the raster plot. Each spike is a vertical line at the time
|
|
of the spike. When appropriate, the function should use milliseconds
|
|
for the time axis instead of seconds.
|
|
|
|
Use this function to plot the first second of the
|
|
spike rasters of the three neurons.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/rasterplot.m}
|
|
\lstinputlisting{../code/plotspikeraster.m}
|
|
\mbox{}\\[-3ex]
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{spikeraster}}
|
|
\end{solution}
|
|
|
|
\part Write a function that returns a single vector containing the
|
|
interspike intervals of all trials of spike times.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/isis.m}
|
|
\end{solution}
|
|
|
|
\part Write a function that computes an estimate of the
|
|
probability density of interspike intervals from a vector of
|
|
interspike intervals. The function should automatically choose a
|
|
good bin width for the histogram.
|
|
|
|
Write another function that plots the probability density of
|
|
interspike intervals given a vector of interspike intervals as
|
|
argument. The function should use the first function for computing
|
|
the probability density. The interspike intervals are given in
|
|
seconds, but the plot should mark the interspike intervals in
|
|
milliseconds. In addition, the function should compute the mean,
|
|
the standard deviation and the coefficient of variation and
|
|
display them in the plot as well.
|
|
|
|
Use this and the previous functions to compare the
|
|
interspike interval statistics of the three neurons.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/isihist.m}
|
|
\lstinputlisting{../code/plotisihist.m}
|
|
\lstinputlisting{../code/plotisihs.m}
|
|
\mbox{}\\[-3ex]
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{isihist}}
|
|
\end{solution}
|
|
|
|
% XXX Add return map!!! XXX
|
|
\part Write a function that computes and plots the serial
|
|
correlations of interspike intervals for lags upto
|
|
\code{maxlag}. The serial correlations $\rho_k$ for lag $k$ of the
|
|
interspike intervals $T_i$ are the correlation coefficients
|
|
between interspike intervals $T_i$ and the intervals $T_{i+k}$
|
|
that are shifted by lag $k$:
|
|
\[ \rho_k = \frac{\langle (T_{i+k} - \langle T \rangle)(T_i -
|
|
\langle T \rangle) \rangle}{\langle (T_i - \langle T
|
|
\rangle)^2\rangle} = \frac{{\rm cov}(T_{i+k}, T_i)}{{\rm
|
|
var}(T_i)} = {\rm corr}(T_{i+k}, T_i) \]
|
|
|
|
Use this function to compare the serial correlations of the
|
|
interspike intervals of the three neurons.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/isiserialcorr.m}
|
|
\lstinputlisting{../code/plotserialcorr.m}
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{serialcorr}}
|
|
\end{solution}
|
|
|
|
\end{parts}
|
|
|
|
\continuepage
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
\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 the number of
|
|
spikes in windows of a given width $W$.
|
|
|
|
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.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/spikecounts.m}
|
|
\newsolutionpage
|
|
\lstinputlisting{../code/spikecountshists.m}
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{spikecountshists}}
|
|
\end{solution}
|
|
|
|
\newsolutionpage
|
|
\part Write a function that computes for a range of window widths
|
|
the mean, the variance and the Fano factor of the corresponding
|
|
spike counts. The function should generate two plots. One showing
|
|
the spike count variance in dependence on the mean spike count
|
|
(the mean spike count increases for larger window widths). The
|
|
other plot showing the Fano factor as a function of window width.
|
|
\begin{solution}
|
|
\lstinputlisting{../code/fanoplot.m}
|
|
\newsolutionpage
|
|
\lstinputlisting{../code/fanoplots.m}
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{fanoplotspoisson}}
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{fanoplotspifou}}
|
|
\colorbox{white}{\includegraphics[width=1\textwidth]{fanoplotslifadapt}}
|
|
\end{solution}
|
|
|
|
\end{parts}
|
|
|
|
\end{questions}
|
|
|
|
\end{document}
|