\documentclass[12pt,a4paper,pdftex]{exam}

\usepackage[german]{babel}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage[small]{caption}
\usepackage{sidecap}
\usepackage{pslatex}
\usepackage{amsmath}
\usepackage{amssymb}
\setlength{\marginparwidth}{2cm}
\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref}

%%%%% text size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}
\pagestyle{headandfoot} \header{{\bfseries\large Exercise
    }}{{\bfseries\large Time-dependent firing rate}}{{\bfseries\large December, 12, 2017}}
\firstpagefooter{Dr. Jan Grewe}{Phone: 29 74588}{Email:
  jan.grewe@uni-tuebingen.de} \runningfooter{}{\thepage}{}

\setlength{\baselineskip}{15pt}
\setlength{\parindent}{0.0cm}
\setlength{\parskip}{0.3cm}
\renewcommand{\baselinestretch}{1.15}

\newcommand{\code}[1]{\texttt{#1}}
\renewcommand{\solutiontitle}{\noindent\textbf{Solution}\par\noindent}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\begin{document}

\vspace*{-6.5ex}
\begin{center}
  \textbf{\Large Introduction to scientific computing.}\\[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}

\begin{questions}
  \question Plot the time-dependent firing rate of a neuron. Calculate
  the firing rate from the instantaneous firing rate (based on the
  interspike interval). Use the \code{lifoustim.mat}. The dataset
  contains three variables. 1st the spike times in different trials,
  2nd the stimulus, and 3rd the temporal resolution. The total
  duration of each trial amounts to 30 seconds.

  \begin{parts}
    \part{} Write a function that takes three arguments: the spike
    times of a single trial, the trial duration and the temporal
    resolution.  The function should return the time values and the
    firing rate in $Hz$.
    \part{} Write a script that applies the above function to estimate
    the firing rate of each trial. Plot a single individual responses
    and the average response as a function of time into the same plot.
    \part{} Extend your program that it saves the figure in a format
    according to the rules given by the \textit{Journal of
      Neuroscience}. This relates to the figure size and the
    fontsizes.
    \part{} Store the figure in pdf format.
  \end{parts}

  \question{} As before but use the binning method.

  \question{} Extend your script that it also plots the interspike
  interval histogram and the distribution of spike counts into
  separate figures. Save the figures to file using the pdf format.

  \question{} Some trials are different from the others.
  \begin{parts}
    \part{} Use the rasterplot to identify them. In which sense
    are they different from the others? Save the rasterplot in pdf
    format.
    \part{} Identify those trial in which the total spike count
    deviates more than $2\sigma$ from the average.
  \end{parts}
\end{questions}

\end{document}
