\documentclass[addpoints,11pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}

\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/02/2015
  -- 11/05/2015}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{{\bf Supervisor:} Jan Grewe}
\runningfooter{}{}{}
\pointsinmargin
\bracketedpoints

%\printanswers
%\shadedsolutions


\begin{document}
%%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%%
\sffamily
% \begin{flushright}
% \gradetable[h][questions]
% \end{flushright}

\begin{center}
  \input{../disclaimer.tex}
\end{center}

%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Reverse reconstruction of the stimulus evoking neuronal responses.}
To analyse encoding properties of a neuron one often calculates the
Spike-Triggered-Average (STA).
\[ STA(\tau) = \frac{1}{\langle n \rangle} \left\langle
  \displaystyle\sum_{i=1}^{n}{s(t_i - \tau)} \right\rangle \] 

The STA is the average stimulus that led to a spike in the neuron and
can calculated by cutting out snippets form the stimulus centered on
the respective spike time. The Spike-Triggered-Average can be used to
reconstruct the stimulus a neuron has been stimulated with.

\begin{questions}
  \question In the accompanying files you find the spike responses of
  P-units and pyramidal neurons of the weakly electric fish
  \textit{Apteronotus leptorhynchus}. The respective stimuli are
  stored in separate files. The data is sampled with 20\,kHz temporal
  resolution and spike times are given in seconds. Start with the
  P-unit and, in the end, apply the same functions to the pyramidal
  data.
  \begin{parts}
    \part Estimate the STA and plot it.
    \part Implement a function that does the reconstruction of the
    stimulus using the STA.
    \part Implement a function that estimates the reconstruction 
    error using the mean-square-error and express it relative to the
    variance of the original stimulus.
    \begin{equation}
      err = \frac{1}{N} \cdot \displaystyle\sum^{N}_{i=1}(x_i - \bar{x})^2,
    \end{equation}
    with $N$ the number of data points, $x_i$ the current value and
    $\bar{x}$, the average of all $x$.
    \part Analyze the robustness of the reconstruction: Estimate 
    the STA with less and less data and estimate the reconstruction
    error.
    \part Plot the reconstruction error as a function of the data 
    amount used to estimate the STA.
    \part Repeat the above steps for the pyramidal neuron, what do you
    observe?
  \end{parts}
\end{questions}

\end{document}
