diff options
Diffstat (limited to '')
-rw-r--r-- | buch/papers/dreieck/images/Makefile | 8 | ||||
-rw-r--r-- | buch/papers/dreieck/images/beta.pdf | bin | 0 -> 100791 bytes | |||
-rw-r--r-- | buch/papers/dreieck/images/beta.tex | 214 | ||||
-rw-r--r-- | buch/papers/dreieck/images/betadist.m | 50 | ||||
-rw-r--r-- | buch/papers/dreieck/images/order.m | 40 | ||||
-rw-r--r-- | buch/papers/dreieck/images/order.pdf | bin | 31044 -> 32692 bytes | |||
-rw-r--r-- | buch/papers/dreieck/images/order.tex | 52 |
7 files changed, 351 insertions, 13 deletions
diff --git a/buch/papers/dreieck/images/Makefile b/buch/papers/dreieck/images/Makefile index 3907d13..c979599 100644 --- a/buch/papers/dreieck/images/Makefile +++ b/buch/papers/dreieck/images/Makefile @@ -3,8 +3,16 @@ # # (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule # +all: order.pdf beta.pdf + order.pdf: order.tex orderpath.tex pdflatex order.tex orderpath.tex: order.m octave order.m + +beta.pdf: beta.tex betapaths.tex + pdflatex beta.tex + +betapaths.tex: betadist.m + octave betadist.m diff --git a/buch/papers/dreieck/images/beta.pdf b/buch/papers/dreieck/images/beta.pdf Binary files differnew file mode 100644 index 0000000..c3ab4f6 --- /dev/null +++ b/buch/papers/dreieck/images/beta.pdf diff --git a/buch/papers/dreieck/images/beta.tex b/buch/papers/dreieck/images/beta.tex new file mode 100644 index 0000000..50509ee --- /dev/null +++ b/buch/papers/dreieck/images/beta.tex @@ -0,0 +1,214 @@ +% +% beta.tex -- display some symmetric beta distributions +% +% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +% +\documentclass[tikz]{standalone} +\usepackage{amsmath} +\usepackage{times} +\usepackage{txfonts} +\usepackage{pgfplots} +\usepackage{csvsimple} +\usetikzlibrary{arrows,intersections,math,calc} +\input{betapaths.tex} +\begin{document} +\def\skala{12} +\definecolor{colorone}{rgb}{1.0,0.6,0.0} +\definecolor{colortwo}{rgb}{1.0,0.0,0.0} +\definecolor{colorthree}{rgb}{0.6,0.0,0.6} +\definecolor{colorfour}{rgb}{0.6,0.0,1.0} +\definecolor{colorfive}{rgb}{0.0,0.0,1.0} +\definecolor{colorsix}{rgb}{0.4,0.6,1.0} +\definecolor{colorseven}{rgb}{0.0,0.0,0.0} +\definecolor{coloreight}{rgb}{0.0,0.8,0.8} +\definecolor{colornine}{rgb}{0.0,0.8,0.2} +\definecolor{colorten}{rgb}{0.2,0.4,0.0} +\definecolor{coloreleven}{rgb}{1.0,0.8,0.4} + +\def\achsen{ + \foreach \x in {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}{ + \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala}); + \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$}; + } + \foreach \y in {1,2,3,4}{ + \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy}); + \node at ({-0.1/\skala},{\y*\dy}) [left] {$\y$}; + } + \def\x{1} + \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala}); + \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$}; + \def\x{0} + \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$}; + + \draw[->] ({-0.1/\skala},0) -- ({1*\dx+0.4/\skala},0) + coordinate[label={$x$}]; + \draw[->] (0,{-0.1/\skala}) -- (0,{\betamax*\dy+0.4/\skala},0) + coordinate[label={right:$\beta(a,b,x)$}]; +} + +\def\farbcoord#1#2{ + ({\dx*(0.7+((#1-1)/4)*0.27)},{\dx*(0.15+((#2-1)/4)*0.27)}) +} +\def\farbviereck{ + \foreach \x in {1,2,3,4,5}{ + \draw[color=gray!30] \farbcoord{\x}{1} -- \farbcoord{\x}{5}; + \draw[color=gray!30] \farbcoord{1}{\x} -- \farbcoord{5}{\x}; + } + \draw[->] \farbcoord{1}{1} -- \farbcoord{5.4}{1} + coordinate[label={$a$}]; + \draw[->] \farbcoord{1}{1} -- \farbcoord{1}{5.4} + coordinate[label={left: $b$}]; + \foreach \x in {1,2,3,4,5}{ + \node[color=gray] at \farbcoord{5}{\x} [right] {\tiny $b=\x$}; + \fill[color=white,opacity=0.7] + \farbcoord{(\x-0.1)}{4.3} + rectangle + \farbcoord{(\x+0.1)}{5}; + \node[color=gray] at \farbcoord{\x}{5} [left,rotate=90] + {\tiny $a=\x$}; + } +} +\def\farbpunkt#1#2#3{ + \fill[color=#3] \farbcoord{#1}{#2} circle[radius={0.1/\skala}]; +} + +\begin{tikzpicture}[>=latex,thick,scale=\skala] + +\def\dx{1} +\def\dy{0.1} +\def\opa{0.1} + +\def\betamax{4.2} + +\fill[color=colorone,opacity=\opa] (0,0) -- \betaaa -- (\dx,0) -- cycle; +\fill[color=colortwo,opacity=\opa] (0,0) -- \betabb -- (\dx,0) -- cycle; +\fill[color=colorthree,opacity=\opa] (0,0) -- \betacc -- (\dx,0) -- cycle; +\fill[color=colorfour,opacity=\opa] (0,0) -- \betadd -- (\dx,0) -- cycle; +\fill[color=colorfive,opacity=\opa] (0,0) -- \betaee -- (\dx,0) -- cycle; +\fill[color=colorsix,opacity=\opa] (0,0) -- \betaff -- (\dx,0) -- cycle; +\fill[color=colorseven,opacity=\opa] (0,0) -- \betagg -- (\dx,0) -- cycle; +\fill[color=coloreight,opacity=\opa] (0,0) -- \betahh -- (\dx,0) -- cycle; +\fill[color=colornine,opacity=\opa] (0,0) -- \betaii -- (\dx,0) -- cycle; +\fill[color=colorten,opacity=\opa] (0,0) -- \betajj -- (\dx,0) -- cycle; +\fill[color=coloreleven,opacity=\opa] (0,0) -- \betakk -- (\dx,0) -- cycle; + +\draw[color=colorone] \betaaa; +\draw[color=colortwo] \betabb; +\draw[color=colorthree] \betacc; +\draw[color=colorfour] \betadd; +\draw[color=colorfive] \betaee; +\draw[color=colorsix] \betaff; +\draw[color=colorseven] \betagg; +\draw[color=coloreight] \betahh; +\draw[color=colornine] \betaii; +\draw[color=colorten] \betajj; +\draw[color=coloreleven] \betakk; + +\achsen + +\farbviereck + +\farbpunkt{\alphaeleven}{\betaeleven}{coloreleven} +\farbpunkt{\alphaten}{\betaten}{colorten} +\farbpunkt{\alphanine}{\betanine}{colornine} +\farbpunkt{\alphaeight}{\betaeight}{coloreight} +\farbpunkt{\alphaseven}{\betaseven}{colorseven} +\farbpunkt{\alphasix}{\betasix}{colorsix} +\farbpunkt{\alphafive}{\betafive}{colorfive} +\farbpunkt{\alphafour}{\betafour}{colorfour} +\farbpunkt{\alphathree}{\betathree}{colorthree} +\farbpunkt{\alphatwo}{\betatwo}{colortwo} +\farbpunkt{\alphaone}{\betaone}{colorone} + + +\def\betamax{4.9} + +\begin{scope}[yshift=-0.6cm] +\fill[color=colorone,opacity=\opa] (0,0) -- \betaaa -- (\dx,0) -- cycle; +\fill[color=colortwo,opacity=\opa] (0,0) -- \betaab -- (\dx,0) -- cycle; +\fill[color=colorthree,opacity=\opa] (0,0) -- \betaac -- (\dx,0) -- cycle; +\fill[color=colorfour,opacity=\opa] (0,0) -- \betaad -- (\dx,0) -- cycle; +\fill[color=colorfive,opacity=\opa] (0,0) -- \betaae -- (\dx,0) -- cycle; +\fill[color=colorsix,opacity=\opa] (0,0) -- \betaaf -- (\dx,0) -- cycle; +\fill[color=colorseven,opacity=\opa] (0,0) -- \betaag -- (\dx,0) -- cycle; +\fill[color=coloreight,opacity=\opa] (0,0) -- \betaah -- (\dx,0) -- cycle; +\fill[color=colornine,opacity=\opa] (0,0) -- \betaai -- (\dx,0) -- cycle; +\fill[color=colorten,opacity=\opa] (0,0) -- \betaaj -- (\dx,0) -- cycle; +\fill[color=coloreleven,opacity=\opa] (0,0) -- \betaak -- (\dx,0) -- cycle; + +\draw[color=colorone] \betaaa; +\draw[color=colortwo] \betaab; +\draw[color=colorthree] \betaac; +\draw[color=colorfour] \betaad; +\draw[color=colorfive] \betaae; +\draw[color=colorsix] \betaaf; +\draw[color=colorseven] \betaag; +\draw[color=coloreight] \betaah; +\draw[color=colornine] \betaai; +\draw[color=colorten] \betaaj; +\draw[color=coloreleven] \betaak; + +\achsen + +\farbviereck + +\farbpunkt{\alphaone}{\betaeleven}{coloreleven} +\farbpunkt{\alphaone}{\betaten}{colorten} +\farbpunkt{\alphaone}{\betanine}{colornine} +\farbpunkt{\alphaone}{\betaeight}{coloreight} +\farbpunkt{\alphaone}{\betaseven}{colorseven} +\farbpunkt{\alphaone}{\betasix}{colorsix} +\farbpunkt{\alphaone}{\betafive}{colorfive} +\farbpunkt{\alphaone}{\betafour}{colorfour} +\farbpunkt{\alphaone}{\betathree}{colorthree} +\farbpunkt{\alphaone}{\betatwo}{colortwo} +\farbpunkt{\alphaone}{\betaone}{colorone} + +\end{scope} + +\begin{scope}[yshift=-1.2cm] +\fill[color=colorone,opacity=\opa] (0,0) -- \betaak -- (\dx,0) -- cycle; +\fill[color=colortwo,opacity=\opa] (0,0) -- \betabk -- (\dx,0) -- cycle; +\fill[color=colorthree,opacity=\opa] (0,0) -- \betack -- (\dx,0) -- cycle; +\fill[color=colorfour,opacity=\opa] (0,0) -- \betadk -- (\dx,0) -- cycle; +\fill[color=colorfive,opacity=\opa] (0,0) -- \betaek -- (\dx,0) -- cycle; +\fill[color=colorsix,opacity=\opa] (0,0) -- \betafk -- (\dx,0) -- cycle; +\fill[color=colorseven,opacity=\opa] (0,0) -- \betagk -- (\dx,0) -- cycle; +\fill[color=coloreight,opacity=\opa] (0,0) -- \betahk -- (\dx,0) -- cycle; +\fill[color=colornine,opacity=\opa] (0,0) -- \betaik -- (\dx,0) -- cycle; +\fill[color=colorten,opacity=\opa] (0,0) -- \betajk -- (\dx,0) -- cycle; +\fill[color=coloreleven,opacity=\opa] (0,0) -- \betakk -- (\dx,0) -- cycle; + +\draw[color=colorone] \betaak; +\draw[color=colortwo] \betabk; +\draw[color=colorthree] \betack; +\draw[color=colorfour] \betadk; +\draw[color=colorfive] \betaek; +\draw[color=colorsix] \betafk; +\draw[color=colorseven] \betagk; +\draw[color=coloreight] \betahk; +\draw[color=colornine] \betaik; +\draw[color=colorten] \betajk; +\draw[color=coloreleven] \betakk; + +\achsen + +\farbviereck + +\farbpunkt{\alphaeleven}{\betaeleven}{coloreleven} +\farbpunkt{\alphaten}{\betaeleven}{colorten} +\farbpunkt{\alphanine}{\betaeleven}{colornine} +\farbpunkt{\alphaeight}{\betaeleven}{coloreight} +\farbpunkt{\alphaseven}{\betaeleven}{colorseven} +\farbpunkt{\alphasix}{\betaeleven}{colorsix} +\farbpunkt{\alphafive}{\betaeleven}{colorfive} +\farbpunkt{\alphafour}{\betaeleven}{colorfour} +\farbpunkt{\alphathree}{\betaeleven}{colorthree} +\farbpunkt{\alphatwo}{\betaeleven}{colortwo} +\farbpunkt{\alphaone}{\betaeleven}{colorone} + +\end{scope} + +\end{tikzpicture} +\end{document} + diff --git a/buch/papers/dreieck/images/betadist.m b/buch/papers/dreieck/images/betadist.m new file mode 100644 index 0000000..9ff78ed --- /dev/null +++ b/buch/papers/dreieck/images/betadist.m @@ -0,0 +1,50 @@ +# +# betadist.m +# +# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule +# +global N; +N = 201; +global n; +n = 11; + +t = (0:n-1) / (n-1) +alpha = 1 + 4 * t.^2 + +#alpha = [ 1, 1.03, 1.05, 1.1, 1.25, 1.5, 2, 2.5, 3, 4, 5 ]; +beta = alpha; +names = [ "one"; "two"; "three"; "four"; "five"; "six"; "seven"; "eight"; + "nine"; "ten"; "eleven" ] + +function retval = Beta(a, b, x) + retval = x^(a-1) * (1-x)^(b-1) / beta(a, b); +end + +function plotbeta(fn, a, b, name) + global N; + fprintf(fn, "\\def\\beta%s{\n", name); + fprintf(fn, "\t({%.4f*\\dx},{%.4f*\\dy})", 0, Beta(a, b, 0)); + for x = (1:N-1)/(N-1) + X = (1-cos(pi * x))/2; + fprintf(fn, "\n\t--({%.4f*\\dx},{%.4f*\\dy})", + X, Beta(a, b, X)); + end + fprintf(fn, "\n}\n"); +end + +fn = fopen("betapaths.tex", "w"); + +for i = (1:n) + fprintf(fn, "\\def\\alpha%s{%f}\n", names(i,:), alpha(i)); + fprintf(fn, "\\def\\beta%s{%f}\n", names(i,:), beta(i)); +end + +for i = (1:n) + for j = (1:n) + printf("working on %d,%d:\n", i, j); + plotbeta(fn, alpha(i), beta(j), + char(['a' + i - 1, 'a' + j - 1])); + end +end + +fclose(fn); diff --git a/buch/papers/dreieck/images/order.m b/buch/papers/dreieck/images/order.m index d37a258..762f458 100644 --- a/buch/papers/dreieck/images/order.m +++ b/buch/papers/dreieck/images/order.m @@ -26,6 +26,10 @@ function retval = orderd(p, n, k) end end +function retval = orders(p, n, k) + retval = k * nchoosek(n, k) * p^(k-1) * (1-p)^(n-k); +end + function orderpath(fn, k, name) fprintf(fn, "\\def\\order%s{\n\t(0,0)", name); global N; @@ -51,29 +55,65 @@ function orderdpath(fn, k, name) fprintf(fn, "\n}\n"); end +function orderspath(fn, k, name) + fprintf(fn, "\\def\\orders%s{\n\t(0,0)", name); + global N; + global subdivisions; + for i = (1:subdivisions-1) + p = i/subdivisions; + fprintf(fn, "\n\t-- ({%.4f*\\dx},{%.4f*\\dy})", + p, orders(p, N, k)); + end + fprintf(fn, "\n\t-- ({1*\\dx},0)"); + fprintf(fn, "\n}\n"); +end + fn = fopen("orderpath.tex", "w"); + orderpath(fn, 0, "zero"); orderdpath(fn, 0, "zero"); +orderspath(fn, 0, "zero"); + orderpath(fn, 1, "one"); orderdpath(fn, 1, "one"); +orderspath(fn, 1, "one"); + orderpath(fn, 2, "two"); orderdpath(fn, 2, "two"); +orderspath(fn, 2, "two"); + orderpath(fn, 3, "three"); orderdpath(fn, 3, "three"); +orderspath(fn, 3, "three"); + orderpath(fn, 4, "four"); orderdpath(fn, 4, "four"); +orderspath(fn, 4, "four"); + orderpath(fn, 5, "five"); orderdpath(fn, 5, "five"); +orderspath(fn, 5, "five"); + orderpath(fn, 6, "six"); orderdpath(fn, 6, "six"); +orderspath(fn, 6, "six"); + orderpath(fn, 7, "seven"); orderdpath(fn, 7, "seven"); +orderspath(fn, 7, "seven"); + orderpath(fn, 8, "eight"); orderdpath(fn, 8, "eight"); +orderspath(fn, 8, "eight"); + orderpath(fn, 9, "nine"); orderdpath(fn, 9, "nine"); +orderspath(fn, 9, "nine"); + orderpath(fn, 10, "ten"); orderdpath(fn, 10, "ten"); +orderspath(fn, 10, "ten"); + fclose(fn); diff --git a/buch/papers/dreieck/images/order.pdf b/buch/papers/dreieck/images/order.pdf Binary files differindex 6d9c8c0..98a5fbe 100644 --- a/buch/papers/dreieck/images/order.pdf +++ b/buch/papers/dreieck/images/order.pdf diff --git a/buch/papers/dreieck/images/order.tex b/buch/papers/dreieck/images/order.tex index 083f014..9a2511c 100644 --- a/buch/papers/dreieck/images/order.tex +++ b/buch/papers/dreieck/images/order.tex @@ -13,10 +13,25 @@ \begin{document} \def\skala{8} \definecolor{darkgreen}{rgb}{0,0.6,0} + +\def\n{10} +\def\E#1#2{ + \draw[color=#2] + ({\dx*#1/(\n+1)},{-0.1/\skala}) -- ({\dx*#1/(\n+1)},{4.4*\dy}); + \node[color=#2] at ({\dx*#1/(\n+1)},{3.2*\dy}) + [rotate=90,above right] {$k=#1$}; +} +\def\var#1#2{ + \pgfmathparse{\dx*sqrt(#1*(\n-#1+1)/((\n+1)*(\n+1)*(\n+2)))} + \xdef\var{\pgfmathresult} + \fill[color=#2,opacity=0.5] + ({\dx*#1/(\n+1)-\var},0) rectangle ({\dx*#1/(\n+1)+\var},{4.4*\dy}); +} + \input{orderpath.tex} \begin{tikzpicture}[>=latex,thick,scale=\skala] -\def\dx{1} +\def\dx{1.6} \def\dy{0.5} \def\pfad#1#2{ @@ -24,7 +39,7 @@ -- #1 -- - ({1+0.1/\skala},0.5); + ({1*\dx+0.1/\skala},0.5); } \pfad{\orderzero}{darkgreen!20} @@ -39,11 +54,11 @@ \pfad{\orderten}{darkgreen!20} \pfad{\orderseven}{darkgreen} -\draw[->] ({-0.1/\skala},0) -- (1.1,0) coordinate[label={$x$}]; -\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={left:$F(X)$}]; +\draw[->] ({-0.1/\skala},0) -- ({1.03*\dx},0) coordinate[label={$x$}]; +\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={right:$F(X)$}]; \foreach \x in {0,0.2,0.4,0.6,0.8,1}{ - \draw (\x,{-0.1/\skala}) -- (\x,{0.1/\skala}); - \node at (\x,{-0.1/\skala}) [below] {$\x$}; + \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala}); + \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$}; } \foreach \y in {0.5,1}{ \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy}); @@ -55,17 +70,25 @@ \begin{scope}[yshift=-0.7cm] \def\dy{0.125} +\foreach \k in {1,2,3,4,5,6,8,9,10}{ + \E{\k}{blue!30} +} +\def\k{7} +\var{\k}{orange!40} +\node[color=blue] at ({\dx*\k/(\n+1)},{4.3*\dy}) [above] {$E(X_{7:n})$}; + \def\pfad#1#2{ \draw[color=#2,line width=1.4pt] ({-0.1/\skala},0) -- #1 -- - ({1+0.1/\skala},0.0); + ({1*\dx+0.1/\skala},0.0); } \begin{scope} \clip ({-0.1/\skala},{-0.1/\skala}) - rectangle ({1+0.1/\skala},{0.56+0.1/\skala}); + rectangle ({1*\dx+0.1/\skala},{0.56+0.1/\skala}); + \pfad{\orderdzero}{red!20} \pfad{\orderdone}{red!20} \pfad{\orderdtwo}{red!20} @@ -76,21 +99,24 @@ \pfad{\orderdeight}{red!20} \pfad{\orderdnine}{red!20} \pfad{\orderdten}{red!20} +\E{\k}{blue} \pfad{\orderdseven}{red} + \end{scope} -\draw[->] ({-0.1/\skala},0) -- (1.1,0) coordinate[label={$x$}]; -\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={left:$\varphi(X)$}]; +\draw[->] ({-0.1/\skala},0) -- ({1.03*\dx},0) coordinate[label={$x$}]; +\draw[->] (0,{-0.1/\skala}) -- (0,0.6) coordinate[label={right:$\varphi(X)$}]; \foreach \x in {0,0.2,0.4,0.6,0.8,1}{ - \draw (\x,{-0.1/\skala}) -- (\x,{0.1/\skala}); - \node at (\x,{-0.1/\skala}) [below] {$\x$}; + \draw ({\x*\dx},{-0.1/\skala}) -- ({\x*\dx},{0.1/\skala}); + \node at ({\x*\dx},{-0.1/\skala}) [below] {$\x$}; } \foreach \y in {1,2,3,4}{ \draw ({-0.1/\skala},{\y*\dy}) -- ({0.1/\skala},{\y*\dy}); \node at ({-0.1/\skala},{\y*\dy}) [left] {$\y$}; } -\node[color=red] at (0.67,{2.7*\dy}) [above] {$k=7$}; +\node[color=red] at ({0.67*\dx},{2.7*\dy}) [above] {$k=7$}; + \end{scope} |