fixed exercise 01 of point processes
This commit is contained in:
parent
4e17882dd5
commit
53c2f92629
@ -26,7 +26,7 @@ function isicorr = isiserialcorr(isivec, maxlag)
|
|||||||
% plot:
|
% plot:
|
||||||
plot(lags, isicorr, '-b');
|
plot(lags, isicorr, '-b');
|
||||||
hold on;
|
hold on;
|
||||||
scatter(lags, isicorr, 100.0, 'b', 'filled');
|
scatter(lags, isicorr, 10.0, 'b', 'filled');
|
||||||
hold off;
|
hold off;
|
||||||
xlabel('Lag k')
|
xlabel('Lag k')
|
||||||
ylabel('\rho_k')
|
ylabel('\rho_k')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
function plotISIHist(isis, binwidth)
|
function plotisihist(isis, binwidth)
|
||||||
% Plot and annotate histogram of interspike intervals.
|
% Plot and annotate histogram of interspike intervals.
|
||||||
%
|
%
|
||||||
% plotISIHist(isis, binwidth)
|
% plotisihist(isis, binwidth)
|
||||||
%
|
%
|
||||||
% Arguments:
|
% Arguments:
|
||||||
% isis: vector of interspike intervals in seconds
|
% isis: vector of interspike intervals in seconds
|
||||||
@ -9,9 +9,9 @@ function plotISIHist(isis, binwidth)
|
|||||||
|
|
||||||
% compute normalized histogram:
|
% compute normalized histogram:
|
||||||
if nargin < 2
|
if nargin < 2
|
||||||
[pdf, centers] = isiHist(isis);
|
[pdf, centers] = isihist(isis);
|
||||||
else
|
else
|
||||||
[pdf, centers] = isiHist(isis, binwidth);
|
[pdf, centers] = isihist(isis, binwidth);
|
||||||
end
|
end
|
||||||
|
|
||||||
% plot:
|
% plot:
|
||||||
@ -21,14 +21,11 @@ function plotISIHist(isis, binwidth)
|
|||||||
% annotation:
|
% annotation:
|
||||||
misi = mean(isis);
|
misi = mean(isis);
|
||||||
sdisi = std(isis);
|
sdisi = std(isis);
|
||||||
disi = sdisi^2.0/2.0/misi^3;
|
|
||||||
text(0.95, 0.8, sprintf('mean=%.1f ms', 1000.0*misi), ...
|
text(0.95, 0.8, sprintf('mean=%.1f ms', 1000.0*misi), ...
|
||||||
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
||||||
text(0.95, 0.7, sprintf('std=%.1f ms', 1000.0*sdisi), ...
|
text(0.95, 0.7, sprintf('std=%.1f ms', 1000.0*sdisi), ...
|
||||||
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
||||||
text(0.95, 0.6, sprintf('CV=%.2f', sdisi/misi), ...
|
text(0.95, 0.6, sprintf('CV=%.2f', sdisi/misi), ...
|
||||||
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
'Units', 'normalized', 'HorizontalAlignment', 'right')
|
||||||
%text(0.95, 0.5, sprintf('D=%.1f Hz', disi), ...
|
|
||||||
% 'Units', 'normalized', 'HorizontalAlignment', 'right')
|
|
||||||
end
|
end
|
||||||
|
|
@ -1,19 +1,19 @@
|
|||||||
maxisi = 300.0;
|
maxisi = 300.0;
|
||||||
subplot(1, 3, 1);
|
subplot(1, 3, 1);
|
||||||
poissonisis = isis(poissonspikes);
|
poissonisis = isis(poissonspikes);
|
||||||
isihist(poissonisis, 0.001);
|
plotisihist(poissonisis, 0.001);
|
||||||
xlim([0, maxisi])
|
xlim([0, maxisi])
|
||||||
title('Poisson');
|
title('Poisson');
|
||||||
|
|
||||||
subplot(1, 3, 2);
|
subplot(1, 3, 2);
|
||||||
pifouisis = isis(pifouspikes);
|
pifouisis = isis(pifouspikes);
|
||||||
isihist(pifouisis, 0.001);
|
plotisihist(pifouisis, 0.001);
|
||||||
xlim([0, maxisi])
|
xlim([0, maxisi])
|
||||||
title('PIF OU');
|
title('PIF OU');
|
||||||
|
|
||||||
subplot(1, 3, 3);
|
subplot(1, 3, 3);
|
||||||
lifadaptisis = isis(lifadaptspikes);
|
lifadaptisis = isis(lifadaptspikes);
|
||||||
isihist(lifadaptisis, 0.001);
|
plotisihist(lifadaptisis, 0.001);
|
||||||
xlim([0, maxisi])
|
xlim([0, maxisi])
|
||||||
title('LIF adapt');
|
title('LIF adapt');
|
||||||
savefigpdf(gcf, 'isihist.pdf', 20, 7);
|
savefigpdf(gcf, 'isihist.pdf', 20, 7);
|
@ -1,11 +1,6 @@
|
|||||||
\vspace*{-6.5ex}
|
\vspace*{-7.8ex}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\textbf{\Large Einf\"uhrung in die wissenschaftliche Datenverarbeitung}\\[1ex]
|
\textbf{\Large Introduction to Scientific Computing}\\[2.3ex]
|
||||||
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
||||||
Abteilung Neuroethologie \hfill --- \hfill Institut f\"ur Neurobiologie \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
Neuroethology Lab \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
||||||
\end{center}
|
\end{center}
|
||||||
|
|
||||||
\ifprintanswers%
|
|
||||||
\else
|
|
||||||
|
|
||||||
\fi
|
|
||||||
|
198
pointprocesses/exercises/pointprocesses01-de.tex
Normal file
198
pointprocesses/exercises/pointprocesses01-de.tex
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
\documentclass[12pt,a4paper,pdftex]{exam}
|
||||||
|
|
||||||
|
\usepackage[german]{babel}
|
||||||
|
\usepackage{pslatex}
|
||||||
|
\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro
|
||||||
|
\usepackage{xcolor}
|
||||||
|
\usepackage{graphicx}
|
||||||
|
\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref}
|
||||||
|
|
||||||
|
%%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
||||||
|
\pagestyle{headandfoot}
|
||||||
|
\ifprintanswers
|
||||||
|
\newcommand{\stitle}{L\"osungen}
|
||||||
|
\else
|
||||||
|
\newcommand{\stitle}{\"Ubung}
|
||||||
|
\fi
|
||||||
|
\header{{\bfseries\large \stitle}}{{\bfseries\large Punktprozesse}}{{\bfseries\large 27. Oktober, 2015}}
|
||||||
|
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
||||||
|
jan.benda@uni-tuebingen.de}
|
||||||
|
\runningfooter{}{\thepage}{}
|
||||||
|
|
||||||
|
\setlength{\baselineskip}{15pt}
|
||||||
|
\setlength{\parindent}{0.0cm}
|
||||||
|
\setlength{\parskip}{0.3cm}
|
||||||
|
\renewcommand{\baselinestretch}{1.15}
|
||||||
|
|
||||||
|
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\usepackage{listings}
|
||||||
|
\lstset{
|
||||||
|
language=Matlab,
|
||||||
|
basicstyle=\ttfamily\footnotesize,
|
||||||
|
numbers=left,
|
||||||
|
numberstyle=\tiny,
|
||||||
|
title=\lstname,
|
||||||
|
showstringspaces=false,
|
||||||
|
commentstyle=\itshape\color{darkgray},
|
||||||
|
breaklines=true,
|
||||||
|
breakautoindent=true,
|
||||||
|
columns=flexible,
|
||||||
|
frame=single,
|
||||||
|
xleftmargin=1em,
|
||||||
|
xrightmargin=1em,
|
||||||
|
aboveskip=10pt
|
||||||
|
}
|
||||||
|
|
||||||
|
%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\usepackage{amsmath}
|
||||||
|
\usepackage{amssymb}
|
||||||
|
\usepackage{bm}
|
||||||
|
\usepackage{dsfont}
|
||||||
|
\newcommand{\naZ}{\mathds{N}}
|
||||||
|
\newcommand{\gaZ}{\mathds{Z}}
|
||||||
|
\newcommand{\raZ}{\mathds{Q}}
|
||||||
|
\newcommand{\reZ}{\mathds{R}}
|
||||||
|
\newcommand{\reZp}{\mathds{R^+}}
|
||||||
|
\newcommand{\reZpN}{\mathds{R^+_0}}
|
||||||
|
\newcommand{\koZ}{\mathds{C}}
|
||||||
|
|
||||||
|
%%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\newcommand{\continue}{\ifprintanswers%
|
||||||
|
\else
|
||||||
|
\vfill\hspace*{\fill}$\rightarrow$\newpage%
|
||||||
|
\fi}
|
||||||
|
\newcommand{\continuepage}{\ifprintanswers%
|
||||||
|
\newpage
|
||||||
|
\else
|
||||||
|
\vfill\hspace*{\fill}$\rightarrow$\newpage%
|
||||||
|
\fi}
|
||||||
|
\newcommand{\newsolutionpage}{\ifprintanswers%
|
||||||
|
\newpage%
|
||||||
|
\else
|
||||||
|
\fi}
|
||||||
|
|
||||||
|
%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\newcommand{\qt}[1]{\textbf{#1}\\}
|
||||||
|
\newcommand{\pref}[1]{(\ref{#1})}
|
||||||
|
\newcommand{\extra}{--- Zusatzaufgabe ---\ \mbox{}}
|
||||||
|
\newcommand{\code}[1]{\texttt{#1}}
|
||||||
|
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\input{instructions}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{questions}
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
\question \qt{Statistik von Spiketrains}
|
||||||
|
In Ilias findet ihr die Dateien \code{poisson.mat},
|
||||||
|
\code{pifou.mat}, und \code{lifadapt.mat}. Jede dieser Dateien
|
||||||
|
enth\"alt mehrere Trials von Spiketrains von einer bestimmten Art
|
||||||
|
von Neuron. Die Spikezeiten sind in Sekunden gemessen.
|
||||||
|
|
||||||
|
Mit den folgenden Aufgaben wollen wir die Statistik der Spiketrains
|
||||||
|
der drei Neurone miteinander vergleichen.
|
||||||
|
\begin{parts}
|
||||||
|
\part Lade die Spiketrains aus den drei Dateien. Achte darauf,
|
||||||
|
dass sie verschiedene Variablen\-namen bekommen.
|
||||||
|
\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;
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\part Schreibe eine Funktion, die die Spikezeiten der ersten
|
||||||
|
$t_{max}$ Sekunden in einem Rasterplot visualisiert. In jeder
|
||||||
|
Zeile des Rasterplots wird ein Spiketrain dargestellt. Jeder
|
||||||
|
einzelne Spike wird als senkrechte Linie zu der Zeit des
|
||||||
|
Auftretens des Spikes geplottet. Benutze die Funktion, um die
|
||||||
|
Spikeraster der ersten 1\,s der drei Neurone nebeneinander zu plotten.
|
||||||
|
\begin{solution}
|
||||||
|
\lstinputlisting{../code/spikeraster.m}
|
||||||
|
\lstinputlisting{../code/plotspikeraster.m}
|
||||||
|
\mbox{}\\[-3ex]
|
||||||
|
\colorbox{white}{\includegraphics[width=1\textwidth]{spikeraster}}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\part Schreibe eine Funktion, die einen einzigen Vektor mit den
|
||||||
|
Interspikeintervallen aller Trials von Spikezeiten zur\"uckgibt.
|
||||||
|
\begin{solution}
|
||||||
|
\lstinputlisting{../code/isis.m}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\part Schreibe eine Funktion, die ein normiertes Histogramm aus
|
||||||
|
einem Vektor von Interspikeintervallen, gegeben in Sekunden,
|
||||||
|
berechnet und dieses mit richtiger Achsenbeschriftung plottet.
|
||||||
|
Die Interspikeintervalle sollen dabei in Millisekunden angegeben
|
||||||
|
werden. Die Funktion soll zus\"atzlich den Mittelwert, die
|
||||||
|
Standardabweichung, und den Variationskoeffizienten der
|
||||||
|
Interspikeintervalle berechnen und diese im Plot mit angeben.
|
||||||
|
|
||||||
|
Benutze die vorherige und diese Funktion, um die
|
||||||
|
Interspikeintervall Verteilung der drei Neurone zu vergleichen.
|
||||||
|
\begin{solution}
|
||||||
|
\lstinputlisting{../code/isihist.m}
|
||||||
|
\lstinputlisting{../code/plotisih.m}
|
||||||
|
\mbox{}\\[-3ex]
|
||||||
|
\colorbox{white}{\includegraphics[width=1\textwidth]{isihist}}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\part Schreibe eine Funktion, die die seriellen Korrelationen der
|
||||||
|
Interspikeintervalle f\"ur Lags bis zu \code{maxlag} berechnet und
|
||||||
|
plottet. Die Seriellen Korrelationen $\rho_k$ f\"ur Lag $k$ der
|
||||||
|
Interspikeintervalle $T_i$ sind die Korrelationskoeffizienten
|
||||||
|
zwischen den Interspikeintervallen $T_i$ und den um das Lag $k$
|
||||||
|
verschobenen Intervallen $T_{i+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) \]
|
||||||
|
|
||||||
|
Benutze diese Funktion, um die Interspikeintervall-Korrelationen
|
||||||
|
der drei Neurone zu vergleichen.
|
||||||
|
\begin{solution}
|
||||||
|
\lstinputlisting{../code/isiserialcorr.m}
|
||||||
|
\lstinputlisting{../code/plotserialcorr.m}
|
||||||
|
\colorbox{white}{\includegraphics[width=1\textwidth]{serialcorr}}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\part Schreibe eine Funktion, die aus Spikezeiten
|
||||||
|
Histogramme aus der Anzahl von Spikes, die in Fenstern gegebener L\"ange $W$
|
||||||
|
gez\"ahlt werden, erzeugt und plottet.
|
||||||
|
|
||||||
|
Wende diese Funktion auf die drei
|
||||||
|
Datens\"atze an. Probiere verschiedene Fenstergr\"o{\ss}en $W$ aus.
|
||||||
|
\begin{solution}
|
||||||
|
\lstinputlisting{../code/counthist.m}
|
||||||
|
\lstinputlisting{../code/plotcounthist.m}
|
||||||
|
\colorbox{white}{\includegraphics[width=1\textwidth]{counthist}}
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
|
||||||
|
\end{parts}
|
||||||
|
|
||||||
|
\end{questions}
|
||||||
|
|
||||||
|
\end{document}
|
@ -11,11 +11,11 @@
|
|||||||
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
||||||
\pagestyle{headandfoot}
|
\pagestyle{headandfoot}
|
||||||
\ifprintanswers
|
\ifprintanswers
|
||||||
\newcommand{\stitle}{L\"osungen}
|
\newcommand{\stitle}{: Solutions}
|
||||||
\else
|
\else
|
||||||
\newcommand{\stitle}{\"Ubung}
|
\newcommand{\stitle}{}
|
||||||
\fi
|
\fi
|
||||||
\header{{\bfseries\large \stitle}}{{\bfseries\large Punktprozesse}}{{\bfseries\large 27. Oktober, 2015}}
|
\header{{\bfseries\large Exercise 8\stitle}}{{\bfseries\large Point processes}}{{\bfseries\large November 27th, 2017}}
|
||||||
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
||||||
jan.benda@uni-tuebingen.de}
|
jan.benda@uni-tuebingen.de}
|
||||||
\runningfooter{}{\thepage}{}
|
\runningfooter{}{\thepage}{}
|
||||||
@ -89,17 +89,20 @@ jan.benda@uni-tuebingen.de}
|
|||||||
\begin{questions}
|
\begin{questions}
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
\question \qt{Statistik von Spiketrains}
|
\question \qt{Statistics of interspike intervals}
|
||||||
In Ilias findet ihr die Dateien \code{poisson.mat},
|
Download the files \code{poisson.mat},
|
||||||
\code{pifou.mat}, und \code{lifadapt.mat}. Jede dieser Dateien
|
\code{pifou.mat}, and \code{lifadapt.mat} from Ilias.
|
||||||
enth\"alt mehrere Trials von Spiketrains von einer bestimmten Art
|
Each of these files contains several trials of spike trains
|
||||||
von Neuron. Die Spikezeiten sind in Sekunden gemessen.
|
of a specific type of neuron. The spike times are measured in seconds.
|
||||||
|
|
||||||
Mit den folgenden Aufgaben wollen wir die Statistik der Spiketrains
|
We want to compare the statistics of the interspike intervals of the
|
||||||
der drei Neurone miteinander vergleichen.
|
three neurons.
|
||||||
\begin{parts}
|
\begin{parts}
|
||||||
\part Lade die Spiketrains aus den drei Dateien. Achte darauf,
|
\part Load the spike trains from the three files.
|
||||||
dass sie verschiedene Variablen\-namen bekommen.
|
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{solution}
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
clear all
|
clear all
|
||||||
@ -116,19 +119,22 @@ jan.benda@uni-tuebingen.de}
|
|||||||
clear all
|
clear all
|
||||||
x = load('poisson.mat');
|
x = load('poisson.mat');
|
||||||
poissonspikes = x.spikes;
|
poissonspikes = x.spikes;
|
||||||
x = load( pifou.mat' );
|
x = load('pifou.mat');
|
||||||
pifouspikes = x.spikes;
|
pifouspikes = x.spikes;
|
||||||
x = load('lifadapt.mat');
|
x = load('lifadapt.mat');
|
||||||
lifadaptspikes = x.spikes;
|
lifadaptspikes = x.spikes;
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\part Schreibe eine Funktion, die die Spikezeiten der ersten
|
\newsolutionpage
|
||||||
$t_{max}$ Sekunden in einem Rasterplot visualisiert. In jeder
|
\part Write a function that illustrated the spike times of the
|
||||||
Zeile des Rasterplots wird ein Spiketrain dargestellt. Jeder
|
first $t_{max}$ seconds in a raster plot. Each spike train is one
|
||||||
einzelne Spike wird als senkrechte Linie zu der Zeit des
|
row in the raster plot. Each spike is a vertical line at the time
|
||||||
Auftretens des Spikes geplottet. Benutze die Funktion, um die
|
of the spike. When appropriate, the function should use milliseconds
|
||||||
Spikeraster der ersten 1\,s der drei Neurone nebeneinander zu plotten.
|
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}
|
\begin{solution}
|
||||||
\lstinputlisting{../code/spikeraster.m}
|
\lstinputlisting{../code/spikeraster.m}
|
||||||
\lstinputlisting{../code/plotspikeraster.m}
|
\lstinputlisting{../code/plotspikeraster.m}
|
||||||
@ -136,61 +142,55 @@ jan.benda@uni-tuebingen.de}
|
|||||||
\colorbox{white}{\includegraphics[width=1\textwidth]{spikeraster}}
|
\colorbox{white}{\includegraphics[width=1\textwidth]{spikeraster}}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\part Schreibe eine Funktion, die einen einzigen Vektor mit den
|
\part Write a function that returns a single vector containing the
|
||||||
Interspikeintervallen aller Trials von Spikezeiten zur\"uckgibt.
|
interspike intervals of all trials of spike times.
|
||||||
\begin{solution}
|
\begin{solution}
|
||||||
\lstinputlisting{../code/isis.m}
|
\lstinputlisting{../code/isis.m}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\part Schreibe eine Funktion, die ein normiertes Histogramm aus
|
\part Write a function that computes an estimate of the
|
||||||
einem Vektor von Interspikeintervallen, gegeben in Sekunden,
|
probability density of interspike intervals from a vector of
|
||||||
berechnet und dieses mit richtiger Achsenbeschriftung plottet.
|
interspike intervals. The function should automatically choose a
|
||||||
Die Interspikeintervalle sollen dabei in Millisekunden angegeben
|
good bin width for the histogram.
|
||||||
werden. Die Funktion soll zus\"atzlich den Mittelwert, die
|
|
||||||
Standardabweichung, und den Variationskoeffizienten der
|
Write another function that plots the probability density of
|
||||||
Interspikeintervalle berechnen und diese im Plot mit angeben.
|
interspike intervals given a vector of interspike intervals as
|
||||||
|
argument. The function should use the first function for computing
|
||||||
Benutze die vorherige und diese Funktion, um die
|
the probability density. The interspike intervals are given in
|
||||||
Interspikeintervall Verteilung der drei Neurone zu vergleichen.
|
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}
|
\begin{solution}
|
||||||
\lstinputlisting{../code/isihist.m}
|
\lstinputlisting{../code/isihist.m}
|
||||||
\lstinputlisting{../code/plotisih.m}
|
\lstinputlisting{../code/plotisihist.m}
|
||||||
|
\lstinputlisting{../code/plotisihs.m}
|
||||||
\mbox{}\\[-3ex]
|
\mbox{}\\[-3ex]
|
||||||
\colorbox{white}{\includegraphics[width=1\textwidth]{isihist}}
|
\colorbox{white}{\includegraphics[width=1\textwidth]{isihist}}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\part Schreibe eine Funktion, die die seriellen Korrelationen der
|
\part Write a function that computes and plots the serial
|
||||||
Interspikeintervalle f\"ur Lags bis zu \code{maxlag} berechnet und
|
correlations of interspike intervals for lags upto
|
||||||
plottet. Die Seriellen Korrelationen $\rho_k$ f\"ur Lag $k$ der
|
\code{maxlag}. The serial correlations $\rho_k$ for lag $k$ of the
|
||||||
Interspikeintervalle $T_i$ sind die Korrelationskoeffizienten
|
interspike intervals $T_i$ are the correlation coefficients
|
||||||
zwischen den Interspikeintervallen $T_i$ und den um das Lag $k$
|
between interspike intervals $T_i$ and the intervals $T_{i+k}$
|
||||||
verschobenen Intervallen $T_{i+k}$:
|
that are shifted by lag $k$:
|
||||||
\[ \rho_k = \frac{\langle (T_{i+k} - \langle T \rangle)(T_i -
|
\[ \rho_k = \frac{\langle (T_{i+k} - \langle T \rangle)(T_i -
|
||||||
\langle T \rangle) \rangle}{\langle (T_i - \langle T
|
\langle T \rangle) \rangle}{\langle (T_i - \langle T
|
||||||
\rangle)^2\rangle} = \frac{{\rm cov}(T_{i+k}, T_i)}{{\rm
|
\rangle)^2\rangle} = \frac{{\rm cov}(T_{i+k}, T_i)}{{\rm
|
||||||
var}(T_i)} = {\rm corr}(T_{i+k}, T_i) \]
|
var}(T_i)} = {\rm corr}(T_{i+k}, T_i) \]
|
||||||
|
|
||||||
Benutze diese Funktion, um die Interspikeintervall-Korrelationen
|
Use this function to compare the serial correlations of the
|
||||||
der drei Neurone zu vergleichen.
|
interspike intervals of the three neurons.
|
||||||
\begin{solution}
|
\begin{solution}
|
||||||
\lstinputlisting{../code/isiserialcorr.m}
|
\lstinputlisting{../code/isiserialcorr.m}
|
||||||
\lstinputlisting{../code/plotserialcorr.m}
|
\lstinputlisting{../code/plotserialcorr.m}
|
||||||
\colorbox{white}{\includegraphics[width=1\textwidth]{serialcorr}}
|
\colorbox{white}{\includegraphics[width=1\textwidth]{serialcorr}}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\part Schreibe eine Funktion, die aus Spikezeiten
|
|
||||||
Histogramme aus der Anzahl von Spikes, die in Fenstern gegebener L\"ange $W$
|
|
||||||
gez\"ahlt werden, erzeugt und plottet.
|
|
||||||
|
|
||||||
Wende diese Funktion auf die drei
|
|
||||||
Datens\"atze an. Probiere verschiedene Fenstergr\"o{\ss}en $W$ aus.
|
|
||||||
\begin{solution}
|
|
||||||
\lstinputlisting{../code/counthist.m}
|
|
||||||
\lstinputlisting{../code/plotcounthist.m}
|
|
||||||
\colorbox{white}{\includegraphics[width=1\textwidth]{counthist}}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
|
|
||||||
\end{parts}
|
\end{parts}
|
||||||
|
|
||||||
\end{questions}
|
\end{questions}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%!PS-Adobe-2.0 EPSF-2.0
|
%!PS-Adobe-2.0 EPSF-2.0
|
||||||
%%Title: pointprocessscetchA.tex
|
%%Title: pointprocessscetchA.tex
|
||||||
%%Creator: gnuplot 4.6 patchlevel 4
|
%%Creator: gnuplot 4.6 patchlevel 4
|
||||||
%%CreationDate: Sat Nov 25 18:46:51 2017
|
%%CreationDate: Mon Nov 27 21:08:10 2017
|
||||||
%%DocumentFonts:
|
%%DocumentFonts:
|
||||||
%%BoundingBox: 50 50 373 135
|
%%BoundingBox: 50 50 373 135
|
||||||
%%EndComments
|
%%EndComments
|
||||||
@ -433,7 +433,7 @@ SDict begin [
|
|||||||
/Author (jan)
|
/Author (jan)
|
||||||
% /Producer (gnuplot)
|
% /Producer (gnuplot)
|
||||||
% /Keywords ()
|
% /Keywords ()
|
||||||
/CreationDate (Sat Nov 25 18:46:51 2017)
|
/CreationDate (Mon Nov 27 21:08:10 2017)
|
||||||
/DOCINFO pdfmark
|
/DOCINFO pdfmark
|
||||||
end
|
end
|
||||||
} ifelse
|
} ifelse
|
||||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
%!PS-Adobe-2.0 EPSF-2.0
|
%!PS-Adobe-2.0 EPSF-2.0
|
||||||
%%Title: pointprocessscetchB.tex
|
%%Title: pointprocessscetchB.tex
|
||||||
%%Creator: gnuplot 4.6 patchlevel 4
|
%%Creator: gnuplot 4.6 patchlevel 4
|
||||||
%%CreationDate: Sat Nov 25 18:46:51 2017
|
%%CreationDate: Mon Nov 27 21:08:10 2017
|
||||||
%%DocumentFonts:
|
%%DocumentFonts:
|
||||||
%%BoundingBox: 50 50 373 237
|
%%BoundingBox: 50 50 373 237
|
||||||
%%EndComments
|
%%EndComments
|
||||||
@ -433,7 +433,7 @@ SDict begin [
|
|||||||
/Author (jan)
|
/Author (jan)
|
||||||
% /Producer (gnuplot)
|
% /Producer (gnuplot)
|
||||||
% /Keywords ()
|
% /Keywords ()
|
||||||
/CreationDate (Sat Nov 25 18:46:51 2017)
|
/CreationDate (Mon Nov 27 21:08:10 2017)
|
||||||
/DOCINFO pdfmark
|
/DOCINFO pdfmark
|
||||||
end
|
end
|
||||||
} ifelse
|
} ifelse
|
||||||
|
Binary file not shown.
@ -11,11 +11,11 @@
|
|||||||
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
|
||||||
\pagestyle{headandfoot}
|
\pagestyle{headandfoot}
|
||||||
\ifprintanswers
|
\ifprintanswers
|
||||||
\newcommand{\stitle}{: L\"osungen}
|
\newcommand{\stitle}{: Solutions}
|
||||||
\else
|
\else
|
||||||
\newcommand{\stitle}{}
|
\newcommand{\stitle}{}
|
||||||
\fi
|
\fi
|
||||||
\header{{\bfseries\large Exercise 7\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large 21. November, 2017}}
|
\header{{\bfseries\large Exercise 7\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large November 21st, 2017}}
|
||||||
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
||||||
jan.benda@uni-tuebingen.de}
|
jan.benda@uni-tuebingen.de}
|
||||||
\runningfooter{}{\thepage}{}
|
\runningfooter{}{\thepage}{}
|
||||||
@ -78,8 +78,6 @@ jan.benda@uni-tuebingen.de}
|
|||||||
\newcommand{\extra}{--- bonus question ---\ \mbox{}}
|
\newcommand{\extra}{--- bonus question ---\ \mbox{}}
|
||||||
\newcommand{\code}[1]{\texttt{#1}}
|
\newcommand{\code}[1]{\texttt{#1}}
|
||||||
|
|
||||||
\graphicspath{{../../pointprocesses/exercises/}}
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
\begin{document}
|
\begin{document}
|
||||||
@ -182,81 +180,6 @@ With the following questions we want to illustrate the central limit theorem.
|
|||||||
\includegraphics[width=0.5\textwidth]{centrallimit-samples}
|
\includegraphics[width=0.5\textwidth]{centrallimit-samples}
|
||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
||||||
\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 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;
|
|
||||||
\end{lstlisting}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\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. Use this function to plot the first second of the
|
|
||||||
spike rasters of the three neurons.
|
|
||||||
\begin{solution}
|
|
||||||
\lstinputlisting{../../pointprocesses/code/spikeraster.m}
|
|
||||||
\lstinputlisting{../../pointprocesses/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 aall trials of spike times.
|
|
||||||
\begin{solution}
|
|
||||||
\lstinputlisting{../../pointprocesses/code/isis.m}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\part Write a function that computes and plots an estimate of the
|
|
||||||
probability density of interspike intervals from a vector of
|
|
||||||
interspike intervals. 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{../../pointprocesses/code/isihist.m}
|
|
||||||
\lstinputlisting{../../pointprocesses/code/plotisih.m}
|
|
||||||
\mbox{}\\[-3ex]
|
|
||||||
\colorbox{white}{\includegraphics[width=1\textwidth]{isihist}}
|
|
||||||
\end{solution}
|
|
||||||
\end{parts}
|
|
||||||
|
|
||||||
\end{questions}
|
\end{questions}
|
||||||
|
|
||||||
\end{document}
|
\end{document}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
\vspace*{-6.5ex}
|
\vspace*{-7.8ex}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
\textbf{\Large Introduction to scientific computing}\\[1ex]
|
\textbf{\Large Introduction to Scientific Computing}\\[2.3ex]
|
||||||
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
{\large Jan Grewe, Jan Benda}\\[-3ex]
|
||||||
Neuroethology lab \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
Neuroethology Lab \hfill --- \hfill Institute for Neurobiology \hfill --- \hfill \includegraphics[width=0.28\textwidth]{UT_WBMW_Black_RGB} \\
|
||||||
\end{center}
|
\end{center}
|
||||||
|
Reference in New Issue
Block a user