diff --git a/pointprocesses/code/isiserialcorr.m b/pointprocesses/code/isiserialcorr.m index 17df321..ff97cfa 100644 --- a/pointprocesses/code/isiserialcorr.m +++ b/pointprocesses/code/isiserialcorr.m @@ -26,7 +26,7 @@ function isicorr = isiserialcorr(isivec, maxlag) % plot: plot(lags, isicorr, '-b'); hold on; - scatter(lags, isicorr, 100.0, 'b', 'filled'); + scatter(lags, isicorr, 10.0, 'b', 'filled'); hold off; xlabel('Lag k') ylabel('\rho_k') diff --git a/pointprocesses/code/plotISIHist.m b/pointprocesses/code/plotisihist.m similarity index 72% rename from pointprocesses/code/plotISIHist.m rename to pointprocesses/code/plotisihist.m index e181c3a..2f3cf93 100644 --- a/pointprocesses/code/plotISIHist.m +++ b/pointprocesses/code/plotisihist.m @@ -1,7 +1,7 @@ -function plotISIHist(isis, binwidth) +function plotisihist(isis, binwidth) % Plot and annotate histogram of interspike intervals. % -% plotISIHist(isis, binwidth) +% plotisihist(isis, binwidth) % % Arguments: % isis: vector of interspike intervals in seconds @@ -9,9 +9,9 @@ function plotISIHist(isis, binwidth) % compute normalized histogram: if nargin < 2 - [pdf, centers] = isiHist(isis); + [pdf, centers] = isihist(isis); else - [pdf, centers] = isiHist(isis, binwidth); + [pdf, centers] = isihist(isis, binwidth); end % plot: @@ -21,14 +21,11 @@ function plotISIHist(isis, binwidth) % annotation: misi = mean(isis); sdisi = std(isis); - disi = sdisi^2.0/2.0/misi^3; text(0.95, 0.8, sprintf('mean=%.1f ms', 1000.0*misi), ... 'Units', 'normalized', 'HorizontalAlignment', 'right') text(0.95, 0.7, sprintf('std=%.1f ms', 1000.0*sdisi), ... 'Units', 'normalized', 'HorizontalAlignment', 'right') text(0.95, 0.6, sprintf('CV=%.2f', sdisi/misi), ... 'Units', 'normalized', 'HorizontalAlignment', 'right') - %text(0.95, 0.5, sprintf('D=%.1f Hz', disi), ... - % 'Units', 'normalized', 'HorizontalAlignment', 'right') end diff --git a/pointprocesses/code/plotisih.m b/pointprocesses/code/plotisihs.m similarity index 67% rename from pointprocesses/code/plotisih.m rename to pointprocesses/code/plotisihs.m index bc3e7c9..c2eef9e 100644 --- a/pointprocesses/code/plotisih.m +++ b/pointprocesses/code/plotisihs.m @@ -1,19 +1,19 @@ maxisi = 300.0; subplot(1, 3, 1); poissonisis = isis(poissonspikes); -isihist(poissonisis, 0.001); +plotisihist(poissonisis, 0.001); xlim([0, maxisi]) title('Poisson'); subplot(1, 3, 2); pifouisis = isis(pifouspikes); -isihist(pifouisis, 0.001); +plotisihist(pifouisis, 0.001); xlim([0, maxisi]) title('PIF OU'); subplot(1, 3, 3); lifadaptisis = isis(lifadaptspikes); -isihist(lifadaptisis, 0.001); +plotisihist(lifadaptisis, 0.001); xlim([0, maxisi]) title('LIF adapt'); -savefigpdf(gcf, 'isihist.pdf', 20, 7); \ No newline at end of file +savefigpdf(gcf, 'isihist.pdf', 20, 7); diff --git a/pointprocesses/exercises/instructions.tex b/pointprocesses/exercises/instructions.tex index 96ac4bc..3041d3e 100644 --- a/pointprocesses/exercises/instructions.tex +++ b/pointprocesses/exercises/instructions.tex @@ -1,11 +1,6 @@ -\vspace*{-6.5ex} +\vspace*{-7.8ex} \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] -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} - -\ifprintanswers% -\else - -\fi diff --git a/pointprocesses/exercises/pointprocesses01-de.tex b/pointprocesses/exercises/pointprocesses01-de.tex new file mode 100644 index 0000000..ea8674d --- /dev/null +++ b/pointprocesses/exercises/pointprocesses01-de.tex @@ -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} \ No newline at end of file diff --git a/pointprocesses/exercises/pointprocesses01.tex b/pointprocesses/exercises/pointprocesses01.tex index ea8674d..dbc2a6c 100644 --- a/pointprocesses/exercises/pointprocesses01.tex +++ b/pointprocesses/exercises/pointprocesses01.tex @@ -11,11 +11,11 @@ \usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} \pagestyle{headandfoot} \ifprintanswers -\newcommand{\stitle}{L\"osungen} +\newcommand{\stitle}{: Solutions} \else -\newcommand{\stitle}{\"Ubung} +\newcommand{\stitle}{} \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: jan.benda@uni-tuebingen.de} \runningfooter{}{\thepage}{} @@ -89,17 +89,20 @@ jan.benda@uni-tuebingen.de} \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. + \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 Lade die Spiketrains aus den drei Dateien. Achte darauf, - dass sie verschiedene Variablen\-namen bekommen. + \part Load the spike trains from the three files. + 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{lstlisting} clear all @@ -114,21 +117,24 @@ jan.benda@uni-tuebingen.de} clear spikes; % better: clear all - x = load( 'poisson.mat' ); + x = load('poisson.mat'); poissonspikes = x.spikes; - x = load( pifou.mat' ); + x = load('pifou.mat'); pifouspikes = x.spikes; - x = load( 'lifadapt.mat' ); + 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. + + \newsolutionpage + \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. When appropriate, the function should use milliseconds + 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} \lstinputlisting{../code/spikeraster.m} \lstinputlisting{../code/plotspikeraster.m} @@ -136,61 +142,55 @@ jan.benda@uni-tuebingen.de} \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. + \part Write a function that returns a single vector containing the + interspike intervals of all trials of spike times. \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. + \part Write a function that computes an estimate of the + probability density of interspike intervals from a vector of + interspike intervals. The function should automatically choose a + good bin width for the histogram. + + Write another function that plots the probability density of + interspike intervals given a vector of interspike intervals as + argument. The function should use the first function for computing + the probability density. 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{../code/isihist.m} - \lstinputlisting{../code/plotisih.m} + \lstinputlisting{../code/plotisihist.m} + \lstinputlisting{../code/plotisihs.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}$: + \part Write a function that computes and plots the serial + correlations of interspike intervals for lags upto + \code{maxlag}. The serial correlations $\rho_k$ for lag $k$ of the + interspike intervals $T_i$ are the correlation coefficients + between interspike intervals $T_i$ and the intervals $T_{i+k}$ + that are shifted 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)} = {\rm corr}(T_{i+k}, T_i) \] - Benutze diese Funktion, um die Interspikeintervall-Korrelationen - der drei Neurone zu vergleichen. + Use this function to compare the serial correlations of the + interspike intervals of the three neurons. \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} diff --git a/pointprocesses/lecture/pointprocessscetchA.eps b/pointprocesses/lecture/pointprocessscetchA.eps index 9e9aea9..cc32c7c 100644 --- a/pointprocesses/lecture/pointprocessscetchA.eps +++ b/pointprocesses/lecture/pointprocessscetchA.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchA.tex %%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Sat Nov 25 18:46:51 2017 +%%CreationDate: Mon Nov 27 21:08:10 2017 %%DocumentFonts: %%BoundingBox: 50 50 373 135 %%EndComments @@ -433,7 +433,7 @@ SDict begin [ /Author (jan) % /Producer (gnuplot) % /Keywords () - /CreationDate (Sat Nov 25 18:46:51 2017) + /CreationDate (Mon Nov 27 21:08:10 2017) /DOCINFO pdfmark end } ifelse diff --git a/pointprocesses/lecture/pointprocessscetchA.pdf b/pointprocesses/lecture/pointprocessscetchA.pdf index a648974..1aa1a36 100644 Binary files a/pointprocesses/lecture/pointprocessscetchA.pdf and b/pointprocesses/lecture/pointprocessscetchA.pdf differ diff --git a/pointprocesses/lecture/pointprocessscetchB.eps b/pointprocesses/lecture/pointprocessscetchB.eps index 5d9334b..68e83c4 100644 --- a/pointprocesses/lecture/pointprocessscetchB.eps +++ b/pointprocesses/lecture/pointprocessscetchB.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchB.tex %%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Sat Nov 25 18:46:51 2017 +%%CreationDate: Mon Nov 27 21:08:10 2017 %%DocumentFonts: %%BoundingBox: 50 50 373 237 %%EndComments @@ -433,7 +433,7 @@ SDict begin [ /Author (jan) % /Producer (gnuplot) % /Keywords () - /CreationDate (Sat Nov 25 18:46:51 2017) + /CreationDate (Mon Nov 27 21:08:10 2017) /DOCINFO pdfmark end } ifelse diff --git a/pointprocesses/lecture/pointprocessscetchB.pdf b/pointprocesses/lecture/pointprocessscetchB.pdf index dd6282c..ad9b8f9 100644 Binary files a/pointprocesses/lecture/pointprocessscetchB.pdf and b/pointprocesses/lecture/pointprocessscetchB.pdf differ diff --git a/statistics/exercises/exercises02.tex b/statistics/exercises/exercises02.tex index dc606e2..741c77e 100644 --- a/statistics/exercises/exercises02.tex +++ b/statistics/exercises/exercises02.tex @@ -11,11 +11,11 @@ \usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} \pagestyle{headandfoot} \ifprintanswers -\newcommand{\stitle}{: L\"osungen} +\newcommand{\stitle}{: Solutions} \else \newcommand{\stitle}{} \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: jan.benda@uni-tuebingen.de} \runningfooter{}{\thepage}{} @@ -78,8 +78,6 @@ jan.benda@uni-tuebingen.de} \newcommand{\extra}{--- bonus question ---\ \mbox{}} \newcommand{\code}[1]{\texttt{#1}} -\graphicspath{{../../pointprocesses/exercises/}} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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} \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{document} diff --git a/statistics/exercises/instructions.tex b/statistics/exercises/instructions.tex index ee005a3..3041d3e 100644 --- a/statistics/exercises/instructions.tex +++ b/statistics/exercises/instructions.tex @@ -1,6 +1,6 @@ -\vspace*{-6.5ex} +\vspace*{-7.8ex} \begin{center} -\textbf{\Large Introduction to scientific computing}\\[1ex] +\textbf{\Large Introduction to Scientific Computing}\\[2.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}