From 7ba1c83620cc66a082d5fa7fc398121b26d3a1a8 Mon Sep 17 00:00:00 2001 From: Jan Benda Date: Tue, 17 Dec 2019 18:58:02 +0100 Subject: [PATCH] [simulations] first text --- simulations/lecture/simulations-chapter.tex | 8 ---- simulations/lecture/simulations.tex | 42 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/simulations/lecture/simulations-chapter.tex b/simulations/lecture/simulations-chapter.tex index d5d2ed8..d723fec 100644 --- a/simulations/lecture/simulations-chapter.tex +++ b/simulations/lecture/simulations-chapter.tex @@ -18,12 +18,4 @@ \include{simulations} -\section{TODO} -\begin{itemize} -\item draw (and plot) random numbers -\item draw (and plot) random functions -\item euler forward, odeint -\item introduce derivatives which are also needed for fitting (move box from there here) -\end{itemize} - \end{document} diff --git a/simulations/lecture/simulations.tex b/simulations/lecture/simulations.tex index e19b324..2fe0ad0 100644 --- a/simulations/lecture/simulations.tex +++ b/simulations/lecture/simulations.tex @@ -4,15 +4,45 @@ \label{simulationschapter} \exercisechapter{Simulations} -Why simulations? - -- Understand basic concepts (as we do in the following chapters) -- Test your data analysis algorithms -- Explore -- Dynamical systems +The real power of computers for data analysis is the possibility to +run simulations. Experimental data of almost unlimited sample sizes +can be simulated in no time. This allows to explore basic concepts, +like the ones we introduce in the following chapters, with well +controlled data sets that are free of confounding pecularities of real +data sets. With simulated data we can also test our own analysis +functions. More importantly, by means of simulations we can explore +possible outcomes of our planned experiments before we even started +the experiment or we can explore possible results for regimes that we +cannot test experimentally. How dynamical systems, like predator-prey +interactions or the activity of neurons, evolve in time is a central +application for simulations. Only with the availability of computers +in the second half of the twentieth century was the exciting field of +nonlinear dynamical systems pushed forward. Conceptually, many kinds +of simulations are very simple and are implemented in a few lines of +code. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Univariate data} +The most basic simulation is to draw random numbers from a given +distribution. This simulates repeated measurements of some quantity +(e.g., weight of tigers or firing rate of a neuron). That is we take +samples from a statistical population. Doing so we must specify from +which probability distribution the data should originate from and what +are the parameters (i.e. mean, standard deviation, ...) of that +distribution. + +For drawing numbers from a normal distribution we use the +\code{randn()} function. This function returns normally distributed +numbers with zero mean and unit standard deviation. For changing the +standard deviation we need to multiply the returned data values with +the required standard deviation. For changing the mean we just add the +desired mean to the random numbers. +\begin{equation} + x_i = \mu + \sigma \xi_i +\end{equation} + + + draw (and plot) random numbers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%