Started working on pointprocesses

This commit is contained in:
Jan Benda 2015-10-25 22:22:54 +01:00
parent d9252e9cbf
commit 857373c125
24 changed files with 896 additions and 692 deletions

View File

@ -1,22 +1,29 @@
BASENAME=bootstrap BASENAME=bootstrap
PYFILES=$(wildcard *.py) PYFILES=$(wildcard *.py)
PYPDFFILES=$(PYFILES:.py=.pdf) PYPDFFILES=$(PYFILES:.py=.pdf)
pdf : $(BASENAME)-chapter.pdf $(PYPDFFILES) all : pdf
# script:
pdf : $(BASENAME)-chapter.pdf
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
$(PYPDFFILES) : %.pdf : %.py $(PYPDFFILES) : %.pdf : %.py
python $< python $<
clean : clean :
rm -f *~ $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out $(BASENAME).aux $(BASENAME).log rm -f *~
rm -f $(BASENAME).aux $(BASENAME).log
rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
rm -f $(PYPDFFILES) $(GPTTEXFILES)
cleanall : clean cleanall : clean
rm -f $(BASENAME)-chapter.pdf rm -f $(BASENAME)-chapter.pdf
watch : watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done while true; do ! make -q pdf && make pdf; sleep 0.5; done

View File

@ -1,22 +1,29 @@
BASENAME=likelihood BASENAME=likelihood
PYFILES=$(wildcard *.py) PYFILES=$(wildcard *.py)
PYPDFFILES=$(PYFILES:.py=.pdf) PYPDFFILES=$(PYFILES:.py=.pdf)
pdf : $(BASENAME)-chapter.pdf $(PYPDFFILES) all : pdf
# script:
pdf : $(BASENAME)-chapter.pdf
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
$(PYPDFFILES) : %.pdf : %.py $(PYPDFFILES) : %.pdf : %.py
python $< python $<
clean : clean :
rm -f *~ $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out $(BASENAME).aux $(BASENAME).log rm -f *~
rm -f $(BASENAME).aux $(BASENAME).log
rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
rm -f $(PYPDFFILES) $(GPTTEXFILES)
cleanall : clean cleanall : clean
rm -f $(BASENAME)-chapter.pdf rm -f $(BASENAME)-chapter.pdf
watch : watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done while true; do ! make -q pdf && make pdf; sleep 0.5; done

View File

@ -0,0 +1,35 @@
BASENAME=pointprocesses
TEXFILES=$(wildcard $(BASENAME)??.tex)
EXERCISES=$(TEXFILES:.tex=.pdf)
SOLUTIONS=$(EXERCISES:pointprocesses%=pointprocesses-solutions%)
.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean
pdf : $(SOLUTIONS) $(EXERCISES)
exercises : $(EXERCISES)
solutions : $(SOLUTIONS)
$(SOLUTIONS) : pointprocesses-solutions%.pdf : pointprocesses%.tex instructions.tex
{ echo "\\documentclass[answers,12pt,a4paper,pdftex]{exam}"; sed -e '1d' $<; } > $(patsubst %.pdf,%.tex,$@)
pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) || true
rm $(patsubst %.pdf,%,$@).[!p]*
$(EXERCISES) : %.pdf : %.tex instructions.tex
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
watch :
while true; do ! make -q pdf && make pdf; sleep 0.5; done
watchexercises :
while true; do ! make -q exercises && make exercises; sleep 0.5; done
watchsolutions :
while true; do ! make -q solutions && make solutions; sleep 0.5; done
clean :
rm -f *~ *.aux *.log *.out
cleanup : clean
rm -f $(SOLUTIONS) $(EXERCISES)

View File

@ -0,0 +1,11 @@
\vspace*{-6.5ex}
\begin{center}
\textbf{\Large Einf\"uhrung in die wissenschaftliche Datenverarbeitung}\\[1ex]
{\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} \\
\end{center}
\ifprintanswers%
\else
\fi

View File

@ -0,0 +1,202 @@
\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}{}
\fi
\header{{\bfseries\large \"Ubung 6\stitle}}{{\bfseries\large Statistik}}{{\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{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
\[ P = \lambda \cdot \Delta t \]
for sufficiently small $\Delta t$.
\begin{parts}
\part Write a function that generates $n$ homogeneous Poisson spike trains of a given duration $T_{max}$
with rate $\lambda$.
\begin{solution}
\lstinputlisting{hompoissonspikes.m}
\end{solution}
\part Using this function, generate a few trials and display them in a raster plot.
\begin{solution}
\lstinputlisting{../code/spikeraster.m}
\begin{lstlisting}
spikes = hompoissonspikes( 10, 100.0, 0.5 );
spikeraster( spikes )
\end{lstlisting}
\mbox{}\\[-3ex]
\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?
\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.
\end{solution}
\part Compare the histogram with the true distribution of intervals $T$ of the Poisson process
\[ p(T) = \lambda e^{-\lambda T} \]
for various rates $\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$
used for generating the Poisson spikes?
\begin{solution}
The bins between the discretization have zero entries. Therefore
the other ones become higher than they should be.
\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$.
\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.
\begin{solution}
\lstinputlisting{../code/isiserialcorr.m}
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonserial100hz}}
\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.
\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.
\begin{solution}
\lstinputlisting{../code/fano.m}
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonfano100hz}}
\end{solution}
\end{parts}
\end{questions}
\end{document}

Binary file not shown.

View File

