reorganized statistics exercises
This commit is contained in:
parent
bd62a15593
commit
778fde35fa
bootstrap/exercises
MakefileUT_WBMW_Black_RGB.pdfbootstrapmean.mbootstraptymus-datahist.pdfbootstraptymus-meanhist.pdfbootstraptymus-samples.pdfbootstraptymus.mcorrelationsignificance.mcorrelationsignificance.pdfexercises01.texinstructions.texsavefigpdf.mtdistribution-n03.pdftdistribution-n05.pdftdistribution-n10.pdftdistribution-n50.pdftdistribution.mthymusglandweights.dat
likelihood
exercises
MakefileUT_WBMW_Black_RGB.pdfexercises01.texinstructions.texmlepdffit.mmlepdffit.pdfmlepropfit.mmlepropfit.pdfmleslope.mmlestd.mmlestd.pdfsavefigpdf.m
lecture
statistics/exercises
34
bootstrap/exercises/Makefile
Normal file
34
bootstrap/exercises/Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
TEXFILES=$(wildcard exercises??.tex)
|
||||
EXERCISES=$(TEXFILES:.tex=.pdf)
|
||||
SOLUTIONS=$(EXERCISES:exercises%=solutions%)
|
||||
|
||||
.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean
|
||||
|
||||
pdf : $(SOLUTIONS) $(EXERCISES)
|
||||
|
||||
exercises : $(EXERCISES)
|
||||
|
||||
solutions : $(SOLUTIONS)
|
||||
|
||||
$(SOLUTIONS) : solutions%.pdf : exercises%.tex instructions.tex
|
||||
{ echo "\\documentclass[answers,12pt,a4paper,pdftex]{exam}"; sed -e '1d' $<; } > $(patsubst %.pdf,%.tex,$@)
|
||||
pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) || true
|
||||
rm $(patsubst %.pdf,%,$@).[!p]*
|
||||
|
||||
$(EXERCISES) : %.pdf : %.tex instructions.tex
|
||||
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
|
||||
|
||||
watch :
|
||||
while true; do ! make -q pdf && make pdf; sleep 0.5; done
|
||||
|
||||
watchexercises :
|
||||
while true; do ! make -q exercises && make exercises; sleep 0.5; done
|
||||
|
||||
watchsolutions :
|
||||
while true; do ! make -q solutions && make solutions; sleep 0.5; done
|
||||
|
||||
clean :
|
||||
rm -f *~ *.aux *.log *.out
|
||||
|
||||
cleanup : clean
|
||||
rm -f $(SOLUTIONS) $(EXERCISES)
|
BIN
bootstrap/exercises/UT_WBMW_Black_RGB.pdf
Normal file
BIN
bootstrap/exercises/UT_WBMW_Black_RGB.pdf
Normal file
Binary file not shown.
41
bootstrap/exercises/instructions.tex
Normal file
41
bootstrap/exercises/instructions.tex
Normal file
@ -0,0 +1,41 @@
|
||||
\vspace*{-6.5ex}
|
||||
\begin{center}
|
||||
\textbf{\Large Einf\"uhrung in die wissenschaftliche Datenverarbeitung}\\[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}
|
||||
|
||||
\ifprintanswers%
|
||||
\else
|
||||
|
||||
% Die folgenden Aufgaben dienen der Wiederholung, \"Ubung und
|
||||
% Selbstkontrolle und sollten eigenst\"andig bearbeitet und gel\"ost
|
||||
% werden. Die L\"osung soll in Form eines einzelnen Skriptes (m-files)
|
||||
% im ILIAS hochgeladen werden. Jede Aufgabe sollte in einer eigenen
|
||||
% ``Zelle'' gel\"ost sein. Die Zellen \textbf{m\"ussen} unabh\"angig
|
||||
% voneinander ausf\"uhrbar sein. Das Skript sollte nach dem Muster:
|
||||
% ``variablen\_datentypen\_\{nachname\}.m'' benannt werden
|
||||
% (z.B. variablen\_datentypen\_mueller.m).
|
||||
|
||||
\begin{itemize}
|
||||
\item \"Uberzeuge dich von jeder einzelnen Zeile deines Codes, dass
|
||||
sie auch wirklich das macht, was sie machen soll! Teste dies mit
|
||||
kleinen Beispielen direkt in der Kommandozeile.
|
||||
\item Versuche die L\"osungen der Aufgaben m\"oglichst in
|
||||
sinnvolle kleine Funktionen herunterzubrechen.
|
||||
Sobald etwas \"ahnliches mehr als einmal berechnet werden soll,
|
||||
lohnt es sich eine Funktion daraus zu schreiben!
|
||||
\item Teste rechenintensive \code{for} Schleifen, Vektoren, Matrizen
|
||||
zuerst mit einer kleinen Anzahl von Wiederholungen oder kleiner
|
||||
Gr\"o{\ss}e, und benutze erst am Ende, wenn alles \"uberpr\"uft
|
||||
ist, eine gro{\ss}e Anzahl von Wiederholungen oder Elementen, um eine gute
|
||||
Statistik zu bekommen.
|
||||
\item Benutze die Hilfsfunktion von \code{matlab} (\code{help
|
||||
commando} oder \code{doc commando}) und das Internet, um
|
||||
herauszufinden, wie bestimmte \code{matlab} Funktionen zu verwenden
|
||||
sind und was f\"ur M\"oglichkeiten sie bieten.
|
||||
Auch zu inhaltlichen Konzepten bietet das Internet oft viele
|
||||
Antworten!
|
||||
\end{itemize}
|
||||
|
||||
\fi
|
28
bootstrap/exercises/savefigpdf.m
Normal file
28
bootstrap/exercises/savefigpdf.m
Normal file
@ -0,0 +1,28 @@
|
||||
function savefigpdf( fig, name, width, height )
|
||||
% Saves figure fig in pdf file name.pdf with appropriately set page size
|
||||
% and fonts
|
||||
|
||||
% default width:
|
||||
if nargin < 3
|
||||
width = 11.7;
|
||||
end
|
||||
% default height:
|
||||
if nargin < 4
|
||||
height = 9.0;
|
||||
end
|
||||
|
||||
% paper:
|
||||
set( fig, 'PaperUnits', 'centimeters' );
|
||||
set( fig, 'PaperSize', [width height] );
|
||||
set( fig, 'PaperPosition', [0.0 0.0 width height] );
|
||||
set( fig, 'Color', 'white')
|
||||
|
||||
% font:
|
||||
set( findall( fig, 'type', 'axes' ), 'FontSize', 12 )
|
||||
set( findall( fig, 'type', 'text' ), 'FontSize', 12 )
|
||||
|
||||
% save:
|
||||
saveas( fig, name, 'pdf' )
|
||||
|
||||
end
|
||||
|
34
likelihood/exercises/Makefile
Normal file
34
likelihood/exercises/Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
TEXFILES=$(wildcard exercises??.tex)
|
||||
EXERCISES=$(TEXFILES:.tex=.pdf)
|
||||
SOLUTIONS=$(EXERCISES:exercises%=solutions%)
|
||||
|
||||
.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean
|
||||
|
||||
pdf : $(SOLUTIONS) $(EXERCISES)
|
||||
|
||||
exercises : $(EXERCISES)
|
||||
|
||||
solutions : $(SOLUTIONS)
|
||||
|
||||
$(SOLUTIONS) : solutions%.pdf : exercises%.tex instructions.tex
|
||||
{ echo "\\documentclass[answers,12pt,a4paper,pdftex]{exam}"; sed -e '1d' $<; } > $(patsubst %.pdf,%.tex,$@)
|
||||
pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) || true
|
||||
rm $(patsubst %.pdf,%,$@).[!p]*
|
||||
|
||||
$(EXERCISES) : %.pdf : %.tex instructions.tex
|
||||
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
|
||||
|
||||
watch :
|
||||
while true; do ! make -q pdf && make pdf; sleep 0.5; done
|
||||
|
||||
watchexercises :
|
||||
while true; do ! make -q exercises && make exercises; sleep 0.5; done
|
||||
|
||||
watchsolutions :
|
||||
while true; do ! make -q solutions && make solutions; sleep 0.5; done
|
||||
|
||||
clean :
|
||||
rm -f *~ *.aux *.log *.out
|
||||
|
||||
cleanup : clean
|
||||
rm -f $(SOLUTIONS) $(EXERCISES)
|
BIN
likelihood/exercises/UT_WBMW_Black_RGB.pdf
Normal file
BIN
likelihood/exercises/UT_WBMW_Black_RGB.pdf
Normal file
Binary file not shown.
41
likelihood/exercises/instructions.tex
Normal file
41
likelihood/exercises/instructions.tex
Normal file
@ -0,0 +1,41 @@
|
||||
\vspace*{-6.5ex}
|
||||
\begin{center}
|
||||
\textbf{\Large Einf\"uhrung in die wissenschaftliche Datenverarbeitung}\\[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}
|
||||
|
||||
\ifprintanswers%
|
||||
\else
|
||||
|
||||
% Die folgenden Aufgaben dienen der Wiederholung, \"Ubung und
|
||||
% Selbstkontrolle und sollten eigenst\"andig bearbeitet und gel\"ost
|
||||
% werden. Die L\"osung soll in Form eines einzelnen Skriptes (m-files)
|
||||
% im ILIAS hochgeladen werden. Jede Aufgabe sollte in einer eigenen
|
||||
% ``Zelle'' gel\"ost sein. Die Zellen \textbf{m\"ussen} unabh\"angig
|
||||
% voneinander ausf\"uhrbar sein. Das Skript sollte nach dem Muster:
|
||||
% ``variablen\_datentypen\_\{nachname\}.m'' benannt werden
|
||||
% (z.B. variablen\_datentypen\_mueller.m).
|
||||
|
||||
\begin{itemize}
|
||||
\item \"Uberzeuge dich von jeder einzelnen Zeile deines Codes, dass
|
||||
sie auch wirklich das macht, was sie machen soll! Teste dies mit
|
||||
kleinen Beispielen direkt in der Kommandozeile.
|
||||
\item Versuche die L\"osungen der Aufgaben m\"oglichst in
|
||||
sinnvolle kleine Funktionen herunterzubrechen.
|
||||
Sobald etwas \"ahnliches mehr als einmal berechnet werden soll,
|
||||
lohnt es sich eine Funktion daraus zu schreiben!
|
||||
\item Teste rechenintensive \code{for} Schleifen, Vektoren, Matrizen
|
||||
zuerst mit einer kleinen Anzahl von Wiederholungen oder kleiner
|
||||
Gr\"o{\ss}e, und benutze erst am Ende, wenn alles \"uberpr\"uft
|
||||
ist, eine gro{\ss}e Anzahl von Wiederholungen oder Elementen, um eine gute
|
||||
Statistik zu bekommen.
|
||||
\item Benutze die Hilfsfunktion von \code{matlab} (\code{help
|
||||
commando} oder \code{doc commando}) und das Internet, um
|
||||
herauszufinden, wie bestimmte \code{matlab} Funktionen zu verwenden
|
||||
sind und was f\"ur M\"oglichkeiten sie bieten.
|
||||
Auch zu inhaltlichen Konzepten bietet das Internet oft viele
|
||||
Antworten!
|
||||
\end{itemize}
|
||||
|
||||
\fi
|
28
likelihood/exercises/savefigpdf.m
Normal file
28
likelihood/exercises/savefigpdf.m
Normal file
@ -0,0 +1,28 @@
|
||||
function savefigpdf( fig, name, width, height )
|
||||
% Saves figure fig in pdf file name.pdf with appropriately set page size
|
||||
% and fonts
|
||||
|
||||
% default width:
|
||||
if nargin < 3
|
||||
width = 11.7;
|
||||
end
|
||||
% default height:
|
||||
if nargin < 4
|
||||
height = 9.0;
|
||||
end
|
||||
|
||||
% paper:
|
||||
set( fig, 'PaperUnits', 'centimeters' );
|
||||
set( fig, 'PaperSize', [width height] );
|
||||
set( fig, 'PaperPosition', [0.0 0.0 width height] );
|
||||
set( fig, 'Color', 'white')
|
||||
|
||||
% font:
|
||||
set( findall( fig, 'type', 'axes' ), 'FontSize', 12 )
|
||||
set( findall( fig, 'type', 'text' ), 'FontSize', 12 )
|
||||
|
||||
% save:
|
||||
saveas( fig, name, 'pdf' )
|
||||
|
||||
end
|
||||
|
@ -18,6 +18,11 @@
|
||||
|
||||
\section{TODO}
|
||||
\begin{itemize}
|
||||
\item Fitting psychometric functions:
|
||||
Variable $x_i$, responses $r_i$ either 0 or 1.
|
||||
$p(x_i, \theta)$ is Weibull or Boltzmann function.
|
||||
Likelihood is $L = \prod p(x_i, \theta)^{r_i} (1-p(x_i, \theta))^{1-r_i}$.
|
||||
Use fminsearch for fitting.
|
||||
\item GLM model fitting?
|
||||
\end{itemize}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
TEXFILES=$(wildcard statistics??.tex)
|
||||
TEXFILES=$(wildcard exercises??.tex)
|
||||
EXERCISES=$(TEXFILES:.tex=.pdf)
|
||||
SOLUTIONS=$(EXERCISES:statistics%=solutions%)
|
||||
SOLUTIONS=$(EXERCISES:exercises%=solutions%)
|
||||
|
||||
.PHONY: pdf exercises solutions watch watchexercises watchsolutions clean
|
||||
|
||||
@ -10,7 +10,7 @@ exercises : $(EXERCISES)
|
||||
|
||||
solutions : $(SOLUTIONS)
|
||||
|
||||
$(SOLUTIONS) : solutions%.pdf : statistics%.tex instructions.tex
|
||||
$(SOLUTIONS) : solutions%.pdf : exercises%.tex instructions.tex
|
||||
{ echo "\\documentclass[answers,12pt,a4paper,pdftex]{exam}"; sed -e '1d' $<; } > $(patsubst %.pdf,%.tex,$@)
|
||||
pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $(patsubst %.pdf,%.tex,$@) || true
|
||||
rm $(patsubst %.pdf,%,$@).[!p]*
|
||||
|
Reference in New Issue
Block a user