diff --git a/likelihood/lecture/likelihood.tex b/likelihood/lecture/likelihood.tex index 7a39a77..dd1f695 100644 --- a/likelihood/lecture/likelihood.tex +++ b/likelihood/lecture/likelihood.tex @@ -211,7 +211,7 @@ cost function, e.g. the gradient descent \matlabfun{lsqcurvefit()}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\section{Fits von Wahrscheinlichkeitsverteilungen} +\section{Fitting probability distributions} Finally let's consider the case in which we want to fit the parameters of a probability density function (e.g. the shape parameter of a \enterm{Gamma-distribution}) to a dataset. diff --git a/plotting/exercises/UT_WBMW_Black_RGB.pdf b/plotting/exercises/UT_WBMW_Black_RGB.pdf new file mode 100644 index 0000000..9aed921 Binary files /dev/null and b/plotting/exercises/UT_WBMW_Black_RGB.pdf differ diff --git a/plotting/exercises/exercises.tex b/plotting/exercises/exercises.tex new file mode 100644 index 0000000..ca715f5 --- /dev/null +++ b/plotting/exercises/exercises.tex @@ -0,0 +1,213 @@ +\documentclass[12pt,a4paper,pdftex]{exam} + +\usepackage[german]{babel} +\usepackage{pslatex} +\usepackage[mediumspace,mediumqspace,Gray]{SIunits} % \ohm, \micro +\usepackage{xcolor} +\usepackage{graphicx} +\usepackage[breaklinks=true,bookmarks=true,bookmarksopen=true,pdfpagemode=UseNone,pdfstartview=FitH,colorlinks=true,citecolor=blue]{hyperref} + +%%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry} +\pagestyle{headandfoot} +\ifprintanswers +\newcommand{\stitle}{: Solutions} +\else +\newcommand{\stitle}{} +\fi +\header{{\bfseries\large Exercise 12\stitle}}{{\bfseries\large Maximum likelihood}}{{\bfseries\large January 7th, 2019}} +\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email: +jan.benda@uni-tuebingen.de} +\runningfooter{}{\thepage}{} + +\setlength{\baselineskip}{15pt} +\setlength{\parindent}{0.0cm} +\setlength{\parskip}{0.3cm} +\renewcommand{\baselinestretch}{1.15} + +%%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{listings} +\lstset{ + language=Matlab, + basicstyle=\ttfamily\footnotesize, + numbers=left, + numberstyle=\tiny, + title=\lstname, + showstringspaces=false, + commentstyle=\itshape\color{darkgray}, + breaklines=true, + breakautoindent=true, + columns=flexible, + frame=single, + xleftmargin=1em, + xrightmargin=1em, + aboveskip=10pt +} + +%%%%% math stuff: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{bm} +\usepackage{dsfont} +\newcommand{\naZ}{\mathds{N}} +\newcommand{\gaZ}{\mathds{Z}} +\newcommand{\raZ}{\mathds{Q}} +\newcommand{\reZ}{\mathds{R}} +\newcommand{\reZp}{\mathds{R^+}} +\newcommand{\reZpN}{\mathds{R^+_0}} +\newcommand{\koZ}{\mathds{C}} + +%%%%% page breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\continue}{\ifprintanswers% +\else +\vfill\hspace*{\fill}$\rightarrow$\newpage% +\fi} +\newcommand{\continuepage}{\ifprintanswers% +\newpage +\else +\vfill\hspace*{\fill}$\rightarrow$\newpage% +\fi} +\newcommand{\newsolutionpage}{\ifprintanswers% +\newpage% +\else +\fi} + +%%%%% new commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\qt}[1]{\textbf{#1}\\} +\newcommand{\pref}[1]{(\ref{#1})} +\newcommand{\extra}{--- Zusatzaufgabe ---\ \mbox{}} +\newcommand{\code}[1]{\texttt{#1}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} + +\input{instructions} + + +\begin{questions} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\question \qt{Maximum likelihood of the standard deviation} +Let's compute the likelihood and the log-likelihood for the estimation +of the standard deviation. +\begin{parts} + \part Draw $n=50$ random numbers from a normal distribution with + mean $\mu=3$ and standard deviation $\sigma=2$. + + \part Plot the likelihood (computed as the product of probabilities) + and the log-likelihood (sum of the logarithms of the probabilities) + as a function of the standard deviation. Compare the position of the + maxima with the standard deviation that you compute directly from + the data. + + \part Increase $n$ to 1000. What happens to the likelihood, what + happens to the log-likelihood? Why? +\end{parts} +\begin{solution} + \lstinputlisting{mlestd.m} + \includegraphics[width=1\textwidth]{mlestd}\\ + + The more data the smaller the product of the probabilities ($\approx + p^n$ with $0 \le p < 1$) and the smaller the sum of the logarithms + of the probabilities ($\approx n\log p$, note that $\log p < 0$). + + The product eventually gets smaller than the precision of the + floating point numbers support. Therefore for $n=1000$ the products + becomes zero. Using the logarithm avoids this numerical problem. +\end{solution} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\question \qt{Maximum-likelihood estimator of a line through the origin} +In the lecture we derived the following equation for an +maximum-likelihood estimate of the slope $\theta$ of a straight line +through the origin fitted to $n$ pairs of data values $(x_i|y_i)$ with +standard deviation $\sigma_i$: +\[\theta = \frac{\sum_{i=1}^n \frac{x_i y_i}{\sigma_i^2}}{ \sum_{i=1}^n + \frac{x_i^2}{\sigma_i^2}} \] +\begin{parts} + \part \label{mleslopefunc} Write a function that takes two vectors + $x$ and $y$ containing the data pairs and returns the slope, + computed according to this equation. For simplicity we assume + $\sigma_i=\sigma$ for all $1 \le i \le n$. How does this simplify + the equation for the slope? + \begin{solution} + \lstinputlisting{mleslope.m} + \end{solution} + + \part Write a script that generates data pairs that scatter around a + line through the origin with a given slope. Use the function from + \pref{mleslopefunc} to compute the slope from the generated data. + Compare the computed slope with the true slope that has been used to + generate the data. Plot the data togehther with the line from which + the data were generated and the maximum-likelihood fit. + \begin{solution} + \lstinputlisting{mlepropfit.m} + \includegraphics[width=1\textwidth]{mlepropfit} + \end{solution} + + \part \label{mleslopecomp} Vary the number of data pairs, the slope, + as well as the variance of the data points around the true + line. Under which conditions is the maximum-likelihood estimation of + the slope closer to the true slope? + + \part To answer \pref{mleslopecomp} more precisely, generate for + each condition let's say 1000 data sets and plot a histogram of the + estimated slopes. How does the histogram, its mean and standard + deviation relate to the true slope? +\end{parts} +\begin{solution} + \lstinputlisting{mlepropest.m} + \includegraphics[width=1\textwidth]{mlepropest}\\ + The estimated slopes are centered around the true slope. The + standard deviation of the estimated slopes gets smaller for larger + $n$ and less noise in the data. +\end{solution} + +\continue +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\question \qt{Maximum-likelihood-estimation of a probability-density function} +Many probability-density functions have parameters that cannot be +computed directly from the data, like, for example, the mean of +normally-distributed data. Such parameter need to be estimated by +means of the maximum-likelihood from the data. + +Let us demonstrate this approach by means of data that are drawn from a +gamma distribution, +\begin{parts} + \part Find out which \code{matlab} function computes the + probability-density function of the gamma distribution. + + \part \label{gammaplot} Use this function to plot the + probability-density function of the gamma distribution for various + values of the (positive) ``shape'' parameter. Wet set the ``scale'' + parameter to one. + + \part Find out which \code{matlab} function generates random numbers + that are distributed according to a gamma distribution. Generate + with this function 50 random numbers using one of the values of the + ``shape'' parameter used in \pref{gammaplot}. + + \part Compute and plot a properly normalized histogram of these + random numbers. + + \part Find out which \code{matlab} function fit a distribution to a + vector of random numbers according to the maximum-likelihood method. + How do you need to use this function in order to fit a gamma + distribution to the data? + + \part Estimate with this function the parameter of the gamma + distribution used to generate the data. + + \part Finally, plot the fitted gamma distribution on top of the + normalized histogram of the data. +\end{parts} +\begin{solution} + \lstinputlisting{mlepdffit.m} + \includegraphics[width=1\textwidth]{mlepdffit} +\end{solution} + +\end{questions} + +\end{document} \ No newline at end of file diff --git a/plotting/exercises/instructions.tex b/plotting/exercises/instructions.tex new file mode 100644 index 0000000..7fe599d --- /dev/null +++ b/plotting/exercises/instructions.tex @@ -0,0 +1,41 @@ +\vspace*{-8ex} +\begin{center} +\textbf{\Large Introduction to scientific computing}\\[1ex] +{\large Jan Grewe, Jan Benda}\\[-3ex] +Neuroethology lab \hfill --- \hfill Institute for Neurobiology \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 diff --git a/plotting/exercises/plotting_exercise.py b/plotting/exercises/plotting_exercise.py new file mode 100644 index 0000000..c076834 --- /dev/null +++ b/plotting/exercises/plotting_exercise.py @@ -0,0 +1,74 @@ +import numpy as np +import matplotlib.pyplot as plt +import scipy.io as scio +from IPython import embed + +def boltzmann(x, y_max, slope, inflection): + """ + The underlying Boltzmann function. + .. math:: + f(x) = y_max / \exp{-slope*(x-inflection} + + :param x: The x values. + :param y_max: The maximum value. + :param slope: The slope parameter k + :param inflection: the position of the inflection point. + :return: the y values. + """ + y = y_max / (1 + np.exp(-slope * (x - inflection))) + return y + + +class Animal(object): + + def __init__(self, delay, learning_rate, volatility, responsiveness): + """ + :param delay: + :param learning_rate: delta percent_correct per session + :param volatility: 0 -> 1 the noise in the decision + :param responsiveness: 0 -> 1 probability of actually conducting a trial + """ + self.__delay = delay + self.__learning_rate = learning_rate + self.__volatility = volatility + self.__responsiveness = responsiveness + + def simulate(self, session_count=10, trials=20, task_difficulties=[]): + tasks = 1 if len(task_difficulties) == 0 else len(task_difficulties) + if len(task_difficulties) == 0: + task_difficulties = [0] + avg_perf = np.zeros((session_count, tasks)) + err_perf = np.zeros((session_count, tasks)) + trials_performed = np.zeros(session_count) + for i in range(session_count): + for j in range(tasks): + base_performance = boltzmann(i, 1.0, self.__learning_rate/20, self.__delay) + penalty = base_performance * task_difficulties[j] * 0.5 + base_perf = 50 + 50 * (base_performance - penalty) + trials_completed = np.random.rand(trials) < self.__responsiveness + performances = np.random.randn(trials) * self.__volatility * 100 + base_perf + avg_perf[i, j] = np.mean(performances[trials_completed]) + err_perf[i, j] = np.std(performances[trials_completed]) + trials_performed = np.sum(trials_completed) + return avg_perf, err_perf, trials_performed + + +if __name__ == "__main__": + + session_count = 30 + task_difficulties = [0, 0.3, 1.] + + delays = [5, 10, 12, 20] + learning_rates = np.array([5, 10, 2, 20]) + volatilities = np.random.rand(4) * 0.5 + responsivness = np.random.rand(4) * 0.5 + 0.5 + + for i in range(len(delays)): + d = delays[i] + lr = learning_rates[i] + v = volatilities[i], + r = responsivness[i] + a = Animal(d, lr, v, r) + ap, ep, tp = a.simulate(session_count=session_count, task_difficulties=[0, 0.3, 0.6]) + plt.plot(ap) + embed() \ No newline at end of file diff --git a/pointprocesses/lecture/pointprocessscetchA.eps b/pointprocesses/lecture/pointprocessscetchA.eps index 47de7b9..67a0c1b 100644 --- a/pointprocesses/lecture/pointprocessscetchA.eps +++ b/pointprocesses/lecture/pointprocessscetchA.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchA.tex -%%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Mon Nov 26 17:57:49 2018 +%%Creator: gnuplot 5.0 patchlevel 6 +%%CreationDate: Thu Oct 17 14:13:46 2019 %%DocumentFonts: %%BoundingBox: 50 50 373 135 %%EndComments @@ -18,6 +18,7 @@ gnudict begin /Dashlength 1 def /Landscape false def /Level1 false def +/Level3 false def /Rounded true def /ClipToBoundingBox false def /SuppressPDFMark false def @@ -29,11 +30,11 @@ gnudict begin % /vshift -73 def /dl1 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if } def /dl2 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul add } if } def /hpt_ 31.5 def @@ -47,7 +48,7 @@ gnudict begin } if } def % -% Gnuplot Prolog Version 4.6 (September 2012) +% Gnuplot Prolog Version 5.1 (Oct 2015) % %/SuppressPDFMark true def % @@ -64,11 +65,11 @@ gnudict begin /vpt2 vpt 2 mul def /hpt2 hpt 2 mul def /Lshow {currentpoint stroke M 0 vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Rshow {currentpoint stroke M dup stringwidth pop neg vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def /DL {Color {setrgbcolor Solid {pop []} if 0 setdash} @@ -82,7 +83,7 @@ gnudict begin /PL {stroke userlinewidth setlinewidth Rounded {1 setlinejoin 1 setlinecap} if} def 3.8 setmiterlimit -% Default Line colors +% Classic Line colors (version 5.0) /LCw {1 1 1} def /LCb {0 0 0} def /LCa {0 0 0} def @@ -95,19 +96,21 @@ gnudict begin /LC6 {0 0 0} def /LC7 {1 0.3 0} def /LC8 {0.5 0.5 0.5} def -% Default Line Types +% Default dash patterns (version 5.0) +/LTB {BL [] LCb DL} def /LTw {PL [] 1 setgray} def -/LTb {BL [] LCb DL} def +/LTb {PL [] LCb DL} def /LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def /LT0 {PL [] LC0 DL} def -/LT1 {PL [4 dl1 2 dl2] LC1 DL} def -/LT2 {PL [2 dl1 3 dl2] LC2 DL} def -/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def -/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def -/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def -/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def -/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def -/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def +/LT1 {PL [2 dl1 3 dl2] LC1 DL} def +/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def +/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def +/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def +/LT5 {PL [4 dl1 2 dl2] LC5 DL} def +/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def +/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def +/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def +/SL {[] 0 setdash} def /Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def /Dia {stroke [] 0 setdash 2 copy vpt add M hpt neg vpt neg V hpt vpt neg V @@ -329,9 +332,14 @@ gnudict begin % /languagelevel where {pop languagelevel} {1} ifelse - 2 lt - {/InterpretLevel1 true def} - {/InterpretLevel1 Level1 def} +dup 2 lt + {/InterpretLevel1 true def + /InterpretLevel3 false def} + {/InterpretLevel1 Level1 def + 2 gt + {/InterpretLevel3 Level3 def} + {/InterpretLevel3 false def} + ifelse } ifelse % % PostScript level 2 pattern fill definitions @@ -420,6 +428,7 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse /Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall currentdict end definefont pop +% Level1 SuppressPDFMark or {} { /SDict 10 dict def @@ -429,14 +438,42 @@ systemdict /pdfmark known not { SDict begin [ /Title (pointprocessscetchA.tex) /Subject (gnuplot plot) - /Creator (gnuplot 4.6 patchlevel 4) - /Author (benda) + /Creator (gnuplot 5.0 patchlevel 6) + /Author (grewe) % /Producer (gnuplot) % /Keywords () - /CreationDate (Mon Nov 26 17:57:49 2018) + /CreationDate (Thu Oct 17 14:13:46 2019) /DOCINFO pdfmark end } ifelse +% +% Support for boxed text - Ethan A Merritt May 2005 +% +/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put + userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put + /Boxing true def } def +/ExtendTextBox { Boxing + { gsave dup false charpath pathbbox + dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse + dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse + dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse + dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse + grestore } if } def +/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M + TBx1 TBxmargin sub TBy2 TBymargin add L + TBx2 TBxmargin add TBy2 TBymargin add L + TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def +/DrawTextBox { PopTextBox stroke /Boxing false def} def +/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def +0 0 0 0 InitTextBox +/TBxmargin 20 def +/TBymargin 20 def +/Boxing false def +/textshow { ExtendTextBox Gshow } def +% +% redundant definitions for compatibility with prologue.ps older than 5.0.2 +/LTB {BL [] LCb DL} def +/LTb {PL [] LCb DL} def end %%EndProlog %%Page: 1 1 @@ -450,10 +487,9 @@ newpath 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -467,9 +503,11 @@ gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 573 M 0 503 V 1412 573 M @@ -488,11 +526,16 @@ LC0 setrgbcolor 0 503 V 5685 573 M 0 503 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C stroke grestore end diff --git a/pointprocesses/lecture/pointprocessscetchA.pdf b/pointprocesses/lecture/pointprocessscetchA.pdf index 85e1c44..cb30829 100644 Binary files a/pointprocesses/lecture/pointprocessscetchA.pdf and b/pointprocesses/lecture/pointprocessscetchA.pdf differ diff --git a/pointprocesses/lecture/pointprocessscetchB.eps b/pointprocesses/lecture/pointprocessscetchB.eps index 67d5c37..a04b551 100644 --- a/pointprocesses/lecture/pointprocessscetchB.eps +++ b/pointprocesses/lecture/pointprocessscetchB.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: pointprocessscetchB.tex -%%Creator: gnuplot 4.6 patchlevel 4 -%%CreationDate: Mon Nov 26 17:57:49 2018 +%%Creator: gnuplot 5.0 patchlevel 6 +%%CreationDate: Thu Oct 17 14:13:46 2019 %%DocumentFonts: %%BoundingBox: 50 50 373 237 %%EndComments @@ -18,6 +18,7 @@ gnudict begin /Dashlength 1 def /Landscape false def /Level1 false def +/Level3 false def /Rounded true def /ClipToBoundingBox false def /SuppressPDFMark false def @@ -29,11 +30,11 @@ gnudict begin % /vshift -73 def /dl1 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if } def /dl2 { - 10.0 Dashlength mul mul + 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul Rounded { currentlinewidth 0.75 mul add } if } def /hpt_ 31.5 def @@ -47,7 +48,7 @@ gnudict begin } if } def % -% Gnuplot Prolog Version 4.6 (September 2012) +% Gnuplot Prolog Version 5.1 (Oct 2015) % %/SuppressPDFMark true def % @@ -64,11 +65,11 @@ gnudict begin /vpt2 vpt 2 mul def /hpt2 hpt 2 mul def /Lshow {currentpoint stroke M 0 vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Rshow {currentpoint stroke M dup stringwidth pop neg vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R - Blacktext {gsave 0 setgray show grestore} {show} ifelse} def + Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def /UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def /DL {Color {setrgbcolor Solid {pop []} if 0 setdash} @@ -82,7 +83,7 @@ gnudict begin /PL {stroke userlinewidth setlinewidth Rounded {1 setlinejoin 1 setlinecap} if} def 3.8 setmiterlimit -% Default Line colors +% Classic Line colors (version 5.0) /LCw {1 1 1} def /LCb {0 0 0} def /LCa {0 0 0} def @@ -95,19 +96,21 @@ gnudict begin /LC6 {0 0 0} def /LC7 {1 0.3 0} def /LC8 {0.5 0.5 0.5} def -% Default Line Types +% Default dash patterns (version 5.0) +/LTB {BL [] LCb DL} def /LTw {PL [] 1 setgray} def -/LTb {BL [] LCb DL} def +/LTb {PL [] LCb DL} def /LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def /LT0 {PL [] LC0 DL} def -/LT1 {PL [4 dl1 2 dl2] LC1 DL} def -/LT2 {PL [2 dl1 3 dl2] LC2 DL} def -/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def -/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def -/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def -/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def -/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def -/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def +/LT1 {PL [2 dl1 3 dl2] LC1 DL} def +/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def +/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def +/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def +/LT5 {PL [4 dl1 2 dl2] LC5 DL} def +/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def +/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def +/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def +/SL {[] 0 setdash} def /Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def /Dia {stroke [] 0 setdash 2 copy vpt add M hpt neg vpt neg V hpt vpt neg V @@ -329,9 +332,14 @@ gnudict begin % /languagelevel where {pop languagelevel} {1} ifelse - 2 lt - {/InterpretLevel1 true def} - {/InterpretLevel1 Level1 def} +dup 2 lt + {/InterpretLevel1 true def + /InterpretLevel3 false def} + {/InterpretLevel1 Level1 def + 2 gt + {/InterpretLevel3 Level3 def} + {/InterpretLevel3 false def} + ifelse } ifelse % % PostScript level 2 pattern fill definitions @@ -420,6 +428,7 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse /Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall currentdict end definefont pop +% Level1 SuppressPDFMark or {} { /SDict 10 dict def @@ -429,14 +438,42 @@ systemdict /pdfmark known not { SDict begin [ /Title (pointprocessscetchB.tex) /Subject (gnuplot plot) - /Creator (gnuplot 4.6 patchlevel 4) - /Author (benda) + /Creator (gnuplot 5.0 patchlevel 6) + /Author (grewe) % /Producer (gnuplot) % /Keywords () - /CreationDate (Mon Nov 26 17:57:49 2018) + /CreationDate (Thu Oct 17 14:13:46 2019) /DOCINFO pdfmark end } ifelse +% +% Support for boxed text - Ethan A Merritt May 2005 +% +/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put + userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put + /Boxing true def } def +/ExtendTextBox { Boxing + { gsave dup false charpath pathbbox + dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse + dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse + dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse + dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse + grestore } if } def +/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M + TBx1 TBxmargin sub TBy2 TBymargin add L + TBx2 TBxmargin add TBy2 TBymargin add L + TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def +/DrawTextBox { PopTextBox stroke /Boxing false def} def +/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def +0 0 0 0 InitTextBox +/TBxmargin 20 def +/TBymargin 20 def +/Boxing false def +/textshow { ExtendTextBox Gshow } def +% +% redundant definitions for compatibility with prologue.ps older than 5.0.2 +/LTB {BL [] LCb DL} def +/LTb {PL [] LCb DL} def end %%EndProlog %%Page: 1 1 @@ -450,10 +487,9 @@ newpath 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -467,9 +503,11 @@ gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 3029 M 0 272 V 502 -272 R @@ -488,18 +526,22 @@ LC0 setrgbcolor 0 272 V 5685 3029 M 0 272 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 1.000 UP -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -510,76 +552,86 @@ gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill 0 -32 V -5680 0 R 5680 0 V +stroke 1291 1929 M 121 32 V -121 32 V --260 -64 R --121 32 V -121 32 V -910 1961 M +-260 0 R +910 1961 L +121 -32 V +-121 32 R 502 0 V -590 -32 R +stroke +2002 1929 M 121 32 V -121 32 V --469 -64 R --121 32 V -121 32 V --121 -32 R +-469 0 R +-121 -32 V +121 -32 V +-121 32 R 711 0 V -206 -22 R +stroke +2329 1939 M 84 22 V -84 22 V --122 -44 R --84 22 V -84 22 V --84 -22 R +-122 0 R +-84 -22 V +84 -22 V +-84 22 R 290 0 V -216 -23 R +stroke +2629 1938 M 88 23 V -88 23 V --128 -46 R --88 23 V -88 23 V --88 -23 R +-128 0 R +-88 -23 V +88 -23 V +-88 23 R 304 0 V -329 -32 R +stroke +3046 1929 M 121 32 V -121 32 V --208 -64 R --121 32 V -121 32 V --121 -32 R +-208 0 R +-121 -32 V +121 -32 V +-121 32 R 450 0 V -745 -32 R +stroke +3912 1929 M 121 32 V -121 32 V --624 -64 R --121 32 V -121 32 V --121 -32 R +-624 0 R +-121 -32 V +121 -32 V +-121 32 R 866 0 V -496 -32 R +stroke +4529 1929 M 121 32 V -121 32 V --375 -64 R --121 32 V -121 32 V --121 -32 R +-375 0 R +-121 -32 V +121 -32 V +-121 32 R 617 0 V -914 -32 R +stroke +5564 1929 M 121 32 V -121 32 V --793 -64 R --121 32 V -121 32 V --121 -32 R +-793 0 R +-121 -32 V +121 -32 V +-121 32 R 1035 0 V stroke 2.000 UL LTb -0.00 0.00 0.00 C 10.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +10.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 1907 M 0 272 V 502 -272 R @@ -598,47 +650,60 @@ LC0 setrgbcolor 0 272 V 5685 1907 M 0 272 V -1.000 UP stroke +LTw +% End plot #1 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 268 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 460 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 652 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 844 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1036 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1228 M -63 0 V stroke LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 2.000 UL LTb LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 1276 M 528 220 L 5801 0 R @@ -646,9 +711,7 @@ LCb setrgbcolor -5801 0 R 1.000 UP stroke -LTb LCb setrgbcolor -LTb 1.000 UL LTb gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill @@ -662,9 +725,11 @@ gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill stroke 2.000 UL LTb -0.00 0.00 0.00 C 3.000 UL -LT0 -LC0 setrgbcolor +0.00 0.00 0.00 C % Begin plot #1 +3.000 UL +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 528 268 M 382 0 V 0 96 R @@ -685,11 +750,15 @@ LC0 setrgbcolor 1035 0 V 0 96 R 533 0 V -1.500 UP stroke +LTw +% End plot #1 +% Begin plot #2 +1.500 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 268 CircleF 1412 364 CircleF 2123 460 CircleF @@ -699,10 +768,14 @@ LC0 setrgbcolor 4033 844 CircleF 4650 940 CircleF 5685 1036 CircleF +LTw +% End plot #2 +% Begin plot #3 1.000 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 1.00 1.00 1.00 C 910 268 CircleF 1412 364 CircleF 2123 460 CircleF @@ -712,10 +785,14 @@ LC0 setrgbcolor 4033 844 CircleF 4650 940 CircleF 5685 1036 CircleF +LTw +% End plot #3 +% Begin plot #4 1.500 UP 2.000 UL -LT0 -LC0 setrgbcolor +LTb +LCb setrgbcolor +[] 0 setdash 0.00 0.00 0.00 C 910 364 CircleF 1412 460 CircleF 2123 556 CircleF @@ -725,10 +802,15 @@ LC0 setrgbcolor 4033 940 CircleF 4650 1036 CircleF 5685 1132 CircleF -1.000 UP +LTw +% End plot #4 2.000 UL LTb LCb setrgbcolor +[] 0 setdash +1.000 UP +2.000 UL +LTb 0.00 0.00 0.00 C stroke grestore end diff --git a/pointprocesses/lecture/pointprocessscetchB.pdf b/pointprocesses/lecture/pointprocessscetchB.pdf index d8958ae..3b50dec 100644 Binary files a/pointprocesses/lecture/pointprocessscetchB.pdf and b/pointprocesses/lecture/pointprocessscetchB.pdf differ