@ -1,160 +0,0 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\usepackage{graphicx}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Homogeneous Poisson process}{Oct 27, 2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\runningfooter{}{}{}
\pointsinmargin
\bracketedpoints
%\printanswers
\shadedsolutions
\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
numbers=left,
showstringspaces=false,
language=Matlab,
breaklines=true,
breakautoindent=true,
columns=flexible,
frame=single,
captionpos=t,
xleftmargin=2em,
xrightmargin=1em,
aboveskip=10pt,
%title=\lstname,
title={\protect\filename@parse{\lstname}\protect\filename@base.\protect\filename@ext}
}
\begin{document}
\sffamily
%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
\question \textbf{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
\[ P = \lambda \cdot \Delta t \]
for sufficiently small $\Delta t$.
\begin{parts}
\part Write a function that generates $n$ homogeneous Poisson spike trains of a given duration $T_{max}$
with rate $\lambda$.
\begin{solution}
\lstinputlisting{hompoissonspikes.m}
\end{solution}
\part Using this function, generate a few trials and display them in a raster plot.
\begin{solution}
\lstinputlisting{simulations/spikeraster.m}
\begin{lstlisting}
spikes = hompoissonspikes( 10, 100.0, 0.5 );
spikeraster( spikes )
\end{lstlisting}
\mbox{}\\[-3ex]
\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{simulations/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{simulations/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}
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
\[ p(T) = \lambda e^{-\lambda T} \]
for various rates $\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$
used for generating the Poisson spikes?
\begin{solution}
The bins between the discretization have zero entries. Therefore
the other ones become higher than they should be.
\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 simulations with the theoretical expectations for the dependence on $\lambda$.
\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.
\begin{solution}
\lstinputlisting{simulations/isiserialcorr.m}
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonserial100hz}}
\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.
\begin{solution}
\lstinputlisting{simulations/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.
\begin{solution}
\lstinputlisting{simulations/fano.m}
\colorbox{white}{\includegraphics[width=0.98\textwidth]{poissonfano100hz}}
\end{solution}
\end{parts}
\end{questions}
\end{document}

View File

@ -1,142 +1,70 @@
BASENAME=pointprocesses BASENAME=pointprocesses
TEXFILE=$(BASENAME).tex PYFILES=$(wildcard *.py)
DVIFILE=$(BASENAME).dvi PYPDFFILES=$(PYFILES:.py=.pdf)
PSFILE=$(BASENAME).ps
PDFFILE=$(BASENAME).pdf
FOILSFILE=foils.pdf
THUMBNAILSFILE=thumbnails.pdf
HTMLBASENAME=$(BASENAME)h
HTMLTEXFILE=$(BASENAME)h.tex
HTMLDIR=$(BASENAME)h
GPTFILES=$(wildcard *.gpt) GPTFILES=$(wildcard *.gpt)
GPTTEXFILES=$(GPTFILES:.gpt=.tex) GPTTEXFILES=$(GPTFILES:.gpt=.tex)
all: ps pdf talk again watchps watchpdf foils thumbs html html1 epsfigs clean cleanup cleanplots help all: pdf slides thumbs
.PHONY: epsfigs
# script:
pdf : $(BASENAME)-chapter.pdf
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(GPTTEXFILES) $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# slides:
slides: $(BASENAME)-slides.pdf
$(BASENAME)-slides.pdf : $(BASENAME)-slides.tex $(GPTTEXFILES) $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# thumbnails: # thumbnails:
thumbs: $(THUMBNAILSFILE) thumbs: $(BASENAME)-handout.pdf
$(THUMBNAILSFILE): $(TEXFILE) $(GPTTEXFILES) $(BASENAME)-handout.pdf: $(BASENAME)-slides.tex $(GPTTEXFILES)
sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/; s/usepackage{crop}/usepackage[frame]{crop}/' $< > thumbsfoils.tex sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/; s/usepackage{crop}/usepackage[frame]{crop}/' $< > thumbsfoils.tex
pdflatex thumbsfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex thumbsfoils || true pdflatex thumbsfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex thumbsfoils || true
pdfnup --nup 2x4 --no-landscape --paper a4paper --trim "-1cm -1cm -1cm -1cm" --outfile $@ thumbsfoils.pdf '1-19' pdfnup --nup 2x4 --no-landscape --paper a4paper --trim "-1cm -1cm -1cm -1cm" --outfile $@ thumbsfoils.pdf # 1-19
rm thumbsfoils.* rm thumbsfoils.*
# transparencies:
foils: $(FOILSFILE)
$(FOILSFILE): $(TEXFILE) $(GPTTEXFILES)
sed -e 's/setboolean{presentation}{true}/setboolean{presentation}{false}/' $< > tfoils.tex
pdflatex tfoils | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex tfoils || true
pdfnup --nup 1x2 --orient portrait --trim "-1mm -1mm -1mm -1mm" --frame true --delta "1cm 1cm" --paper a4paper --outfile tfoils2.pdf tfoils.pdf
pdfnup --nup 1x1 --orient portrait --trim "-2cm -2cm -2cm -2cm" --paper a4paper --outfile $@ tfoils2.pdf
rm tfoils.* tfoils2.pdf
# talk:
talk: $(PDFFILE)
pdf: $(PDFFILE)
$(PDFFILE): $(TEXFILE) $(GPTTEXFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
# batchmode (no output, no stop on error)
# nonstopmode / scrollmode (no stop on error)
# errorstopmode (stop on error)
again :
pdflatex $(TEXFILE)
watchpdf : watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done while true; do ! make -q pdf && make pdf; sleep 0.5; done
# html watchslides :
html : $(HTMLTEXFILE) $(GPTTEXFILES) while true; do ! make -q slides && make slides; sleep 0.5; done
rm -f $(HTMLDIR)/*
htlatex $< # python plots:
mkdir -p $(HTMLDIR) $(PYPDFFILES) : %.pdf: %.py
mv $(HTMLBASENAME).html $(HTMLDIR) python $<
mv $(HTMLBASENAME)*.* $(HTMLDIR)
mv z*.gif $(HTMLDIR) # gnuplot plots:
cd $(HTMLDIR); for i in *.gif; do convert -page +0+0 $$i tmp.gif; mv tmp.gif $$i; done; rmtex $(HTMLBASENAME) $(GPTTEXFILES) : %.tex: %.gpt whitestyles.gp
#$(HTMLTEXFILE) : $(TEXFILE) Makefile
# sed 's/setboolean{html}{false}/setboolean{html}{true}/; s/\\colorbox{white}{\(.*\)}/\1/g' $< > $@
html1 : $(HTMLTEXFILE) $(GPTTEXFILES)
latex2html -dir $(HTMLDIR) -mkdir -subdir -nonavigation -noinfo -image_type png -notransparent -white -split 0 $<
sed 's-<I>Date:</I>--' $(HTMLDIR)/$(HTMLDIR).html > tmp.html
cp tmp.html $(HTMLDIR)/index.html
mv tmp.html $(HTMLDIR)/$(HTMLDIR).html
$(HTMLTEXFILE) : $(TEXFILE)
sed '/^%nohtml/,/^%endnohtml/d; s/\\colorbox{white}{\(.*\)}/\1/g' $< > $@
# eps of all figures:
epsfigs:
mkdir -p epsfigs; \
for i in $(GPTFILES); do \
{ sed -n -e '1,/\\begin{document}/p' $(TEXFILE); echo "\texpicture{$${i%%.*}}"; echo "\end{document}"; } > tmp.tex; \
latex tmp.tex; \
dvips tmp.dvi; \
ps2eps tmp.ps; \
mv tmp.eps epsfigs/$${i%%.*}.eps; \
rm tmp.*; \
done
# plots:
%.tex: %.gpt whitestyles.gp
gnuplot whitestyles.gp $< gnuplot whitestyles.gp $<
epstopdf $*.eps epstopdf $*.eps
clean : clean :
rm -f *~ rm -f *~
rmtex $(BASENAME) rm -f $(BASENAME).aux $(BASENAME).log
rm -f $(GPTTEXFILES) rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
rm -f $(BASENAME)-slides.aux $(BASENAME)-slides.log $(BASENAME)-slides.out $(BASENAME)-slides.toc $(BASENAME)-slides.nav $(BASENAME)-slides.snm $(BASENAME)-slides.vrb
rm -f $(PYPDFFILES) $(GPTTEXFILES)
cleanup : cleanall : clean
rm -f *~ rm -f $(BASENAME)-chapter.pdf $(BASENAME)-slides.pdf $(BASENAME)-handout.pdf
rmtex $(BASENAME)
rm -f $(PSFILE) $(PDFFILE) $(FOILSFILE) $(THUMBNAILSFILE)
rm -f $(GPTTEXFILES)
rm -f -r $(HTMLDIR)
cleanplots :
sed -n -e '/\\begin{document}/,/\\end{document}/p' $(TEXFILE) | fgrep '\input{' | grep -v '^%' | sed 's/.*input{\(.*\).tex}.*/\1.gpt/' > plot.fls
mkdir -p unusedplots
for i in *.gp*; do \
grep -q $$i plot.fls || { grep -q $$i $$(<plot.fls) && echo $$i || mv $$i unusedplots; }; \
done >> plot.fls
for i in $$(<plot.fls); do \
sed "s/\([^'\" ]*\.dat\)/\n\1\n/g;" $$i | fgrep .dat; \
done | sort | uniq > dat.fls
mkdir -p unuseddata
for i in *.dat; do \
grep -q $$i dat.fls || mv $$i unuseddata; \
done
rm dat.fls plot.fls
help : help :
@echo -e \ @echo -e \
"make pdf: make the pdf file of the talk.\n"\ "make pdf: make the pdf file of the script.\n"\
"make foils: make black&white postscript foils of the talk.\n"\ "make slides: make the pdf file of the slides.\n"\
"make thumbs: make color thumbnails of the talk.\n"\ "make thumbs: make color thumbnails of the talk.\n"\
"make again: run latex and make the pdf file of the talk,\n"\ "make watchpdf: make the pdf file of the script\n"\
" no matter whether you changed the .tex file or not.\n\n"\ " whenever the tex file is modified.\n"\
"make watchpdf: make the pdf file of the talk\n"\ "make watchpdf: make the pdf file of the slides\n"\
" whenever the tex file is modified.\n"\ " whenever the tex file is modified.\n"\
"make html: make a html version of the paper (in $(HTMLDIR)).\n\n"\
"make clean: remove all intermediate files,\n"\ "make clean: remove all intermediate files,\n"\
" just leave the source files and the final .ps and .pdf files.\n"\ " just leave the source files and the final .pdf files.\n"\
"make cleanup: remove all intermediate files as well as\n"\ "make cleanup: remove all intermediate files as well as\n"\
" the final .ps and .pdf files.\n"\ " the final .pdf files.\n"\
"make cleanplots: move all unused .gpt and .dat files\n"\
" into unusedplots/ and unuseddata/, respectively."

View File

@ -0,0 +1,412 @@
\documentclass{beamer}
%%%%% title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[]{Scientific Computing --- Point Processes}
\author[]{Jan Benda}
\institute[]{Neuroethology}
\date[]{WS 14/15}
\titlegraphic{\includegraphics[width=0.3\textwidth]{UT_WBMW_Rot_RGB}}
%%%%% beamer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
{
\usetheme{Singapore}
\setbeamercovered{opaque}
\usecolortheme{tuebingen}
\setbeamertemplate{navigation symbols}{}
\usefonttheme{default}
\useoutertheme{infolines}
% \useoutertheme{miniframes}
}
%\AtBeginSection[]
%{
% \begin{frame}<beamer>
% \begin{center}
% \Huge \insertsectionhead
% \end{center}
% \end{frame}
%}
\setbeamertemplate{blocks}[rounded][shadow=true]
\setcounter{tocdepth}{1}
%%%%% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{pslatex} % nice font for pdf file
%\usepackage{multimedia}
\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}}
%%%% graphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\newcommand{\texpicture}[1]{{\sffamily\small\input{#1.tex}}}
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
numbers=left,
showstringspaces=false,
language=Matlab,
commentstyle=\itshape\color{darkgray},
keywordstyle=\color{blue},
stringstyle=\color{green},
backgroundcolor=\color{blue!10},
breaklines=true,
breakautoindent=true,
columns=flexible,
frame=single,
captionpos=b,
xleftmargin=1em,
xrightmargin=1em,
aboveskip=10pt
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{frame}[plain]
\frametitle{}
\vspace{-1cm}
\titlepage % erzeugt Titelseite
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Content}
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Point processes}
\begin{frame}
\frametitle{Point process}
\vspace{-3ex}
\texpicture{pointprocessscetchA}
A point process is a stochastic (or random) process that generates a sequence of events
at times $\{t_i\}$, $t_i \in \reZ$.
For each point process there is an underlying continuous-valued
process evolving in time. The associated point process occurs when
the underlying continuous process crosses a threshold.
Examples:
\begin{itemize}
\item Spikes/heartbeat: generated by the dynamics of the membrane potential of neurons/heart cells.
\item Earth quakes: generated by the pressure dynamics between the tectonic plates on either side of a geological fault line.
\item Onset of cricket/frogs/birds/... songs: generated by the dynamics of the state of a nervous system.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Point process}
\texpicture{pointprocessscetchB}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Homogeneous Poisson process}
\begin{frame}
\frametitle{Homogeneous Poisson process}
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$.
\includegraphics[width=1\textwidth]{poissonraster100hz}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Interval statistics}
\begin{frame}
\frametitle{Rate}
Rate of events $r$ (``spikes per time'') measured in Hertz.
\begin{itemize}
\item Number of events $N$ per observation time $W$: $r = \frac{N}{W}$
\item Without boundary effects: $r = \frac{N-1}{t_N-t_1}$
\item Inverse interval: $r = \frac{1}{\mu_{ISI}}$
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{(Interspike) interval statistics}
\begin{itemize}
\item Histogram $p(T)$ of intervals $T$. Normalized to $\int_0^{\infty} p(T) \; dT = 1$
\item Mean interval $\mu_{ISI} = \langle T \rangle = \frac{1}{n}\sum\limits_{i=1}^n T_i$
\item Variance of intervals $\sigma_{ISI}^2 = \langle (T - \langle T \rangle)^2 \rangle$\vspace{1ex}
\item Coefficient of variation $CV_{ISI} = \frac{\sigma_{ISI}}{\mu_{ISI}}$
\item Diffusion coefficient $D_{ISI} = \frac{\sigma_{ISI}^2}{2\mu_{ISI}^3}$
\vfill
\end{itemize}
\includegraphics[width=0.45\textwidth]{poissonisih100hz}\hfill
\includegraphics[width=0.45\textwidth]{lifisih16}
\end{frame}
\begin{frame}
\frametitle{Interval statistics of homogeneous Poisson process}
\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$
\end{itemize}
\vfill
\includegraphics[width=0.45\textwidth]{poissonisihexp20hz}\hfill
\includegraphics[width=0.45\textwidth]{poissonisihexp100hz}
\end{frame}
\begin{frame}
\frametitle{Interval return maps}
Scatter plot between succeeding intervals separated by lag $k$.
\vfill
Poisson process $\lambda=100$\,Hz:
\includegraphics[width=1\textwidth]{poissonreturnmap100hz}\hfill
\end{frame}
\begin{frame}
\frametitle{Serial interval correlations}
Correlation coefficients between succeeding intervals separated 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)} \]
\begin{itemize}
\item $\rho_0=1$ (correlation of each interval with itself).
\item Poisson process: $\rho_k =0$ for $k>0$ (renewal process!)
\end{itemize}
\vfill
\includegraphics[width=0.7\textwidth]{poissonserial100hz}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Count statistics}
\begin{frame}
\frametitle{Count statistics}
Histogram of number of events $N$ (counts) within observation window of duration $W$.
\vfill
\includegraphics[width=0.48\textwidth]{poissoncounthist100hz10ms}\hfill
\includegraphics[width=0.48\textwidth]{poissoncounthist100hz100ms}
\end{frame}
\begin{frame}
\frametitle{Count statistics of Poisson process}
Poisson distribution:
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]
\vfill
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}\hfill
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms}
\end{frame}
\begin{frame}
\frametitle{Count statistics --- Fano factor}
Statistics of number of events $N$ within observation window of duration $W$.
\begin{itemize}
\item Mean count: $\mu_N = \langle N \rangle$
\item Count variance: $\sigma_N^2 = \langle (N - \langle N \rangle)^2 \rangle$
\item Fano factor (variance divided by mean): $F = \frac{\sigma_N^2}{\mu_N}$
\item Poisson process: $F=1$
\end{itemize}
\vfill
Poisson process $\lambda=100$\,Hz:
\includegraphics[width=1\textwidth]{poissonfano100hz}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Integrate-and-fire models}
\begin{frame}
\frametitle{Integrate-and-fire models}
Leaky integrate-and-fire model (LIF):
\[ \tau \frac{dV}{dt} = -V + RI + D\xi \]
Whenever membrane potential $V(t)$ crosses the firing threshold $\theta$, a spike is emitted and
$V(t)$ is reset to $V_{reset}$.
\begin{itemize}
\item $\tau$: membrane time constant (typically 10\,ms)
\item $R$: input resistance (here 1\,mV (!))
\item $D\xi$: additive Gaussian white noise of strength $D$
\item $\theta$: firing threshold (here 10\,mV)
\item $V_{reset}$: reset potential (here 0\,mV)
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Integrate-and-fire models}
Discretization with time step $\Delta t$: $V(t) \rightarrow V_i,\;t_i = i \Delta t$.\\
Euler integration:
\begin{eqnarray*}
\frac{dV}{dt} & \approx & \frac{V_{i+1} - V_i}{\Delta t} \\
\Rightarrow \quad V_{i+1} & = & V_i + \Delta t \frac{-V_i+RI_i+\sqrt{2D\Delta t}N_i}{\tau}
\end{eqnarray*}
$N_i$ are normally distributed random numbers (Gaussian with zero mean and unit variance)
--- the $\sqrt{\Delta t}$ is for white noise.
\includegraphics[width=0.82\textwidth]{lifraster16}
\end{frame}
\begin{frame}
\frametitle{Interval statistics of LIF}
Interval distribution approaches Inverse Gaussian for large $I$:
\[ p(T) = \frac{1}{\sqrt{4\pi D T^3}}\exp\left[-\frac{(T-\langle T \rangle)^2}{4DT\langle T \rangle^2}\right] \]
where $\langle T \rangle$ is the mean interspike interval and $D$
is the diffusion coefficient.
\vfill
\includegraphics[width=0.45\textwidth]{lifisihdistr08}\hfill
\includegraphics[width=0.45\textwidth]{lifisihdistr16}
\end{frame}
\begin{frame}
\frametitle{Interval statistics of PIF}
For the perfect integrate-and-fire (PIF)
\[ \tau \frac{dV}{dt} = RI + D\xi \]
(the canonical model or supra-threshold firing on a limit cycle)\\
the Inverse Gaussian describes exactly the interspike interval distribution.
\vfill
\includegraphics[width=0.45\textwidth]{pifisihdistr01}\hfill
\includegraphics[width=0.45\textwidth]{pifisihdistr10}
\end{frame}
\begin{frame}
\frametitle{Interval return map of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{lifreturnmap16}
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{lifserial16}\\
Integrate-and-fire driven with white noise are still renewal processes!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{liffano16}\\
Fano factor is not one!
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Interval statistics of LIF with OU noise}
\begin{eqnarray*}
\tau \frac{dV}{dt} & = & -V + RI + U \\
\tau_{OU} \frac{dU}{dt} & = & - U + D\xi
\end{eqnarray*}
Ohrnstein-Uhlenbeck noise is lowpass filtered white noise.
\includegraphics[width=0.45\textwidth]{lifouisihdistr08-100ms}\hfill
\includegraphics[width=0.45\textwidth]{lifouisihdistr16-100ms}\\
More peaky than the inverse Gaussian!
\end{frame}
\begin{frame}
\frametitle{Interval return map of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifoureturnmap16-100ms}
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifouserial16-100ms}\\
OU-noise introduces positive interval correlations!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifoufano16-100ms}\\
Fano factor increases with count window duration.
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Interval statistics of LIF with adaptation}
\begin{eqnarray*}
\tau \frac{dV}{dt} & = & -V - A + RI + D\xi \\
\tau_{adapt} \frac{dA}{dt} & = & - A
\end{eqnarray*}
Adaptation $A$ with time constant $\tau_{adapt}$ and increment $\Delta A$ at spike.
\includegraphics[width=0.45\textwidth]{lifadaptisihdistr08-100ms}\hfill
\includegraphics[width=0.45\textwidth]{lifadaptisihdistr65-100ms}\\
Similar to LIF with white noise.
\end{frame}
\begin{frame}
\frametitle{Interval return map of LIF with adaptation}
LIF $I=10$, $\tau_{adapt}=100$\,ms:
\includegraphics[width=1\textwidth]{lifadaptreturnmap10-100ms}\\
Negative correlation at lag one.
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF with adaptation}
LIF $I=10$, $\tau_{adapt}=100$\,ms:
\includegraphics[width=1\textwidth]{lifadaptserial10-100ms}\\
Adaptation with white noise introduces negative interval correlations!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF with adaptation}
LIF $I=10$, $\tau_{adapt}=100$\,ms:
\includegraphics[width=1\textwidth]{lifadaptfano10-100ms}\\
Fano factor decreases with count window duration.
\end{frame}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Non stationary}
\subsection{Inhomogeneous Poisson process}
\subsection{Firing rate}
\subsection{Instantaneous rate}
\subsection{Autocorrelation}
\subsection{Crosscorrelation}
\subsection{Joint PSTH}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Renewal process}
\subsection{Superthreshold firing}
\subsection{Subthreshold firing}
\section{Non-renewal processes}
\subsection{Bursting}
\subsection{Resonator}
\subsection{Standard distributions}
\subsubsection{Gamma}
\subsubsection{How to read ISI histograms}
refractoriness, poisson tail, sub-, supra-threshold, missed spikes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Correlation with stimulus}
\subsection{Tuning curve}
\subsection{Linear filter}
\subsection{Spatiotemporal receptive field}
\subsection{Generalized linear model}
\begin{frame}
\end{frame}

