summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-07 22:42:17 +0000
committerKarl Berry <karl@freefriends.org>2017-03-07 22:42:17 +0000
commitf99cc5a22fe69fa6f1b3f864c9185ec424fd2e49 (patch)
tree86b2c73d78b528b1375ea5a413535e912d144dda /Master/texmf-dist/doc/generic
parenta6dc131e8a2ff8ce660543a262d771380fdf1b4e (diff)
pst-func (7mar17)
git-svn-id: svn://tug.org/texlive/trunk@43423 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic')
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/Changes1
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdfbin3641191 -> 3693177 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex98
3 files changed, 79 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-func/Changes b/Master/texmf-dist/doc/generic/pst-func/Changes
index 0dc37c0ca23..5ee0621abc9 100644
--- a/Master/texmf-dist/doc/generic/pst-func/Changes
+++ b/Master/texmf-dist/doc/generic/pst-func/Changes
@@ -1,4 +1,5 @@
..... pst-func.tex
+0.83 2017-03-07 - added some more macros for binomial distributions
0.82 2016-05-01 - psk@PontName->\psk@func@PointName (same name in pst-eucl)
0.81 2014-05-20 - changed \pstVerb to \pst@Verb in \psZero to allow
variables from tx@Dict
diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
index 2b71cac8b1c..f037e3a5c4a 100644
--- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
index 6530ae60883..c6f152ad565 100644
--- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex
@@ -1032,14 +1032,17 @@ and is predefined with 5.
\clearpage
+
+
+
\subsection{Binomial distribution}\label{sec:bindistri}
-These two macros plot binomial distribution, \Lcs{psBinomialN} the normalized one.
-It is always done in the $x$-Intervall $[0;1]$.
-Rescaling to another one can be done by setting the \Lkeyword{xunit} option
-to any other value.
+These five macros plot binomial probability mass function \Lcs{psBinomial} and \Lcs{psBinomialC} in curve style, the normalized one is \Lcs{psBinomialN}. The cumulative distribution function $F$ \Lcs{psBinomialF} and the complement of the cumulative distribution function to one ($1-F$) \Lcs{psBinomialFS}
+It is always done in the $y$-Intervall $[0;1]$.
+Rescaling to another one can be done by setting the \Lkeyword{yunit} option
+to any other value.
-The binomial distribution gives the discrete probability distribution $P_p(n|N)$ of obtaining
-exactly $n$ successes out of $N$ Bernoulli trials (where the result of each
+The binomial distribution \Lcs{psBinomial} gives the discrete probability distribution $P_p(n|N)$ of obtaining
+exactly $n$ successes out of $N$ Bernoulli trials (where the result of each
Bernoulli trial is true with probability $p$ and false with probability
$q=1-p$. The binomial distribution is therefore given by
@@ -1048,7 +1051,7 @@ P_p(n|N) &= \binom{N}{n}p^nq^{N-n} \\
&= \frac{N!}{n!(N-n)!}p^n(1-p)^{N-n},
\end{align}
-where $(N; n)$ is a binomial coefficient and $P$ the probability.
+where $(N; n)$ is a binomial coefficient and $P$ the probability.
The syntax is quite easy:
@@ -1056,14 +1059,21 @@ The syntax is quite easy:
\Lcs{psBinomial}\OptArgs\Largb{N}\Largb{probability p}\\
\Lcs{psBinomial}\OptArgs\Largb{m,N}\Largb{probability p}\\
\Lcs{psBinomial}\OptArgs\Largb{m,n,N}\Largb{probability p}\\
-\Lcs{psBinomialN}\OptArgs\Largb{N}\Largb{probability p}
+\Lcs{psBinomialC}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialN}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{m,N}\Largb{probability p}\\
+\Lcs{psBinomialF}\OptArgs\Largb{m,n,N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{m,N}\Largb{probability p}\\
+\Lcs{psBinomialFS}\OptArgs\Largb{m,n,N}\Largb{probability p}
\end{BDef}
\begin{itemize}
\item with one argument $N$ the sequence $0\ldots N$ is calculated and plotted
-\item with two arguments $m,N$ the sequence $0\ldots N$ is calculated and
+\item with two arguments $m,N$ the sequence $0\ldots N$ is calculated and
the sequence $m\ldots N$ is plotted
-\item with three arguments $m,n,N$ the sequence $0\ldots N$ is calculated and
+\item with three arguments $m,n,N$ the sequence $0\ldots N$ is calculated and
the sequence $m\ldots n$ is plotted
\end{itemize}
@@ -1071,23 +1081,38 @@ There is a restriction in using the value for N. It depends to the probability,
one should expect problems with $N>100$. PostScript cannot handle such small values and there will
be no graph printed. This happens on PostScript side, so \TeX\ doesn't report any problem in
the log file. The valid options for the macros are \Lkeyword{markZeros} to draw rectangles instead
-of a continous line and \Lkeyword{printValue} for printing the $y$-values on top of the lines,
-rotated by 90\textdegree. For this option all other options from section~1
-for the macro \Lcs{psPrintValue} are valid, too.~ \cite{pst-tools} Important is the keyword \Lkeyword{valuewidth}
+of a continous line and \Lkeyword{printValue} for printing the $y$-values in the color LabelColor $=$ color on top of the lines in distance labelsep and xlabelsep, rotated by labelangle $=\alpha$. For this option all other options from section~1
+for the macro \Lcs{psPrintValue} are valid, too.~ \cite{pst-tools} Important is the keyword \Lkeyword{valuewidth}
which is preset to 10. If your value has more characters when converting into a string, it will
not be printed or cause an GhostScript error.
-The only special option is \Lkeyword{barwidth},
-which is a factor (no dimension) and set by default to 1. This option is only valid for
-the macro \Lcs{psBinomial} and not for the normalized one!
+Special options are
+\begin{itemize}
+\item \Lkeyword{barwidth}, which is a factor (no dimension) and set by default to 1. This option is not valid for
+the macro \Lcs{psBinomialN}!
+\item \Lkeyword{labelangle} is the rotation of the printed values, default is 90\textdegree
+\item \Lkeyword{xlabelsep} is the x-separation of the printed values, default is 0 (no dimension)
+\item \Lkeyword{labelsep} is the y-separation of the printed values, default is 0.2 (no dimension)
+\item \Lkeyword{LabelColor} is the color of the printed values, default is black
+\item \Lkeyword{LineEnding} this boolean is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS}, default is true. Draws circles at the end of the lines
+\item \Lkeyword{VLines} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS}, default is false. Draws the vertical lines dashed.
+\item \Lkeyword{rightEnd}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) and $n=N$, default is 2
+\item \Lkeyword{leftEnd}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) and $m=0$, default is 1
+\item \Lkeyword{radiusout}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the outer radius of the both dots left and right, default is 2
+\item \Lkeyword{radiusinL}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the left dot, default is 0
+\item \Lkeyword{radiusinR}, this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the right dot, default is 1.5
+\item \Lkeyword{LineEndColorL} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the color of the left dot, default is green
+\item \Lkeyword{LineEndColorR} this option is only valid for the macros \Lcs{psBinomialF} and \Lcs{psBinomialFS} when LineEnding=true (default) for the inner radius of the right dot, default is red
+\end{itemize}
\psset[pst-func]{barwidth=1}
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=5cm}%
-\begin{pspicture}(-1,-0.15)(7,0.55)%
+\begin{pspicture}(-1,-0.15)(7,0.6)%
\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(7,0.5)
\uput[-90](7,0){$k$} \uput[90](0,0.5){$P(X=k)$}
-\psBinomial[markZeros,printValue,fillstyle=vlines]{6}{0.4}
+\psBinomial[markZeros,printValue,fillstyle=vlines,
+labelangle=80,LabelColor=blue]{6}{0.4}
\end{pspicture}
\end{LTXexample}
@@ -1096,8 +1121,9 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\begin{pspicture}(-1,-0.05)(8,0.6)%
\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(8,0.5)
\uput[-90](8,0){$k$} \uput[90](0,0.5){$P(X=k)$}
+\psBinomialC[fillstyle=solid,opacity=0.5,fillcolor=cyan,plotstyle=curve]{7}{0.6}
\psBinomial[linecolor=red,markZeros,printValue,fillstyle=solid,
- fillcolor=blue,barwidth=0.2]{7}{0.6}
+ fillcolor=blue,barwidth=0.2,xlabelsep=-0.05]{7}{0.6}
\end{pspicture}
\end{LTXexample}
@@ -1109,6 +1135,7 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\psBinomial[linecolor=black!30]{0,7}{0.6}
\psBinomial[linecolor=blue,markZeros,printValue,fillstyle=solid,
fillcolor=blue,barwidth=0.4]{2,5,7}{0.6}
+\psBinomialC[,showpoints=true,plotstyle=curve]{7}{0.6}
\end{pspicture}
\end{LTXexample}
@@ -1125,6 +1152,35 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\end{pspicture*}
\end{LTXexample}
+\begin{LTXexample}[pos=t,preset=\centering]
+\psset{xunit=0.8cm,yunit=8cm}%
+\begin{pspicture*}[showgrid=false](-1.5,-0.1)(16,1.2)%
+\psset{arrowscale=1.3,arrowinset=0.05,arrowlength=1.9,comma}%
+\psaxes[labelFontSize=\scriptstyle,xticksize=0 1.07,yticksize=0 16,tickcolor=gray!50,
+ Dy=0.1,dy=0.1,Dx=1,dx=1,Ox=0]{->}(0,0)(-0.9,0)(16,1.1)
+\uput[-90](15.8,0){$z$}\uput[0](0,1.1){$P_{0,15}^{100}(Z=z)$}
+\psBinomialC[linecolor=cyan,fillstyle=solid,fillcolor=cyan!50,opacity=0.4,plotstyle=curve]{40}{0.15}%
+\psBinomial[markZeros,linecolor=BrickRed,fillstyle=solid,fillcolor=BrickRed,barwidth=0.75,opacity=0.6]{1,16,40}{0.15}%
+\psBinomialFS[markZeros,linecolor=Green,fillstyle=solid,fillcolor=orange,barwidth=0.3,opacity=0.6]{0,16,40}{0.15}%
+\psBinomialF[linecolor=gray,fillstyle=solid,fillcolor=yellow,barwidth=0.4,opacity=0.5]{3,16,40}{0.15}
+\end{pspicture*}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t,preset=\centering]
+\psset{xunit=0.75cm,yunit=7.5cm}%
+\begin{pspicture*}[showgrid=false](-1.3,-0.067)(14.67,1.13)%
+\psset{arrowscale=1.3,arrowinset=0.05,arrowlength=1.9,comma}
+\psaxes[labelFontSize=\scriptstyle,xticksize=0 1.07,yticksize=0 12,tickcolor=gray!50,Dy=0.1,dy=0.1,Dx=1,dx=1,Ox=0]{->}(0,0)(-0.9,0)(14,1.1)
+\uput[-90](13.8,0){$z$} \uput[0](0,1.08){$F_{0,7}^{10}(Z\leq z)$}
+\psBinomial[markZeros,linecolor=orange,fillstyle=solid,fillcolor=orange,barwidth=1,opacity=0.5]{0,10,10}{0.7}
+\psBinomialF[markZeros,linecolor=blue,linewidth=0.7pt,barwidth=0.2,
+opacity=0.5,fillstyle=solid,fillcolor=blue,valuewidth=15]{0,13,10}{0.7}
+\psBinomialFS[LineEnding=false,linecolor=BrickRed,linewidth=0.9pt,VLines=true]{0,10,10}{0.7}
+\psBinomialF[linecolor=Green,printValue=false,linewidth=1.2pt,LineEndColorR=BrickRed,LineEndColorL=Green!70,
+radiusout=3.5,radiusinL=0,radiusinR=2,LineEnding=true,leftEnd=1,rightEnd=3]{0,10,10}{0.7}
+\end{pspicture*}
+\end{LTXexample}
+
The default binomial distribution has the mean of $\mu=E(X)=N\cdot p$
and a variant of $\sigma^2=\mu\cdot(1-p)$.
The normalized distribution has a mean of $0$. Instead of $P(X=k)$
@@ -1166,7 +1222,7 @@ P(k) = P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p}
\end{pspicture*}
\end{LTXexample}
-For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyset{plotstyle=curve}),
+For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyset{plotstyle=curve}),
then the binomial distribution looks like a normal distribution. This option is only
valid for \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyval{curve} was chosen.
@@ -1190,6 +1246,8 @@ valid for \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyv
\end{pspicture*}
\end{LTXexample}
+
+
\clearpage
\subsection{Poisson distribution}
Given a Poisson process\footnote{\url{http://mathworld.wolfram.com/PoissonProcess.html}},