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

This commit is contained in:
Jan Grewe 2014-10-31 20:12:19 +01:00
commit 9721f06ec3
16 changed files with 1687 additions and 89 deletions

View File

@ -8,30 +8,34 @@
\vspace{.5cm}
The {\bf code} and the {\bf presentation} should be uploaded to
ILIAS before the presentations start on Thursday. Everything
should be bundeled into a {\em single} zip-file. The
presentation should be handed in as pdf.
ILIAS at latest on Thursday, November 6th, 12:00h.
The presentations start on Thursday 13:00h. Please hand in
your presentation as a pdf file. Bundle everything into a
{\em single} zip-file.
\vspace{.5cm}
The {\bf code} should be exectuable without any further
adjustments from us. This means that you should include all
adjustments from us. This means that you need to include all
additional functions you wrote and the data into the
zip-file. The {\em main script} should produce the same {\em
figures} that you use in your slides. The figures should follow
the guidelines for proper plotting as discussed in the first
statistics lecture. The code should be properly commented and
comprehensible by third persons (use proper and consistent
zip-file. A single {\em main script} should produce the same
{\em figures} that you use in your slides. The figures should
follow the guidelines for proper plotting as discussed in the
first statistics lecture. The code should be properly commented
and comprehensible by third persons (use proper and consistent
variable names).
\vspace{.5cm} \textbf{Please write your name and matriculation
number as a comment at the top of a script called \texttt{main.m}!}
The \texttt{main.m} script then should call all your scripts.
\vspace{.5cm}
The {\bf slides} should be handed in along with the code and in
pdf format. We will store them all on one computer to allow fast
transitions between talks. The {\bf presentation} itself should
be {\em at most} 10min long and be held in English. In the
presentation you should (i) briefly describe the problem, (ii)
explain how you solved it algorithmically (don't show your
entire code), and (iii) present figures showing your results.
The {\bf presentation} should be {\em at most} 10min long and be
held in English. In the presentation you should (i) briefly
describe the problem, (ii) explain how you solved it
algorithmically (don't show your entire code), and (iii) present
figures showing your results. We will store all presentations on
one computer to allow fast transitions between talks.
}}

View File

@ -1,11 +0,0 @@
latex:
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
clean:
rm -rf *.log *.aux *.zip *.out auto *.bbl *.blg
rm -f `basename *.tex .tex`.pdf
zip: latex
zip `basename *.tex .tex`.zip *.pdf *.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 915 KiB

View File

@ -1,61 +0,0 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
-- 11/06/2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\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 %%%%%%%%%%%%%%%%%%%%%%%%%
In you zip file you find a natural image called {\tt natimg.jpg}.
\begin{questions}
\question Load the image and extract all pixels as three dimensional
vectors (red, green, and blue channel).
\question Perform a principal component analysis on these
three-dimensional vectors.
\question Try to find a interpretation of the principal components
you find in terms of colors. Find a good way to visualize this.
\question What could be the biological significance of that (\cite{BG} can
give you a clue)?
\end{questions}
\begin{thebibliography}{1}
\bibitem{BG} Buchsbaum, G., \& Gottschalk, A. (1983). Trichromacy,
opponent colours coding and optimum colour information transmission
in the retina. Proceedings of the Royal Society of London. Series B,
Containing Papers of a Biological Character. Royal Society (Great
Britain), 220(1218), 89113.
\end{thebibliography}
\end{document}

Binary file not shown.

View File

@ -0,0 +1,10 @@
latex:
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
clean:
rm -rf *.log *.aux *.zip *.out auto
rm -f `basename *.tex .tex`.pdf
zip: latex
zip `basename *.tex .tex`.zip *.pdf *.dat *.mat

61
projects/project_eod/eod.tex Executable file
View File

@ -0,0 +1,61 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
-- 11/06/2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\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 %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
\question In the data file {\tt EOD\_data.mat} you find a time trace
and the {\em electric organ discharge (EOD)} of a weakly electric
fish {\em Apteronotus leptorhynchus}.
\begin{parts}
\part Load and plot the data in an appropriate way. Time is in
seconds and the voltage is in mV/cm.
\part Fit the following curve to the eod (select a smaller time
window for fitting, not the entire trace) using least squares:
$$f_{\omega_0,b_0,\varphi_1, ...,\varphi_n}(t) = b_0 +
\sum_{j=1}^n \sin(2\pi j\omega_0\cdot t + \varphi_j ).$$
$\omega_0$ is called {\em fundamental frequency}. The single terms
$\sin(2\pi j\omega_0\cdot t + \varphi_j )$ are called {\em
harmonic components}. The variables $\varphi_j$ are called {\em
phases}. For the beginning choose $n=3$.
\part Play around with $n$ and see how the fit changes. Plot the
fits and the original curve for different choices of $n$. If you
want you can also play the different fits and the original as
sound.
\end{parts}
\end{questions}
\end{document}

View File

@ -0,0 +1,10 @@
latex:
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
clean:
rm -rf *.log *.aux *.zip *.out auto
rm -f `basename *.tex .tex`.pdf
zip: latex
zip `basename *.tex .tex`.zip *.pdf *.dat *.mat