View File

@ -1,412 +1,168 @@
\documentclass{beamer}
%%%%% title %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[]{Scientific Computing --- Point Processes}
\author[]{Jan Benda}
\institute[]{Neuroethology}
\date[]{WS 14/15}
\titlegraphic{\includegraphics[width=0.3\textwidth]{UT_WBMW_Rot_RGB}}
%%%%% beamer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
{
\usetheme{Singapore}
\setbeamercovered{opaque}
\usecolortheme{tuebingen}
\setbeamertemplate{navigation symbols}{}
\usefonttheme{default}
\useoutertheme{infolines}
% \useoutertheme{miniframes}
}
%\AtBeginSection[]
%{
% \begin{frame}<beamer>
% \begin{center}
% \Huge \insertsectionhead
% \end{center}
% \end{frame}
%}
\setbeamertemplate{blocks}[rounded][shadow=true]
\setcounter{tocdepth}{1}
%%%%% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{pslatex} % nice font for pdf file
%\usepackage{multimedia}
\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}}
%%%% graphics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{graphicx}
\newcommand{\texpicture}[1]{{\sffamily\small\input{#1.tex}}}
%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
numbers=left,
showstringspaces=false,
language=Matlab,
commentstyle=\itshape\color{darkgray},
keywordstyle=\color{blue},
stringstyle=\color{green},
backgroundcolor=\color{blue!10},
breaklines=true,
breakautoindent=true,
columns=flexible,
frame=single,
captionpos=b,
xleftmargin=1em,
xrightmargin=1em,
aboveskip=10pt
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} \chapter{\tr{Point processes}{Punktprozesse}}
\begin{frame}[plain]
\frametitle{}
\vspace{-1cm}
\titlepage % erzeugt Titelseite
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{figure}[t]
\begin{frame} \texpicture{pointprocessscetchB}
\frametitle{Content} \caption{\label{pointprocessscetchfig}Ein Punktprozess ist eine
\tableofcontents Abfolge von Zeitpunkten $t_i$ die auch durch die Intervalle
\end{frame} $T_i=t_{i+1}-t_i$ oder die Anzahl der Ereignisse $n_i$ beschrieben
werden kann. }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{figure}
\section{Point processes}
\begin{frame}
\frametitle{Point process}
\vspace{-3ex}
\texpicture{pointprocessscetchA}
A point process is a stochastic (or random) process that generates a sequence of events Ein zeitlicher Punktprozess ist ein stochastischer Prozess der eine Abfolge von Ereignissen zu den Zeiten $\{t_i\}$, $t_i \in \reZ$ generiert.
at times $\{t_i\}$, $t_i \in \reZ$.
For each point process there is an underlying continuous-valued Jeder Punktprozess wird durch einen sich in der Zeit kontinuierlichen
process evolving in time. The associated point process occurs when entwickelnden Prozess generiert. Wann immer dieser Prozess eine Schwelle \"uberschreitet
the underlying continuous process crosses a threshold. wird ein Ereigniss des Punktprozesses erzeugt. Zum Beispiel:
Examples:
\begin{itemize} \begin{itemize}
\item Spikes/heartbeat: generated by the dynamics of the membrane potential of neurons/heart cells. \item Aktionspotentiale/Herzschlag: wird durch die Dynamik des
\item Earth quakes: generated by the pressure dynamics between the tectonic plates on either side of a geological fault line. Membranpotentials eines Neurons/Herzzelle erzeugt.
\item Onset of cricket/frogs/birds/... songs: generated by the dynamics of the state of a nervous system. \item Erdbeben: wird durch die Dynamik des Druckes zwischen
tektonischen Platten auf beiden Seiten einer geologischen Verwerfung
erzeugt.
\item Zeitpunkt eines Grillen/Frosch/Vogelgesangs: wird durch die
Dynamic des Nervensystems und des Muskelapparates erzeugt.
\end{itemize} \end{itemize}
\end{frame}
\begin{frame}
\frametitle{Point process}
\texpicture{pointprocessscetchB}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Homogeneous Poisson process}
\begin{frame}
\frametitle{Homogeneous Poisson process}
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$.
\includegraphics[width=1\textwidth]{poissonraster100hz}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Interval statistics} \section{Rate eines Punktprozesses}
\begin{frame}
\frametitle{Rate}
Rate of events $r$ (``spikes per time'') measured in Hertz. Rate of events $r$ (``spikes per time'') measured in Hertz.
\begin{itemize} \begin{itemize}
\item Number of events $N$ per observation time $W$: $r = \frac{N}{W}$ \item Number of events $N$ per observation time $W$: $r = \frac{N}{W}$
\item Without boundary effects: $r = \frac{N-1}{t_N-t_1}$ \item Without boundary effects: $r = \frac{N-1}{t_N-t_1}$
\item Inverse interval: $r = \frac{1}{\mu_{ISI}}$ \item Inverse interval: $r = \frac{1}{\mu_{ISI}}$
\end{itemize} \end{itemize}
\end{frame}
\begin{frame} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frametitle{(Interspike) interval statistics} \section{Intervall Statistiken}
\begin{figure}[t]
\includegraphics[width=0.45\textwidth]{poissonisih100hz}\hfill
\includegraphics[width=0.45\textwidth]{lifisih16}
\caption{\label{isihfig}Interspike-Intervall Histogramme von einem Poisson Prozess (links)
und einem Integrate-and-Fire Neuron (rechts).}
\end{figure}
\subsection{First order (Interspike) interval statistics}
\begin{itemize} \begin{itemize}
\item Histogram $p(T)$ of intervals $T$. Normalized to $\int_0^{\infty} p(T) \; dT = 1$ \item Histogram $p(T)$ of intervals $T$. Normalized to $\int_0^{\infty} p(T) \; dT = 1$
\item Mean interval $\mu_{ISI} = \langle T \rangle = \frac{1}{n}\sum\limits_{i=1}^n T_i$ \item Mean interval $\mu_{ISI} = \langle T \rangle = \frac{1}{n}\sum\limits_{i=1}^n T_i$
\item Variance of intervals $\sigma_{ISI}^2 = \langle (T - \langle T \rangle)^2 \rangle$\vspace{1ex} \item Variance of intervals $\sigma_{ISI}^2 = \langle (T - \langle T \rangle)^2 \rangle$\vspace{1ex}
\item Coefficient of variation $CV_{ISI} = \frac{\sigma_{ISI}}{\mu_{ISI}}$ \item Coefficient of variation $CV_{ISI} = \frac{\sigma_{ISI}}{\mu_{ISI}}$
\item Diffusion coefficient $D_{ISI} = \frac{\sigma_{ISI}^2}{2\mu_{ISI}^3}$ \item Diffusion coefficient $D_{ISI} = \frac{\sigma_{ISI}^2}{2\mu_{ISI}^3}$
\vfill
\end{itemize} \end{itemize}
\includegraphics[width=0.45\textwidth]{poissonisih100hz}\hfill
\includegraphics[width=0.45\textwidth]{lifisih16}
\end{frame}
\begin{frame} \subsection{Interval return maps}
\frametitle{Interval statistics of homogeneous Poisson process}
\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$
\end{itemize}
\vfill
\includegraphics[width=0.45\textwidth]{poissonisihexp20hz}\hfill
\includegraphics[width=0.45\textwidth]{poissonisihexp100hz}
\end{frame}
\begin{frame}
\frametitle{Interval return maps}
Scatter plot between succeeding intervals separated by lag $k$. Scatter plot between succeeding intervals separated by lag $k$.
\vfill
Poisson process $\lambda=100$\,Hz:
\includegraphics[width=1\textwidth]{poissonreturnmap100hz}\hfill
\end{frame}
\begin{frame} \begin{figure}[t]
\frametitle{Serial interval correlations} \begin{minipage}[t]{0.49\textwidth}
LIF $I=10$, $\tau_{adapt}=100$\,ms:\\
\includegraphics[width=1\textwidth]{lifadaptreturnmap10-100ms}
\end{minipage}
\hfill
\begin{minipage}[t]{0.49\textwidth}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:\\
\includegraphics[width=1\textwidth]{lifoureturnmap16-100ms}
\end{minipage}
\caption{\label{returnmapfig}Interspike-Intervall return maps.}
\end{figure}
\subsection{Serial correlations of the intervals}
Correlation coefficients between succeeding intervals separated by lag $k$: Correlation coefficients between succeeding intervals separated 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)} \] \[ \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)} \]
\begin{itemize} $\rho_0=1$ (correlation of each interval with itself).
\item $\rho_0=1$ (correlation of each interval with itself).
\item Poisson process: $\rho_k =0$ for $k>0$ (renewal process!) \begin{figure}[t]
\end{itemize} \begin{minipage}[t]{0.49\textwidth}
\vfill LIF $I=10$, $\tau_{adapt}=100$\,ms:\\
\includegraphics[width=0.7\textwidth]{poissonserial100hz} \includegraphics[width=1\textwidth]{lifadaptserial10-100ms}
\end{frame} \end{minipage}
\hfill
\begin{minipage}[t]{0.49\textwidth}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:\\
\includegraphics[width=1\textwidth]{lifouserial16-100ms}
\end{minipage}
\caption{\label{serialcorrfig}Serial correlations.}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Count statistics} \section{Count statistics}
\begin{frame} \begin{figure}[t]
\frametitle{Count statistics}
Histogram of number of events $N$ (counts) within observation window of duration $W$.
\vfill
\includegraphics[width=0.48\textwidth]{poissoncounthist100hz10ms}\hfill \includegraphics[width=0.48\textwidth]{poissoncounthist100hz10ms}\hfill
\includegraphics[width=0.48\textwidth]{poissoncounthist100hz100ms} \includegraphics[width=0.48\textwidth]{poissoncounthist100hz100ms}
\end{frame} \caption{\label{countstatsfig}Count Statistik.}
\end{figure}
\begin{frame} Histogram of number of events $N$ (counts) within observation window of duration $W$.
\frametitle{Count statistics of Poisson process}
Poisson distribution:
\[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]
\vfill \subsection{Fano factor}
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}\hfill
\includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms} \begin{figure}[t]
\end{frame} \begin{minipage}[t]{0.49\textwidth}
Poisson process $\lambda=100$\,Hz:\\
\includegraphics[width=1\textwidth]{poissonfano100hz}
\end{minipage}
\hfill
\begin{minipage}[t]{0.49\textwidth}
LIF $I=10$, $\tau_{adapt}=100$\,ms:\\
\includegraphics[width=1\textwidth]{lifadaptfano10-100ms}
\end{minipage}
\caption{\label{fanofig}Fano factor.}
\end{figure}
\begin{frame}
\frametitle{Count statistics --- Fano factor}
Statistics of number of events $N$ within observation window of duration $W$. Statistics of number of events $N$ within observation window of duration $W$.
\begin{itemize} \begin{itemize}
\item Mean count: $\mu_N = \langle N \rangle$ \item Mean count: $\mu_N = \langle N \rangle$
\item Count variance: $\sigma_N^2 = \langle (N - \langle N \rangle)^2 \rangle$ \item Count variance: $\sigma_N^2 = \langle (N - \langle N \rangle)^2 \rangle$
\item Fano factor (variance divided by mean): $F = \frac{\sigma_N^2}{\mu_N}$ \item Fano factor (variance divided by mean): $F = \frac{\sigma_N^2}{\mu_N}$
\item Poisson process: $F=1$
\end{itemize}
\vfill
Poisson process $\lambda=100$\,Hz:
\includegraphics[width=1\textwidth]{poissonfano100hz}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Integrate-and-fire models}
\begin{frame}
\frametitle{Integrate-and-fire models}
Leaky integrate-and-fire model (LIF):
\[ \tau \frac{dV}{dt} = -V + RI + D\xi \]
Whenever membrane potential $V(t)$ crosses the firing threshold $\theta$, a spike is emitted and
$V(t)$ is reset to $V_{reset}$.
\begin{itemize}
\item $\tau$: membrane time constant (typically 10\,ms)
\item $R$: input resistance (here 1\,mV (!))
\item $D\xi$: additive Gaussian white noise of strength $D$
\item $\theta$: firing threshold (here 10\,mV)
\item $V_{reset}$: reset potential (here 0\,mV)
\end{itemize} \end{itemize}
\end{frame}
\begin{frame}
\frametitle{Integrate-and-fire models}
Discretization with time step $\Delta t$: $V(t) \rightarrow V_i,\;t_i = i \Delta t$.\\
Euler integration:
\begin{eqnarray*}
\frac{dV}{dt} & \approx & \frac{V_{i+1} - V_i}{\Delta t} \\
\Rightarrow \quad V_{i+1} & = & V_i + \Delta t \frac{-V_i+RI_i+\sqrt{2D\Delta t}N_i}{\tau}
\end{eqnarray*}
$N_i$ are normally distributed random numbers (Gaussian with zero mean and unit variance)
--- the $\sqrt{\Delta t}$ is for white noise.
\includegraphics[width=0.82\textwidth]{lifraster16}
\end{frame}
\begin{frame}
\frametitle{Interval statistics of LIF}
Interval distribution approaches Inverse Gaussian for large $I$:
\[ p(T) = \frac{1}{\sqrt{4\pi D T^3}}\exp\left[-\frac{(T-\langle T \rangle)^2}{4DT\langle T \rangle^2}\right] \]
where $\langle T \rangle$ is the mean interspike interval and $D$
is the diffusion coefficient.
\vfill
\includegraphics[width=0.45\textwidth]{lifisihdistr08}\hfill
\includegraphics[width=0.45\textwidth]{lifisihdistr16}
\end{frame}
\begin{frame}
\frametitle{Interval statistics of PIF}
For the perfect integrate-and-fire (PIF)
\[ \tau \frac{dV}{dt} = RI + D\xi \]
(the canonical model or supra-threshold firing on a limit cycle)\\
the Inverse Gaussian describes exactly the interspike interval distribution.
\vfill
\includegraphics[width=0.45\textwidth]{pifisihdistr01}\hfill
\includegraphics[width=0.45\textwidth]{pifisihdistr10}
\end{frame}
\begin{frame}
\frametitle{Interval return map of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{lifreturnmap16}
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{lifserial16}\\
Integrate-and-fire driven with white noise are still renewal processes!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF}
LIF $I=15.7$:
\includegraphics[width=1\textwidth]{liffano16}\\
Fano factor is not one!
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Interval statistics of LIF with OU noise}
\begin{eqnarray*}
\tau \frac{dV}{dt} & = & -V + RI + U \\
\tau_{OU} \frac{dU}{dt} & = & - U + D\xi
\end{eqnarray*}
Ohrnstein-Uhlenbeck noise is lowpass filtered white noise.
\includegraphics[width=0.45\textwidth]{lifouisihdistr08-100ms}\hfill
\includegraphics[width=0.45\textwidth]{lifouisihdistr16-100ms}\\
More peaky than the inverse Gaussian!
\end{frame}
\begin{frame}
\frametitle{Interval return map of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifoureturnmap16-100ms}
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifouserial16-100ms}\\
OU-noise introduces positive interval correlations!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF with OU noise}
LIF $I=15.7$, $\tau_{OU}=100$\,ms:
\includegraphics[width=1\textwidth]{lifoufano16-100ms}\\
Fano factor increases with count window duration.
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \section{\tr{Homogeneous Poisson process}{Homogener Poisson Prozess}}
\frametitle{Interval statistics of LIF with adaptation}
\begin{eqnarray*}
\tau \frac{dV}{dt} & = & -V - A + RI + D\xi \\
\tau_{adapt} \frac{dA}{dt} & = & - A
\end{eqnarray*}
Adaptation $A$ with time constant $\tau_{adapt}$ and increment $\Delta A$ at spike.
\includegraphics[width=0.45\textwidth]{lifadaptisihdistr08-100ms}\hfill
\includegraphics[width=0.45\textwidth]{lifadaptisihdistr65-100ms}\\
Similar to LIF with white noise.
\end{frame}
\begin{frame} \begin{figure}[t]
\frametitle{Interval return map of LIF with adaptation} \includegraphics[width=1\textwidth]{poissonraster100hz}
LIF $I=10$, $\tau_{adapt}=100$\,ms: \caption{\label{hompoissonfig}Rasterplot von Poisson-Spikes.}
\includegraphics[width=1\textwidth]{lifadaptreturnmap10-100ms}\\ \end{figure}
Negative correlation at lag one.
\end{frame}
\begin{frame}
\frametitle{Serial correlations of LIF with adaptation}
LIF $I=10$, $\tau_{adapt}=100$\,ms:
\includegraphics[width=1\textwidth]{lifadaptserial10-100ms}\\
Adaptation with white noise introduces negative interval correlations!
\end{frame}
\begin{frame}
\frametitle{Count statistics of LIF with adaptation}
LIF $I=10$, $\tau_{adapt}=100$\,ms:
\includegraphics[width=1\textwidth]{lifadaptfano10-100ms}\\
Fano factor decreases with count window duration.
\end{frame}
\end{document}
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$
\section{Non stationary} is
\subsection{Inhomogeneous Poisson process} \[ P=\lambda \cdot \Delta t \]
\subsection{Firing rate} for a Poisson process with rate $\lambda$.
\subsection{Instantaneous rate}
\subsection{Autocorrelation}
\subsection{Crosscorrelation}
\subsection{Joint PSTH}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Statistics of homogeneous Poisson process}
\section{Renewal process}
\subsection{Superthreshold firing}
\subsection{Subthreshold firing}
\section{Non-renewal processes}
\subsection{Bursting}
\subsection{Resonator}
\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}
\subsection{Standard distributions} \begin{itemize}
\subsubsection{Gamma} \item Exponential distribution of intervals $T$: $p(T) = \lambda e^{-\lambda T}$
\subsubsection{How to read ISI histograms} \item Mean interval $\mu_{ISI} = \frac{1}{\lambda}$
refractoriness, poisson tail, sub-, supra-threshold, missed spikes \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]
\section{Correlation with stimulus} \includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz10ms}\hfill
\subsection{Tuning curve} \includegraphics[width=0.48\textwidth]{poissoncounthistdist100hz100ms}
\subsection{Linear filter} \caption{\label{hompoissoncountfig}Count statistics of poisson spike train.}
\subsection{Spatiotemporal receptive field} \end{figure}
\subsection{Generalized linear model}
\begin{frame} Poisson distribution:
\end{frame} \[ P(k) = \frac{(\lambda W)^ke^{\lambda W}}{k!} \]

