updated statistics exercise instructions

This commit is contained in:
2020-12-07 19:21:17 +01:00
parent b67ceae781
commit 08382f94d4
7 changed files with 379 additions and 161 deletions

View File

@@ -15,7 +15,7 @@
\else
\newcommand{\stitle}{}
\fi
\header{{\bfseries\large Exercise 8\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large December 2nd, 2019}}
\header{{\bfseries\large Exercise 7\stitle}}{{\bfseries\large Statistics}}{{\bfseries\large December 8th, 2020}}
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
jan.benda@uni-tuebingen.de}
\runningfooter{}{\thepage}{}
@@ -97,12 +97,13 @@ jan.benda@uni-tuebingen.de}
\item Initially test computationally expensive \code{for} loops, vectors,
matrices, etc. with small numbers of repetitions and/or
sizes. Once it is working use large repetitions and/or sizes for
getting a good statistics.
getting a good statistics, i.e. smooth curves.
\item Use the help functions of \code{matlab} (\code{help command} or
\code{doc command}) and the internet to figure out how specific
\code{matlab} functions are used and what features they offer. In
addition, the internet offers a lot of material and suggestions for
any question you have regarding your code !
\item Work in groups! Nevertheless everybody should write down his/her own solution.
\item Please upload your solution to the exercises to ILIAS as a zip-archive with the name
``statistics\_\{last name\}\_\{first name\}.zip''.
\end{itemize}

View File

@@ -15,7 +15,7 @@ ax1.set_xticks(range(1, 7))
ax1.set_xlabel('x')
ax1.set_ylim(0, 98)
ax1.set_ylabel('Frequency')
fs = fsC
fs = dict(**fsC)
fs['color'] = [fsC['facecolor'], fsE['facecolor']]
del fs['facecolor']
ax1.hist([x2, x1], bins, **fs)
@@ -26,9 +26,11 @@ ax2.set_xlabel('x')
ax2.set_ylim(0, 0.23)
ax2.set_ylabel('Probability')
ax2.plot([0.2, 6.8], [1.0/6.0, 1.0/6.0], zorder=-10, **lsAm)
if mpl_major > 1:
ax2.hist([x2, x1], bins, density=True, zorder=-5, **fs)
else:
ax2.hist([x2, x1], bins, normed=True, zorder=-5, **fs)
h1, b1 = np.histogram(x1, bins)
h2, b2 = np.histogram(x2, bins)
h1 = h1/np.sum(h1)
h2 = h2/np.sum(h2)
ax2.bar(b1[:-1]+0.3, h1, zorder=-5, width=0.4, **fsC)
ax2.bar(b2[:-1]+0.7, h2, zorder=-5, width=0.4, **fsE)
fig.subplots_adjust(left=0.125)
fig.savefig('diehistograms.pdf')