View File

@ -0,0 +1,66 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
-- 11/06/2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\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 %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
\question The Fano factor $\frac{\sigma^2}{\mu}$ is a common measure
in neural coding because a Poisson process---for which each spike is
independent of every other---has a Fano factor of one.
The table contains spike counts from a neuron measured in twelve
trials.
\begin{center}
\begin{tabular}{cccc}
\multicolumn{4}{c}{\bf number of spikes} \\ \hline\\
36.00 & 28.00 & 38.00 & 35.00\\
32.00 & 30.00 & 35.00 & 29.00\\
29.00 & 24.00 & 26.00 & 34.00
\end{tabular}
\end{center}
\begin{parts}
\part Use {\em Eden, U. T., \& Kramer, M. (2010). Drawing
inferences from Fano factor calculations. Journal of
neuroscience methods, 190(1), 149--152} to construct a test that
uses the Fano factor as test statistic and tests against the Null
hypothesis that the spike counts come from a Poisson process.
\part Plot the spike counts appropriately.
\part Implement the test and use that it on the data above.
\end{parts}
\end{questions}
\end{document}

View File

@ -0,0 +1,10 @@
latex:
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
clean:
rm -rf *.log *.aux *.zip *.out auto
rm -f `basename *.tex .tex`.pdf
zip: latex
zip `basename *.tex .tex`.zip *.pdf *.dat *.mat

Binary file not shown.

View File

@ -0,0 +1,66 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
-- 11/06/2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\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 %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
\question A subject was presented two possible objects for a very
brief time ($50$ms). The task of the subject was to report which of
the two objects was shown. In {\tt decisions.mat} you find an array
that stores which object was presented in each trial and which
object was reported by the subject.
\begin{parts}
\part Plot the data appropriately.
\part Compute a 2-d histogram that shows how often different
combinations of reported and presented came up.
\part Normalize the histogram such that it sums to one (i.e. make
it a probability distribution $P(x,y)$ where $x$ is the presented
object and $y$ is the reported object). Compute the probability
distributions $P(x)$ and $P(y)$ in the same way.
\part Use that probability distribution to compute the mutual
information $$I[x:y] = \sum_{x\in\{1,2\}}\sum_{y\in\{1,2\}} P(x,y)
\log_2\frac{P(x,y)}{P(x)P(y)}$$ that the answers provide about the
actually presented object.
\part What is the maximally achievable mutual information (try to
find out by generating your own dataset; the situation in which
the information is maximal is pretty straightforward)?
\part Use bootstrapping to compute the $95\%$ confidence interval
for the mutual information estimate in that dataset.
\end{parts}
\end{questions}
\end{document}

View File

@ -0,0 +1,10 @@
latex:
pdflatex *.tex > /dev/null
pdflatex *.tex > /dev/null
clean:
rm -rf *.log *.aux *.zip *.out auto
rm -f `basename *.tex .tex`.pdf
zip: latex
zip `basename *.tex .tex`.zip *.pdf *.dat *.mat

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
\documentclass[addpoints,10pt]{exam}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
\pagestyle{headandfoot}
\runningheadrule
\firstpageheadrule
\firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014
-- 11/06/2014}
%\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014}
\firstpagefooter{}{}{}
\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 %%%%%%%%%%%%%%%%%%%%%%%%%
\begin{questions}
\question The p-value corresponds to the probability
$$P(\mbox{result seems significant}| H_0 \mbox{is true}).$$
This means that if your significance threshold is $\alpha=0.05$ and
you accept all test with $p \le \alpha$ as significant, then $5\%$
of all cases in which $H_0$ was true (there was no effect) your test
will appear significant (false positive).
The problem with that is that you do not know for how many of the
tests $H_0$ is actually true. What you really would like to know is:
From all those tests that came out significant ($p\le\alpha$) how
many of them are false positives? This probability corresponds to
$$P(H_0 \mbox{is true}|\mbox{result seems significant})$$ and is
called {\em false discovery rate}. In general you cannot compute
it. However, if you have many p-values, then you can actually
estimate it. The corresponding ``p-value'' for the false discovery
rate is called ``q-value''.
In the paper
{\em Storey, J. D., \& Tibshirani, R. (2003). Statistical
significance for genomewide studies. Proceedings of the National
Academy of Sciences of the United States of America, 100,
94409445. doi:10.1073/pnas.1530509100}
you can find an algorithm how to compute q-values from p-values.
The attached data file {\tt p\_values.dat} contains p-values from
test of several neurons whether they respond to a certain stimulus
condition or not.
\begin{parts}
\part Plot a histogram of the p-values.
\part Read and understand the paper by Storey and
Tibshirani. Visualize their method at your histogram.
\part Implement their method and convert each p-value to a
q-value.
\part From running the script, estimate the proportion of neurons
that show a true effect (i.e. $P(H_A)$).
\end{parts}
\end{questions}
\end{document}

View File

@ -3,7 +3,7 @@ latex:
pdflatex *.tex > /dev/null
clean:
rm -f *.log *.aux *.zip *.out auto
rm -rf *.log *.aux *.zip *.out auto
rm -f `basename *.tex .tex`.pdf
zip: latex