Merge branch 'master' of whale.am28.uni-tuebingen.de:scientificComputing

This commit is contained in:
Jan Grewe 2018-02-07 09:31:31 +01:00
commit 8f47b06571
36 changed files with 116 additions and 95 deletions

View File

@ -0,0 +1,43 @@
% fake some data
x_data = 0:2*pi/10:2*pi;
sym_data = sin(repmat(x_data, 10,1)) * 0.75 + (randn(10, length(x_data)) .* cos(repmat(x_data, 10,1)));
asym_data = sin(repmat(x_data, 10,1)) * 0.75 + (randn(10, length(x_data)) .* cos(repmat(x_data, 10,1)) + 0.5);
% get some data characteristics
avg_sym = mean(sym_data, 1);
err_sym = std(sym_data, [], 1);
avg_asym = median(asym_data, 1);
err_upper_asym = prctile(asym_data, 75, 1);
err_lower_asym = prctile(asym_data, 25, 1);
fig = figure();
set(fig, 'paperunits', 'centimeters', 'papersize', [15 6.5], ...
'paperposition', [0.0 0.0 15, 6.5], 'color', 'white')
subplot(1,3,1)
errorbar(x_data, avg_sym, err_sym, 'marker', 'o')
xlim([-.5, 6.5])
xlabel('x-data')
ylabel('y-data')
box('off')
subplot(1,3,2)
errorbar(x_data, avg_asym, err_lower_asym, err_upper_asym, 'marker', 'o')
xlim([-.5, 6.5])
yticklabels([])
xlabel('x-data')
box('off')
subplot(1,3,3)
hold on
p = fill(cat(2, x_data, fliplr(x_data)), ...
cat(2, avg_sym - err_sym, fliplr(avg_sym + err_sym)), ...
'b');
p.FaceAlpha = 0.125;
p.EdgeColor = 'w';
xlim([-.5, 6.5])
yticklabels([])
box('off')
xlabel('x-data')
plot(x_data, avg_sym, 'b', 'linewidth', 1.)
saveas(fig, '../lecture/images/errorbars', 'pdf')

Binary file not shown.

View File

@ -0,0 +1,73 @@
\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 by its F-I curves}
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.
\begin{questions}
\question 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{parts}
\part For each stimulus intensity estimate 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 for every 50\,ms after
stimulus onset and for one 50\,ms slice before stimulus onset.
For each time slice plot the resulting F-I curve by plotting the
computed firing rates against the corresponding stimulus
intensity, respectively the contrast.
\part 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.
Before you do the fitting, familiarize yourself with the four
parameter 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 either of the parameter?
How could you get good initial estimates for the parameter?
Do the fits and show the resulting Boltzmann functions together
with the corresponding data.
\part Illustrate how the F-I curves change in time also by means
of the parameter you obtained from the fits with the Boltzmann
function.
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}

View File

@ -1,47 +0,0 @@
\documentclass[a4paper,12pt,pdftex]{exam}
\newcommand{\ptitle}{Onset f-I curve}
\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 by its 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.
\begin{questions}
\question 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{parts}
\part For each stimulus intensity estimate 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 the first 50\,ms after
stimulus onset and plot it against the stimulus intensity,
respectively the contrast, in an appropriate way.
\part Fit a Boltzmann function to the FI-curve. The Boltzmann function
is defined as:
\begin{equation}
y=\frac{\alpha-\beta}{1+e^{(x-x_0)/\Delta x}}+\beta,
\end{equation}
where $\alpha$ is the starting firing rate, $\beta$ the saturation
firing rate, $x$ the current stimulus intensity, $x_0$ starting
stimulus intensity, and $\Delta x$ a measure of the slope.
\part Plot the fit into the data.
\end{parts}
\end{questions}
\end{document}

View File

@ -1,3 +0,0 @@
ZIPFILES=
include ../project.mk

View File

@ -1,45 +0,0 @@
\documentclass[a4paper,12pt,pdftex]{exam}
\newcommand{\ptitle}{Steady-state f-I curve}
\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.
\begin{questions}
\question In the accompanying datasets you find the
\textit{spike\_times} of an P-unit electrorecptor of the weakly
electric fish \textit{Apteronotus leptorhynchus} to a stimulus of a
certain intensity, i.e. the \textit{contrast}. The contrast is also
part of the file name itself.
\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 the last 200 ms before
stimulus offset and plot it against the stimulus intensity or the
contrast, respectively.
\part Fit a Boltzmann function to the FI-curve. The Boltzmann function
is defined as:
\begin{equation}
y=\frac{\alpha-\beta}{1+e^{(x-x_0)/\Delta x}}+\beta,
\end{equation}
where $\alpha$ is the starting firing rate, $\beta$ the saturation
firing rate, $x$ the current stimulus intensity, $x_0$ starting
stimulus intensity, and $\Delta x$ a measure of the slope.
\end{parts}
\end{questions}
\end{document}