View File

@ -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: Sun Oct 26 14:09:12 2014 %%CreationDate: Sun Oct 25 21:47:09 2015
%%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 (Sun Oct 26 14:09:12 2014) /CreationDate (Sun Oct 25 21:47:09 2015)
/DOCINFO pdfmark /DOCINFO pdfmark
end end
} ifelse } ifelse

View File

@ -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: Sun Oct 26 17:34:18 2014 %%CreationDate: Sun Oct 25 21:47:09 2015
%%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 (Sun Oct 26 17:34:18 2014) /CreationDate (Sun Oct 25 21:47:09 2015)
/DOCINFO pdfmark /DOCINFO pdfmark
end end
} ifelse } ifelse

View File

@ -59,7 +59,8 @@
% figures: % figures:
\setlength{\fboxsep}{0pt} \setlength{\fboxsep}{0pt}
\newcommand{\texpicture}[1]{{\sffamily\footnotesize\input{#1.tex}}} \newcommand{\texinputpath}{}
\newcommand{\texpicture}[1]{{\sffamily\footnotesize\input{\texinputpath#1.tex}}}
%\newcommand{\texpicture}[1]{\fbox{\sffamily\footnotesize\input{#1.tex}}} %\newcommand{\texpicture}[1]{\fbox{\sffamily\footnotesize\input{#1.tex}}}
%\newcommand{\texpicture}[1]{\setlength{\fboxsep}{2mm}\fbox{#1}} %\newcommand{\texpicture}[1]{\setlength{\fboxsep}{2mm}\fbox{#1}}
%\newcommand{\texpicture}[1]{} %\newcommand{\texpicture}[1]{}
@ -213,7 +214,7 @@
\arabic{theexercise}:}\newline \newcommand{\exercisesource}{#1}}% \arabic{theexercise}:}\newline \newcommand{\exercisesource}{#1}}%
{\ifthenelse{\equal{\exercisesource}{}}{}{\ifthenelse{\value{theexercise}>\value{maxexercise}}{}{\medskip\lstinputlisting{\codepath\exercisesource}}}\medskip\stepcounter{theexercise}} {\ifthenelse{\equal{\exercisesource}{}}{}{\ifthenelse{\value{theexercise}>\value{maxexercise}}{}{\medskip\lstinputlisting{\codepath\exercisesource}}}\medskip\stepcounter{theexercise}}
\graphicspath{{statistics/lecture/}{statistics/lecture/figures/}{bootstrap/lecture/}{bootstrap/lecture/figures/}{likelihood/lecture/}{likelihood/lecture/figures/}} \graphicspath{{statistics/lecture/}{statistics/lecture/figures/}{bootstrap/lecture/}{bootstrap/lecture/figures/}{likelihood/lecture/}{likelihood/lecture/figures/}{pointprocesses/lecture/}{pointprocesses/lecture/figures/}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -233,4 +234,8 @@
\renewcommand{\codepath}{likelihood/code/} \renewcommand{\codepath}{likelihood/code/}
\include{likelihood/lecture/likelihood} \include{likelihood/lecture/likelihood}
\renewcommand{\codepath}{pointprocesses/code/}
\renewcommand{\texinputpath}{pointprocesses/lecture/}
\include{pointprocesses/lecture/pointprocesses}
\end{document} \end{document}

View File

@ -1,22 +1,29 @@
BASENAME=statistics BASENAME=statistics
PYFILES=$(wildcard *.py) PYFILES=$(wildcard *.py)
PYPDFFILES=$(PYFILES:.py=.pdf) PYPDFFILES=$(PYFILES:.py=.pdf)
pdf : $(BASENAME)-chapter.pdf $(PYPDFFILES) all : pdf
# script:
pdf : $(BASENAME)-chapter.pdf
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(PYPDFFILES)
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
$(PYPDFFILES) : %.pdf : %.py $(PYPDFFILES) : %.pdf : %.py
python $< python $<
clean : clean :
rm -f *~ $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out $(BASENAME).aux $(BASENAME).log rm -f *~
rm -f $(BASENAME).aux $(BASENAME).log
rm -f $(BASENAME)-chapter.aux $(BASENAME)-chapter.log $(BASENAME)-chapter.out
rm -f $(PYPDFFILES) $(GPTTEXFILES)
cleanall : clean cleanall : clean
rm -f $(BASENAME)-chapter.pdf rm -f $(BASENAME)-chapter.pdf
watch : watchpdf :
while true; do ! make -q pdf && make pdf; sleep 0.5; done while true; do ! make -q pdf && make pdf; sleep 0.5; done

View File

@ -43,5 +43,5 @@ ax.annotate('maximum',
ax.boxplot( x, whis=100.0 ) ax.boxplot( x, whis=100.0 )
plt.tight_layout() plt.tight_layout()
plt.savefig('boxwhisker.pdf') plt.savefig('boxwhisker.pdf')
plt.show() #plt.show()

View File

@ -5,7 +5,6 @@ plt.xkcd()
fig = plt.figure( figsize=(6,5) ) fig = plt.figure( figsize=(6,5) )
n = 200 n = 200
for k, r in enumerate( [ 1.0, 0.6, 0.0, -0.9 ] ) : for k, r in enumerate( [ 1.0, 0.6, 0.0, -0.9 ] ) :
print r
x = np.random.randn( n ) x = np.random.randn( n )
y = r*x + np.sqrt(1.0-r*r)*np.random.randn( n ) y = r*x + np.sqrt(1.0-r*r)*np.random.randn( n )
ax = fig.add_subplot( 2, 2, k+1 ) ax = fig.add_subplot( 2, 2, k+1 )
@ -30,5 +29,4 @@ for k, r in enumerate( [ 1.0, 0.6, 0.0, -0.9 ] ) :
plt.tight_layout() plt.tight_layout()
plt.savefig('correlation.pdf') plt.savefig('correlation.pdf')
plt.show() #plt.show()

View File

@ -28,5 +28,4 @@ ax.set_ylabel( 'Probability' )
ax.hist([x2, x1], bins, normed=True, color=['#FFCC00', '#FFFF66' ]) ax.hist([x2, x1], bins, normed=True, color=['#FFCC00', '#FFFF66' ])
plt.tight_layout() plt.tight_layout()
fig.savefig( 'diehistograms.pdf' ) fig.savefig( 'diehistograms.pdf' )
plt.show() #plt.show()

View File

@ -29,5 +29,4 @@ ax.plot(x,g, 'b', lw=4)
ax.plot([0.0, 0.0], [0.0, 0.45], 'k', lw=2 ) ax.plot([0.0, 0.0], [0.0, 0.45], 'k', lw=2 )
plt.tight_layout() plt.tight_layout()
fig.savefig( 'median.pdf' ) fig.savefig( 'median.pdf' )
plt.show() #plt.show()

View File

@ -39,4 +39,4 @@ ax.scatter( x, z )
plt.tight_layout() plt.tight_layout()
plt.savefig('nonlincorrelation.pdf') plt.savefig('nonlincorrelation.pdf')
plt.show() #plt.show()

View File

@ -35,5 +35,5 @@ ax.hist(r, 20, normed=True, color='#FFCC00')
plt.tight_layout() plt.tight_layout()
fig.savefig( 'pdfhistogram.pdf' ) fig.savefig( 'pdfhistogram.pdf' )
plt.show() #plt.show()

View File

@ -32,5 +32,4 @@ ax.fill_between( x[(x>x1)&(x<x2)], 0.0, g[(x>x1)&(x<x2)], color='#cc0000' )
ax.plot(x,g, 'b', lw=4) ax.plot(x,g, 'b', lw=4)
plt.tight_layout() plt.tight_layout()
fig.savefig( 'pdfprobabilities.pdf' ) fig.savefig( 'pdfprobabilities.pdf' )
plt.show() #plt.show()

View File

@ -46,5 +46,4 @@ ax.plot([q[0], q[0]], [0.0, 0.4], 'k', lw=2 )
ax.plot([q[2], q[2]], [0.0, 0.4], 'k', lw=2 ) ax.plot([q[2], q[2]], [0.0, 0.4], 'k', lw=2 )
plt.tight_layout() plt.tight_layout()
fig.savefig( 'quartile.pdf' ) fig.savefig( 'quartile.pdf' )
plt.show() #plt.show()