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

View File

@ -11,11 +11,11 @@
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
\pagestyle{headandfoot}
\ifprintanswers
\newcommand{\stitle}{: L\"osungen}
\newcommand{\stitle}{L\"osungen}
\else
\newcommand{\stitle}{}
\newcommand{\stitle}{\"Ubung}
\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:
jan.benda@uni-tuebingen.de}
\runningfooter{}{\thepage}{}
@ -89,26 +89,27 @@ jan.benda@uni-tuebingen.de}
\begin{questions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\question \qt{Homogeneous Poisson process}
We use the Poisson process to generate spike trains on which we can test and imrpove some
standard analysis functions.
A homogeneous Poisson process of rate $\lambda$ (measured in Hertz) is a point process
where the probability of an event is independent of time $t$ and independent of previous events.
The probability $P$ of an event within a bin of width $\Delta t$ is
\question \qt{Homogener Poisson Prozess}
Wir wollen den homogenen Poisson Prozess benutzen um Spikes zu generieren,
mit denen wir die Analysfunktionen des vorherigen \"Ubungszettel \"uberpr\"ufen k\"onnen.
Ein homogener Poisson Prozess mit der Rate $\lambda$ (measured in Hertz) ist ein Punktprozess,
bei dem die Wahrschienlichkeit eines Ereignisses unabh\"angig von der Zeit $t$ und
unabh\"angig von vorherigen Ereignissen ist.
Die Wahrscheinlichkeit $P$ eines Ereignisses innerhalb eines Bins der Breite $\Delta t$ ist
\[ P = \lambda \cdot \Delta t \]
for sufficiently small $\Delta t$.
f\"ur gen\"ugend kleine $\Delta t$.
\begin{parts}
\part Write a function that generates $n$ homogeneous Poisson spike trains of a given duration $T_{max}$
with rate $\lambda$.
\part Schreibe eine Funktion die $n$ homogene Poisson Spiketrains
einer gegebenen Dauer $T_{max}$ mit rate $\lambda$ erzeugt.
\begin{solution}
\lstinputlisting{hompoissonspikes.m}
\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}
\lstinputlisting{../code/spikeraster.m}
\begin{lstlisting}
spikes = hompoissonspikes( 10, 100.0, 0.5 );
spikeraster( spikes )
@ -117,41 +118,31 @@ for sufficiently small $\Delta t$.
\colorbox{white}{\includegraphics[width=0.7\textwidth]{poissonraster100hz}}
\end{solution}
\part Write a function that extracts a single vector of interspike intervals
from the spike times returned by the first function.
\begin{solution}
\lstinputlisting{../code/isis.m}
\end{solution}
\part Write a function that plots the interspike-interval histogram
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?
\part Berechne Histogramme aus den Interspikeintervallen von $n$
Poisson Spiketrains mit der Rate $\lambda=100$\,Hz. Ver\"andere
\"uber die Dauer $T_{max}$ der Spiketrains und die Anzahl $n$ der
Trials die Anzahl der Intervalle und ver\"andere auch die Binbreite
des Histograms (fange mit 1\,ms an). Wieviele Interspikeintervalle
werden ben\"otigt um ein ``sch\"ones'' Histogramm zu erhalten? Wie
lange m\"usste man also von dem Neuron ableiten?
\begin{solution}
About 5000 intervals for 25 bins. This corresponds to a $5000 / 100\,\hertz = 50\,\second$ recording
of a neuron firing with 100\,\hertz.
About 5000 intervals for 25 bins. This corresponds to a $5000 /
100\,\hertz = 50\,\second$ recording of a neuron firing with
100\,\hertz.
\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} \]
for various rates $\lambda$.
mit rate $\lambda$.
\begin{solution}
\lstinputlisting{hompoissonisih.m}
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih100hz}}
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih20hz}}
\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?
\begin{solution}
The bins between the discretization have zero entries. Therefore