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

\newcommand{\ptitle}{F-I curves}
\input{../header.tex}
\firstpagefooter{Supervisor: Jan Grewe}{phone: 29 74588}%
{email: jan.grewe@uni-tuebingen.de}

\begin{document}

\input{../instructions.tex}


%%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%%
\section{Quantifying the responsiveness of a neuron using the F-I curve}
The responsiveness of a neuron is often quantified using an F-I
curve. The F-I curve plots the \textbf{F}iring rate of the neuron as a
function of the stimulus \textbf{I}ntensity.

 In the accompanying datasets you find the \textit{spike\_times} of an
 P-unit electroreceptor of the weakly electric fish
 \textit{Apteronotus leptorhynchus} to a stimulus of a certain
 intensity, i.e. the \textit{contrast}. The spike times are given in
 milliseconds relative to the stimulus onset.

\begin{questions}
  \question{Estimate the FI-curce for the onset and the steady state response.}
  \begin{parts}
    \part Estimate for each stimulus intensity the average response
    (PSTH) and plot it. You will see that there are three parts.  (i)
    The first 200\,ms is the baseline (no stimulus) activity. (ii)
    During the next 1000\,ms the stimulus was switched on. (iii) After
    stimulus offset the neuronal activity was recorded for further
    825\,ms.

    \part Extract the neuron's activity in a 50\,ms time window immediately
    after stimulus onset (onset response) and 50\,ms before stimulus offset (steady state response).

    For each plot the resulting F-I curve by plotting the
    computed firing rates against the corresponding stimulus
    intensity, respectively the contrast.

  \end{parts}

  \question{} Fit a Boltzmann function to each of the F-I-curves. The
    Boltzmann function is a sigmoidal function and is defined as
    \begin{equation}
       f(x) = \frac{\alpha-\beta}{1+e^{-k(x-x_0)}}+\beta \; .
    \end{equation}
    $x$ is the stimulus intensity, $\alpha$ is the starting
    firing rate, $\beta$ the saturation firing rate, $x_0$ defines the
    position of the sigmoid, and $k$ (together with $\alpha-\beta$)
    sets the slope.

    \begin{parts}
      \part{} Before you do the fitting, familiarize yourself with the four
      parameters of the Boltzmann function. What is its value for very
      large or very small stimulus intensities? How does the Boltzmann
      function change if you change the parameters?

      \part{} Can you get good initial estimates for the parameters?
      \part{} Do the fits and show the resulting Boltzmann functions together
      with the corresponding data.

      \part{} Illustrate how fit to the F-I curves changes during the fitting
      process. You can plot the parameters as a function fit iterations.
      Which parameter stay the same, which ones change with time?

      Support your conclusion with appropriate statistical tests.

      \part{} Discuss you results with respect to encoding of different
      stimulus intensities.
  \end{parts}
\end{questions}

\end{document}
