New design pattern chapter.
Next exercises for point processes.
This commit is contained in:
@@ -14,6 +14,6 @@ function spikes = hompoissonspikes( trials, rate, tmax )
|
||||
x = rand( trials, ceil(tmax/dt) );
|
||||
spikes = cell( trials, 1 );
|
||||
for k=1:trials
|
||||
spikes{k} = find( x(k,:) >= 1.0-p ) * dt;
|
||||
spikes{k} = find( x(k,:) < p ) * dt;
|
||||
end
|
||||
end
|
||||
|
||||
@@ -93,7 +93,7 @@ jan.benda@uni-tuebingen.de}
|
||||
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,
|
||||
Ein homogener Poisson Prozess mit der Rate $\lambda$ (gemessen 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
|
||||
@@ -102,7 +102,7 @@ f\"ur gen\"ugend kleine $\Delta t$.
|
||||
\begin{parts}
|
||||
|
||||
\part Schreibe eine Funktion die $n$ homogene Poisson Spiketrains
|
||||
einer gegebenen Dauer $T_{max}$ mit rate $\lambda$ erzeugt.
|
||||
einer gegebenen Dauer $T_{max}$ mit Rate $\lambda$ erzeugt.
|
||||
\begin{solution}
|
||||
\lstinputlisting{hompoissonspikes.m}
|
||||
\end{solution}
|
||||
@@ -122,8 +122,8 @@ f\"ur gen\"ugend kleine $\Delta t$.
|
||||
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
|
||||
des Histograms (fang 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 /
|
||||
@@ -131,56 +131,62 @@ f\"ur gen\"ugend kleine $\Delta t$.
|
||||
100\,\hertz.
|
||||
\end{solution}
|
||||
|
||||
\part Vergleiche das Histogramm mit der zu erwartenden Verteilung
|
||||
\part Vergleiche Interspike-Intervall Histogramme von Poisson-Spikes
|
||||
verschiedener Raten $\lambda$ mit der theoretisch zu erwartenden Verteilung
|
||||
der Intervalle $T$ des Poisson Prozesses
|
||||
\[ p(T) = \lambda e^{-\lambda T} \]
|
||||
mit rate $\lambda$.
|
||||
\[ p(T) = \lambda e^{-\lambda T} \; .\]
|
||||
\begin{solution}
|
||||
\lstinputlisting{hompoissonisih.m}
|
||||
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih100hz}}
|
||||
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissonisih20hz}}
|
||||
\end{solution}
|
||||
|
||||
\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?
|
||||
\part \extra Was pasiert mit den Histogrammen, wenn die Binbreite
|
||||
der Histogramme kleiner als das bei der Erzeugung der Poisson
|
||||
Spiketrains verwendete $\Delta t$ ist?
|
||||
\begin{solution}
|
||||
The bins between the discretization have zero entries. Therefore
|
||||
the other ones become higher than they should be.
|
||||
Die Bins zwischen der durch $\Delta t$ vorgegebenen
|
||||
Diskretisierung haben den Wert 0. Dadurch werden aber die anderen
|
||||
durch die Normierung h\"oher als sie sein sollten.
|
||||
\end{solution}
|
||||
|
||||
\part Plot the mean interspike interval, the corresponding standard deviation, and the CV
|
||||
as a function of the rate $\lambda$ of the Poisson process.
|
||||
Compare the ../code with the theoretical expectations for the dependence on $\lambda$.
|
||||
\part Plotte den Mittelwert der Interspikeintervalle, die
|
||||
dazugeh\"orige Standardabweichung und den Variationskoeffizienten
|
||||
als Funktion der Rate $\lambda$ des Poisson Prozesses. Vergleiche
|
||||
die Ergebnisse mit den theoretischen Erwartungen (siehe Vorlesungsskript).
|
||||
\begin{solution}
|
||||
\lstinputlisting{hompoissonisistats.m}
|
||||
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonisistats}}
|
||||
\end{solution}
|
||||
|
||||
\part Write a function that computes serial correlations for the interspike intervals
|
||||
for a range of lags.
|
||||
The serial correlations $\rho_k$ at lag $k$ are defined as
|
||||
\[ \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)} \]
|
||||
Use this function to show that interspike intervals of Poisson spikes are independent.
|
||||
\part Plotte die seriellen Korrelationen von Poisson-Spiketrains und
|
||||
erkl\"are kurz das Ergebniss.
|
||||
\begin{solution}
|
||||
\lstinputlisting{../code/isiserialcorr.m}
|
||||
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonserial100hz}}
|
||||
\mbox{}\\[-2ex]\hspace*{2cm}
|
||||
\colorbox{white}{\includegraphics[width=0.8\textwidth]{poissonserial100hz}}\\
|
||||
Alle Korrelationen zwischen Interspikeintervallen sind Null, da
|
||||
beim Poisson Prozess das Auftreten jedes Spikes unabh\"angig von
|
||||
den vorherigen Spikes ist.
|
||||
\end{solution}
|
||||
|
||||
\part Write a function that generates from spike times
|
||||
a histogram of spike counts in a count window of given duration $W$.
|
||||
The function should also plot the Poisson distribution
|
||||
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]
|
||||
for the rate $\lambda$ determined from the spike trains.
|
||||
\part Vergleiche Histogramme von Spikecounts gez\"ahlt in Fenstern
|
||||
der Breite $W$ mit der Poisson Verteilung
|
||||
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \; , \]
|
||||
wobei die Rate $\lambda$ aus den Daten bestimmt werden
|
||||
soll. Hinweis: es gibt eine \code{matlab} Funktion, die die
|
||||
Fakult\"at $n!$ berechnet.
|
||||
\begin{solution}
|
||||
\lstinputlisting{../code/counthist.m}
|
||||
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}}
|
||||
\colorbox{white}{\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms}}
|
||||
\end{solution}
|
||||
|
||||
\part Write a function that computes mean count, variance of count and the corresponding Fano factor
|
||||
for a range of count window durations. The function should generate tow plots: one plotting
|
||||
the count variance against the mean, the other one the Fano factor as a function of the window duration.
|
||||
\part Schreibe eine Funktion, die die mittlere Anzahl, die Varianz
|
||||
und den Fano-Faktor der Anzahl der Spikes in einem Fenster der
|
||||
Breite $W$ bestimmt. Benutze die Funktion, um diese Parameter f\"ur
|
||||
verschiedene Fensterbreiten $W$ zu bestimmen. Zwei Plots sollen aus
|
||||
den Ergebnissen angefertigt werden: (i) Varianz gegen Mittelwert der counts.
|
||||
(ii) Fano Faktor als Funktion der Fensterbreite.
|
||||
\begin{solution}
|
||||
\lstinputlisting{../code/fano.m}
|
||||
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonfano100hz}}
|
||||
@@ -191,11 +197,3 @@ f\"ur gen\"ugend kleine $\Delta t$.
|
||||
\end{questions}
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
Zus\"atzlich soll die Funktion
|
||||
die Poisson-Verteilung
|
||||
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \] mit der Rate
|
||||
$\lambda$, die aus den Daten bestimmt werden kann, mit zu dem
|
||||
Histogramm hineinzeichen. Hinweis: es gibt eine \code{matlab} Funktion,
|
||||
die die Fakult\"at $n!$ berechnet.
|
||||
@@ -224,48 +224,3 @@
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\section{\tr{Homogeneous Poisson process}{Homogener Poisson Prozess}}
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=1\textwidth]{poissonraster100hz}
|
||||
\caption{\label{hompoissonfig}Rasterplot von Poisson-Spikes.}
|
||||
\end{figure}
|
||||
|
||||
The probability $p(t)\delta t$ of an event occuring at time $t$
|
||||
is independent of $t$ and independent of any previous event
|
||||
(independent of event history).
|
||||
|
||||
The probability $P$ for an event occuring within a time bin of width $\Delta t$
|
||||
is
|
||||
\[ P=\lambda \cdot \Delta t \]
|
||||
for a Poisson process with rate $\lambda$.
|
||||
|
||||
\subsection{Statistics of homogeneous Poisson process}
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=0.45\textwidth]{poissonisihexp20hz}\hfill
|
||||
\includegraphics[width=0.45\textwidth]{poissonisihexp100hz}
|
||||
\caption{\label{hompoissonisihfig}Interspike interval histograms of poisson spike train.}
|
||||
\end{figure}
|
||||
|
||||
\begin{itemize}
|
||||
\item Exponential distribution of intervals $T$: $p(T) = \lambda e^{-\lambda T}$
|
||||
\item Mean interval $\mu_{ISI} = \frac{1}{\lambda}$
|
||||
\item Variance of intervals $\sigma_{ISI}^2 = \frac{1}{\lambda^2}$
|
||||
\item Coefficient of variation $CV_{ISI} = 1$
|
||||
\item Serial correlation $\rho_k =0$ for $k>0$ (renewal process!)
|
||||
\item Fano factor $F=1$
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Count statistics of Poisson process}
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}\hfill
|
||||
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms}
|
||||
\caption{\label{hompoissoncountfig}Count statistics of poisson spike train.}
|
||||
\end{figure}
|
||||
|
||||
Poisson distribution:
|
||||
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]
|
||||
@@ -113,3 +113,52 @@ Insbesondere ist die mittlere Rate der Ereignisse $r$ (``Spikes pro Zeit'', Feue
|
||||
% \end{figure}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\section{Homogener Poisson Prozess}
|
||||
F\"ur kontinuierliche Me{\ss}gr\"o{\ss}en ist die Normalverteilung
|
||||
u.a. wegem dem Zentralen Grenzwertsatz die Standardverteilung. Eine
|
||||
\"ahnliche Rolle spilet bei Punktprozessen der ``Poisson Prozess''.
|
||||
|
||||
Beim homogenen Poisson Prozess treten Ereignisse mit einer festen Rate
|
||||
$\lambda=\text{const.}$ auf und sind unabh\"angig von der Zeit $t$ und
|
||||
unabh\"angig von den Zeitpunkten fr\"uherer Ereignisse. Die
|
||||
Wahrscheinlichkeit zu irgendeiner Zeit ein Ereigniss in einem kleinen
|
||||
Zeitfenster der Breite $\Delta t$ zu bekommen ist
|
||||
\[ P = \lambda \cdot \Delta t \; . \]
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=1\textwidth]{poissonraster100hz}
|
||||
\caption{\label{hompoissonfig}Rasterplot von Spikes eine homogenen
|
||||
Poisson Prozesse mit $\lambda=100$\,Hz.}
|
||||
\end{figure}
|
||||
|
||||
Beim inhomogenen Poisson Prozess h\"angt die Rate $\lambda$ von der
|
||||
Zeit ab: $\lambda = \lambda(t)$.
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=0.45\textwidth]{poissonisihexp20hz}\hfill
|
||||
\includegraphics[width=0.45\textwidth]{poissonisihexp100hz}
|
||||
\caption{\label{hompoissonisihfig}Interspikeintervallverteilungen
|
||||
zweier Poissonprozesse.}
|
||||
\end{figure}
|
||||
|
||||
Der homogne Poissonprozess hat folgende Eigenschaften:
|
||||
\begin{itemize}
|
||||
\item Die Intervalle $T$ sind exponentiell verteilt: $p(T) = \lambda e^{-\lambda T}$ .
|
||||
\item Das mittlere Intervall ist $\mu_{ISI} = \frac{1}{\lambda}$ .
|
||||
\item Die Varianz der Intervalle ist $\sigma_{ISI}^2 = \frac{1}{\lambda^2}$ .
|
||||
\item Der Variationskoeffizient ist also immer $CV_{ISI} = 1$ .
|
||||
\item Die seriellen Korrelationen $\rho_k =0$ for $k>0$, da das
|
||||
Auftreten der Ereignisse unabh\"angig von der Vorgeschichte ist. Ein
|
||||
solcher Prozess wird auch Erneuerungsprozess genannt (``renewal
|
||||
process'').
|
||||
\item Die Anzahl der Ereignisse $k$ innerhalb eines Fensters der L\"ange W ist Poissonverteilt:
|
||||
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]
|
||||
\item Der Fano Faktor ist immer $F=1$ .
|
||||
\end{itemize}
|
||||
|
||||
\begin{figure}[t]
|
||||
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}\hfill
|
||||
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms}
|
||||
\caption{\label{hompoissoncountfig}Z\"ahlstatistik von Poisson Spikes.}
|
||||
\end{figure}
|
||||
|
||||
Reference in New Issue
Block a user