Worked on pointprocess exercises

This commit is contained in:
Jan Benda 2015-10-27 17:26:57 +01:00
parent 8fb45e4164
commit 0be73cce5c
2 changed files with 40 additions and 40 deletions

View File

@ -103,6 +103,7 @@ jan.benda@uni-tuebingen.de}
\begin{solution} \begin{solution}
\begin{lstlisting} \begin{lstlisting}
clear all clear all
% not so good:
load poisson.mat load poisson.mat
whos whos
poissonspikes = spikes; poissonspikes = spikes;
@ -111,6 +112,14 @@ jan.benda@uni-tuebingen.de}
load lifadapt.mat; load lifadapt.mat;
lifadaptspikes = spikes; lifadaptspikes = spikes;
clear 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{lstlisting}
\end{solution} \end{solution}

View File

@ -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}{L\"osungen}
\else \else
\newcommand{\stitle}{} \newcommand{\stitle}{\"Ubung}
\fi \fi
\header{{\bfseries\large \"Ubung 6\stitle}}{{\bfseries\large Statistik}}{{\bfseries\large 27. Oktober, 2015}} \header{{\bfseries\large \stitle}}{{\bfseries\large Punktprozesse 2}}{{\bfseries\large 27. Oktober, 2015}}
\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,26 +89,27 @@ jan.benda@uni-tuebingen.de}
\begin{questions} \begin{questions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\question \qt{Homogeneous Poisson process} \question \qt{Homogener Poisson Prozess}
We use the Poisson process to generate spike trains on which we can test and imrpove some Wir wollen den homogenen Poisson Prozess benutzen um Spikes zu generieren,
standard analysis functions. mit denen wir die Analysfunktionen des vorherigen \"Ubungszettel \"uberpr\"ufen k\"onnen.
A homogeneous Poisson process of rate $\lambda$ (measured in Hertz) is a point process Ein homogener Poisson Prozess mit der Rate $\lambda$ (measured in Hertz) ist ein Punktprozess,
where the probability of an event is independent of time $t$ and independent of previous events. bei dem die Wahrschienlichkeit eines Ereignisses unabh\"angig von der Zeit $t$ und
The probability $P$ of an event within a bin of width $\Delta t$ is unabh\"angig von vorherigen Ereignissen ist.
Die Wahrscheinlichkeit $P$ eines Ereignisses innerhalb eines Bins der Breite $\Delta t$ ist
\[ P = \lambda \cdot \Delta t \] \[ P = \lambda \cdot \Delta t \]
for sufficiently small $\Delta t$. f\"ur gen\"ugend kleine $\Delta t$.
\begin{parts} \begin{parts}
\part Write a function that generates $n$ homogeneous Poisson spike trains of a given duration $T_{max}$ \part Schreibe eine Funktion die $n$ homogene Poisson Spiketrains
with rate $\lambda$. einer gegebenen Dauer $T_{max}$ mit rate $\lambda$ erzeugt.
\begin{solution} \begin{solution}
\lstinputlisting{hompoissonspikes.m} \lstinputlisting{hompoissonspikes.m}
\end{solution} \end{solution}
\part Using this function, generate a few trials and display them in a raster plot. \part Benutze diese Funktion um einige Trials von Spikes zu erzeugen
und plotte diese als Spikeraster.
\begin{solution} \begin{solution}
\lstinputlisting{../code/spikeraster.m}
\begin{lstlisting} \begin{lstlisting}
spikes = hompoissonspikes( 10, 100.0, 0.5 ); spikes = hompoissonspikes( 10, 100.0, 0.5 );
spikeraster( spikes ) spikeraster( spikes )
@ -117,41 +118,31 @@ for sufficiently small $\Delta t$.
\colorbox{white}{\includegraphics[width=0.7\textwidth]{poissonraster100hz}} \colorbox{white}{\includegraphics[width=0.7\textwidth]{poissonraster100hz}}
\end{solution} \end{solution}
\part Write a function that extracts a single vector of interspike intervals \part Berechne Histogramme aus den Interspikeintervallen von $n$
from the spike times returned by the first function. Poisson Spiketrains mit der Rate $\lambda=100$\,Hz. Ver\"andere
\begin{solution} \"uber die Dauer $T_{max}$ der Spiketrains und die Anzahl $n$ der
\lstinputlisting{../code/isis.m} Trials die Anzahl der Intervalle und ver\"andere auch die Binbreite
\end{solution} des Histograms (fange mit 1\,ms an). Wieviele Interspikeintervalle
werden ben\"otigt um ein ``sch\"ones'' Histogramm zu erhalten? Wie
\part Write a function that plots the interspike-interval histogram lange m\"usste man also von dem Neuron ableiten?
from a vector of interspike intervals. The function should also
compute the mean, the standard deviation, and the CV of the intervals
and display the values in the plot.
\begin{solution}
\lstinputlisting{../code/isihist.m}
\end{solution}
\part Compute histograms for Poisson spike trains with rate
$\lambda=100$\,Hz. Play around with $T_{max}$ and $n$ and the bin width
(start with 1\,ms) of the histogram.
How many
interspike intervals do you approximately need to get a ``nice''
histogram? How long do you need to record from the neuron?
\begin{solution} \begin{solution}
About 5000 intervals for 25 bins. This corresponds to a $5000 / 100\,\hertz = 50\,\second$ recording About 5000 intervals for 25 bins. This corresponds to a $5000 /
of a neuron firing with 100\,\hertz. 100\,\hertz = 50\,\second$ recording of a neuron firing with
100\,\hertz.
\end{solution} \end{solution}
\part Compare the histogram with the true distribution of intervals $T$ of the Poisson process \part Vergleiche das Histogramm mit der zu erwartenden Verteilung
der Intervalle $T$ des Poisson Prozesses
\[ p(T) = \lambda e^{-\lambda T} \] \[ p(T) = \lambda e^{-\lambda T} \]
for various rates $\lambda$. mit rate $\lambda$.
\begin{solution} \begin{solution}
\lstinputlisting{hompoissonisih.m} \lstinputlisting{hompoissonisih.m}
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih100hz}} \colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih100hz}}
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih20hz}} \colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih20hz}}
\end{solution} \end{solution}
\part What happens if you make the bin width of the histogram smaller than $\Delta t$ \part \extra Was pasiert mit den Histogrammen, wenn die Binbreite der Histogramme kleiner
als das bei der Erzeugung der $\Delta t$ der
used for generating the Poisson spikes? used for generating the Poisson spikes?
\begin{solution} \begin{solution}
The bins between the discretization have zero entries. Therefore The bins between the discretization have zero entries. Therefore