summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-11-10 00:47:08 +0000
committerKarl Berry <karl@freefriends.org>2012-11-10 00:47:08 +0000
commit723027aa71581306fc669ced6dd3f027f3be8bb4 (patch)
tree76af202c0fb06e928177e94db268135abed7999b /Master/texmf-dist
parent9dcabc03be8db3c9b58507b8d5ea57291abe58a8 (diff)
pst-func (9nov12)
git-svn-id: svn://tug.org/texlive/trunk@28221 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdfbin3076911 -> 3355747 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex356
2 files changed, 162 insertions, 194 deletions
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 ecef832b02a..73ae7bdf7ac 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 8ea3d904925..85c555a13c3 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
@@ -6,6 +6,7 @@
\let\pstFuncFV\fileversion
\usepackage{pst-math}
\usepackage{pstricks-add}
+\usepackage{animate}
\renewcommand\bgImage{%
\psset{yunit=4cm,xunit=3}
\begin{pspicture}(-2,-0.2)(2,1.4)
@@ -22,8 +23,9 @@
\lstset{language=PSTricks,
morekeywords={psGammaDist,psChiIIDist,psTDist,psFDist,psBetaDist,psPlotImpl},basicstyle=\footnotesize\ttfamily}
%
-\def\pshlabel#1{\footnotesize#1}
-\def\psvlabel#1{\footnotesize#1}
+\psset{labelFontSize=\scriptstyle}% for mathmode
+%\def\pshlabel#1{\footnotesize#1}
+%\def\psvlabel#1{\footnotesize#1}
%
\begin{document}
@@ -47,8 +49,8 @@ All should be already part of your local \TeX\ installation. If not, or in case
of having older versions, go to \url{http://www.CTAN.org/} and load the newest version.
\vfill\noindent
-Thanks to: \\
-Rafal Bartczuk,
+Thanks to \\
+ Rafal Bartczuk,
Jean-C\^ome Charpentier,
Martin Chicoine,
Gerry Coombes,
@@ -62,28 +64,30 @@ Rafal Bartczuk,
Buddy Ledger,
Manuel Luque,
Patrice Mégret,
+ Svend Mortensen,
Matthias Rüss,
Jose-Emilio Vila-Forcen,
-Timothy Van Zandt,
-Michael Zedler,
-and last but not least \url{http://mathworld.wolfram.com}
+ Timothy Van Zandt,
+ Michael Zedler,
+and last but not least
+ \url{http://mathworld.wolfram.com}.
\end{abstract}
\section{\nxLcs{psBezier\#}}
-This macro can plot a B\'ezier spline from order 1 up to 9 which needs
-(order+1) pairs of given coordinates.
+This macro can plot a B\'ezier spline from order $1$ up to $9$ which needs
+(order+$1$) pairs of given coordinates.
-Given a set of $n+1$ control points $P_0$, $P_1$, \ldots, $P_n$, the corresponding \Index{B\'ezier} curve
-(or \Index{Bernstein-B\'ezier} curve) is given by
+Given a set of $n+1$ control points $P_0$, $P_1$, \ldots, $P_n$,
+the corresponding \Index{B\'ezier} curve (or \Index{Bernstein-B\'ezier} curve) is given by
%
\begin{align}
C(t)=\sum_{i=0}^n P_i B_{i,n}(t)
\end{align}
%
-Where $B_{i,n}(t)$ is a Bernstein polynomial $B_{i,n}(t)=\binom{n}{i}t^i(1-t)^{n-i}$,
- and $t \in [0,1]$.
+where $B_{i,n}(t)$ is a Bernstein polynomial $B_{i,n}(t)=\binom{n}{i}t^i(1-t)^{n-i}$,
+and $t \in [0,1]$.
The Bézier curve starts through the first and last given point and
lies within the convex hull of all control points. The curve is tangent
to $P_1-P_0$ and $P_n-P_{n-1}$ at the endpoint.
@@ -93,17 +97,16 @@ point changes the global shape of the curve. The former is sometimes avoided
by smoothly patching together low-order Bézier curves.
The macro \Lcs{psBezier} (note the upper case B) expects the number of the order
-and $n=order+1$ pairs of coordinates:
+and $n=\text{order}+1$ pairs of coordinates:
\begin{BDef}
\Lcs{psBezier}\Larg{\#}\OptArgs\coord0\coord1\coordn
\end{BDef}
The number of steps between the first and last control points is given
-by the keyword \Lkeyword{plotpoints} and preset to 200. It can be
+by the keyword \Lkeyword{plotpoints} and preset to $200$. It can be
changed in the usual way.
-
\begin{lstlisting}
\psset{showpoints=true,linewidth=1.5pt}
\begin{pspicture}(-2,-2)(2,2)% order 1 -- linear
@@ -145,7 +148,6 @@ changed in the usual way.
\end{pspicture}
\end{lstlisting}
-
\begingroup
\psset{showpoints=true,linewidth=1.5pt}
\begin{pspicture}(-2,-2)(2,2)% order 1 -- linear
@@ -191,7 +193,6 @@ changed in the usual way.
\section{Polynomials}
\subsection{Chebyshev polynomials}
-
The polynomials of the first (\Lps{ChebyshevT}) kind are defined through the identity
\[ T_n(\cos\theta)=\cos(n\theta)\]
@@ -216,8 +217,8 @@ The polynomials of second kind (\Lps{ChebyshevU}) can be generated by
&= \sum_{n=0}^\infty U_n(x)t^n
\end{align}
-\LPack{pst-func} defines the \TeX-macros \Lcs{ChebyshevT} for the
-first kind and \Lcs{ChebyshevU} for the second kind of \Index{Chebyshev polynomials}.
+\LPack{pst-func} defines the \TeX-macros \Lcs{ChebyshevT} for the first kind
+and \Lcs{ChebyshevU} for the second kind of \Index{Chebyshev polynomials}.
These \TeX-macros cannot be used outside of PostScript, they are only wrappers
for \verb+tx@FuncDict begin ChebyshevT end+ and the same for \Lcs{ChebyshevU}.
@@ -270,8 +271,6 @@ for \verb+tx@FuncDict begin ChebyshevT end+ and the same for \Lcs{ChebyshevU}.
\egroup
\end{center}
-
-
\begin{lstlisting}
\psset{xunit=4cm,yunit=3cm,plotpoints=1000}
\begin{pspicture}(-1.2,-2)(2,1.5)
@@ -299,8 +298,6 @@ for \verb+tx@FuncDict begin ChebyshevT end+ and the same for \Lcs{ChebyshevU}.
\egroup
\end{center}
-
-
\begin{lstlisting}
\psset{xunit=4cm,yunit=3cm,plotpoints=1000}
\begin{pspicture*}(-1.5,-1.5)(1.5,1.5)
@@ -309,8 +306,8 @@ for \verb+tx@FuncDict begin ChebyshevT end+ and the same for \Lcs{ChebyshevU}.
\psset{linewidth=1.5pt}
\psplot[linecolor=black]{-1}{1}{2 x \ChebyshevU}
\psplot[linecolor=black]{-1}{1}{3 x \ChebyshevU}
- \psplot[linecolor=blue]{-1}{1}{4 x \ChebyshevU }
- \psplot[linecolor=red]{-1}{1}{5 x \ChebyshevU }
+ \psplot[linecolor=blue]{-1}{1}{4 x \ChebyshevU}
+ \psplot[linecolor=red]{-1}{1}{5 x \ChebyshevU}
\end{pspicture*}
\end{lstlisting}
@@ -349,18 +346,16 @@ f^{\prime}(x) &= a_1 + 2a_2x + 3a_3x^2 + \ldots +(n-1)a_{n-1}x^{n-2} + na_nx^{n-
f^{\prime\prime}(x) &= 2a_2 + 6a_3x + \ldots +(n-1)(n-2)a_{n-1}x^{n-3} + n(n-1)a_nx^{n-2}
\end{align}
-
-\noindent so \LPack{pst-func} needs only the \Index{coefficients} of the
-polynomial to calculate the function. The syntax is
+\noindent so \LPack{pst-func} needs only the \Index{coefficients}
+of the polynomial to calculate the function. The syntax is
\begin{BDef}
\Lcs{psPolynomial}\OptArgs\Largb{xStart}\Largb{xEnd}
\end{BDef}
-With the option \Lkeyword{xShift} one can do a horizontal shift to the graph of the function. With another
-than the predefined value the macro replaces $x$ by $x-x\mathrm{Shift}$; \Lkeyword{xShift}=1
-moves the graph of the \Index{polynomial function} one unit to the right.
-
+With the option \Lkeyword{xShift} one can do a horizontal shift to the graph of the function.
+With another than the predefined value the macro replaces $x$ by $x-x\mathrm{Shift}$;
+\Lkeyword{xShift}=1 moves the graph of the \Index{polynomial function} one unit to the right.
\begin{center}
\bgroup
@@ -379,7 +374,6 @@ moves the graph of the \Index{polynomial function} one unit to the right.
\egroup
\end{center}
-
\begin{lstlisting}
\psset{yunit=0.5cm,xunit=1cm}
\begin{pspicture*}(-3,-5)(5,10)
@@ -395,7 +389,6 @@ moves the graph of the \Index{polynomial function} one unit to the right.
\end{pspicture*}
\end{lstlisting}
-
The plot is easily clipped using the star version of the
\Lenv{pspicture} environment, so that points whose coordinates
are outside of the desired range are not plotted.
@@ -436,14 +429,11 @@ the parabola $y=a_0+a_1x+a_2x^2=x^2$.\\
\end{tabularx}
}
-
-
\bigskip
The above parameters are only
valid for the \Lcs{psPolynomial} macro, except \verb+x0+, which can also be used for the Gauss function. All
options can be set in the usual way with \Lcs{psset}.
-
\bigskip
\begin{LTXexample}
\psset{yunit=0.5cm,xunit=2cm}
@@ -461,8 +451,6 @@ options can be set in the usual way with \Lcs{psset}.
\end{pspicture*}
\end{LTXexample}
%$
-
-
\begin{LTXexample}
\psset{yunit=0.5cm,xunit=2cm}
\begin{pspicture*}(-3,-5)(3,10)
@@ -479,7 +467,6 @@ options can be set in the usual way with \Lcs{psset}.
\end{pspicture*}
\end{LTXexample}
%$
-
\begin{LTXexample}
\begin{pspicture*}(-5,-5)(5,5)
\psaxes{->}(0,0)(-5,-5)(5,5)%
@@ -532,9 +519,9 @@ illustrated below for $n=20$.
\Lcs{psBernstein}\OptArgs\Largr{tStart,tEnd}\Largr{i,n}
\end{BDef}
-The (\Lkeyword{tStart}, \Lkeyword{tEnd}) are \emph{optional} and preset by \verb=(0,1)=. The only new optional
-argument is the boolean key \Lkeyword{envelope}, which plots the envelope curve instead
-of the Bernstein polynomial.
+The (\Lkeyword{tStart}, \Lkeyword{tEnd}) are \emph{optional} and preset by \verb=(0,1)=.
+The only new optional argument is the boolean key \Lkeyword{envelope},
+which plots the envelope curve instead of the Bernstein polynomial.
\begin{LTXexample}[width=5cm,pos=l]
\psset{xunit=4.5cm,yunit=3cm}
@@ -599,11 +586,9 @@ of the Bernstein polynomial.
\end{pspicture*}
\end{LTXexample}
-
\psset{unit=1cm}
\clearpage
\section{\Lcs{psFourier}}
-
A Fourier sum has the form:
%
\begin{align}
@@ -680,14 +665,14 @@ J_n(x) &=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\dt\\
There are two special parameters for the Bessel function, and also the
settings of many \LPack{pst-plot} or \LPack{pstricks} parameters
affect the plot.
-These two ,,constants`` have the following meaning:
+These two ``constants'' have the following meaning:
%
\[
f(t) = constI \cdot J_n + constII
\]
%
\noindent
-where \Lkeyword{constI} and \Lkeyword{constII} must be real PostScript expressions, e.g.:
+where \Lkeyword{constI} and \Lkeyword{constII} must be real PostScript expressions, e.g.
\begin{lstlisting}[style=syntax]
\psset{constI=2.3,constII=t k sin 1.2 mul 0.37 add}
@@ -695,15 +680,14 @@ where \Lkeyword{constI} and \Lkeyword{constII} must be real PostScript expressio
The Bessel function is plotted with the parametricplot macro, this is the
reason why the variable is named \verb+t+. The internal procedure \verb+k+
-converts the value t from radian into degrees. The above setting is
-the same as
+converts the value t from radian into degrees. The above setting is the same as
%
\[
f(t) = 2.3 \cdot J_n + 1.2\cdot \sin t + 0.37
\]
%
In particular, note that the default for
-\Lkeyword{plotpoints} is $500$. If the plotting computations are too
+\Lkeyword{plotpoints} is 500. If the plotting computations are too
time consuming at this setting, it can be decreased in the usual
way, at the cost of some reduction in graphics resolution.
@@ -724,7 +708,6 @@ way, at the cost of some reduction in graphics resolution.
}
\end{LTXexample}
-
\begin{LTXexample}
{
\psset{xunit=0.25,yunit=2.5}
@@ -759,7 +742,6 @@ I_\nu(x) &= \left(\frac12 x\right)^\nu
The only valid optional argument for the function is \Lkeyword{nue}, which
is preset to 0, it shows $I_0$.
-
\begin{LTXexample}
\begin{pspicture}(0,-0.5)(5,5)
\psaxes[ticksize=-5pt 0]{->}(5,5)
@@ -770,7 +752,6 @@ is preset to 0, it shows $I_0$.
\end{pspicture}
\end{LTXexample}
-
\clearpage
\section{\Lcs{psSi}, \Lcs{pssi} and \Lcs{psCi}}
The integral sin and cosin are defined as
@@ -789,9 +770,7 @@ The integral sin and cosin are defined as
\Lcs{psCi}\OptArgs\Largb{xStart}\Largb{xEnd}
\end{BDef}
-
\begin{LTXexample}[pos=t]
-\def\pshlabel#1{\footnotesize#1} \def\psvlabel#1{\footnotesize#1}
\psset{xunit=0.5}
\begin{pspicture}(-15,-4.5)(15,2)
\psaxes[dx=1cm,Dx=2]{->}(0,0)(-15.1,-4)(15,2)
@@ -807,7 +786,6 @@ The integral sin and cosin are defined as
\begin{LTXexample}[pos=t]
-\def\pshlabel#1{\footnotesize#1} \def\psvlabel#1{\footnotesize#1}
\psset{xunit=0.5}
\begin{pspicture*}(-15,-4.2)(15,4.2)
\psaxes[dx=1cm,Dx=2]{->}(0,0)(-15.1,-4)(15,4)
@@ -819,15 +797,14 @@ The integral sin and cosin are defined as
\end{pspicture*}
\end{LTXexample}
-
\clearpage
\section{\nxLcs{psIntegral}, \nxLcs{psCumIntegral}, and \nxLcs{psConv}}
These new macros\footnote{Created by Jose-Emilio Vila-Forcen}
allows to plot the result of an integral using the Simpson numerical integration rule.
The first one is the result of the integral of a function with two variables, and
the integral is performed over one of them. The second one is the cumulative
-integral of a function (similar to \Lcs{psGaussI} but valid for all functions). The third
-one is the result of a convolution. They are defined as:
+integral of a function (similar to \Lcs{psGaussI} but valid for all functions).
+The third one is the result of a convolution. They are defined as:
%
\begin{align}
\text{\Lcs{psIntegral}}(x) &= \int\limits_a^b f(x,t)\mathrm{d}t \\
@@ -874,7 +851,7 @@ step). The precision and the smoothness of the plot depend strongly on these two
In the example, the cumulative integral of a Gaussian is presented in black. In red, a
Gaussian is varying its mean from -10 to 10, and the result is the integral from -4 to 6.
Finally, in green it is presented the integral of a Gaussian from -3 to 3, where the
-variance is varying from .1 to 10.
+variance is varying from 0.1 to 10.
\begin{LTXexample}
\psset{xunit=1cm,yunit=4cm}
@@ -895,7 +872,7 @@ The result (in red) is a \Index{trapezoid function}.
All distributions which use the $\Gamma$- or $\ln\Gamma$-function need the \LPack{pst-math} package,
it defines the PostScript functions \Lps{GAMMA} and \Lps{GAMMALN}. \LPack{pst-func} reads by default the PostScript
file \LFile{pst-math.pro}. It is part of any \TeX\ distribution and should also be on
-your system, otherwise install or update it from \textsc{CTAN}. It must the latest version.
+your system, otherwise install or update it from \textsc{CTAN}. It must be the latest version.
\begin{LTXexample}[pos=l,width=7cm]
\begin{pspicture*}(-0.5,-0.5)(6.2,5.2)
@@ -906,8 +883,6 @@ your system, otherwise install or update it from \textsc{CTAN}. It must the late
\end{pspicture*}
\end{LTXexample}
-
-
\clearpage
\subsection{Normal distribution (Gauss)}
The Gauss function is defined as
@@ -923,15 +898,13 @@ f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{\left(x-\mu\right)^2}{2\sigma{}
\Lcs{psGaussI}\OptArgs\Largb{xStart}\Largb{xEnd}
\end{BDef}
-\noindent where the only new parameter are \Lkeyword{sigma}=<value>+ and \Lkeyword{mue}=<value>+ for the
-horizontal shift,
-which can also be set in the usual way with \Lcs{psset}. It is
-significant only for the \Lcs{psGauss}- and \Lcs{psGaussI}-macro. The default is
+\noindent where the only new parameter are \Lkeyword{sigma}=<value>+ and \Lkeyword{mue}=<value>+
+for the horizontal shift, which can also be set in the usual way with \Lcs{psset}.
+It is significant only for the \Lcs{psGauss} and \Lcs{psGaussI} macro. The default is
\Lkeyword{sigma}=0.5 and \Lkeyword{mue}=0. The integral is caclulated wuth the Simson algorithm
-and has one special option, called \Lkeyword{Simpson}, which defines the number of intervalls per step
+and has one special option, called \Lkeyword{Simpson}, which defines the number of intervals per step
and is predefined with 5.
-
\begin{LTXexample}[pos=t,preset=\centering,wide=true]
\psset{yunit=4cm,xunit=3}
\begin{pspicture}(-2,-0.2)(2,1.4)
@@ -952,21 +925,21 @@ 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]$.
+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.
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
Bernoulli trial is true with probability $p$ and false with probability
-$q=1-p$. The binomial distribution is therefore given by
+$q=1-p$. The binomial distribution is therefore given by
\begin{align}
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.
The syntax is quite easy:
@@ -1016,7 +989,6 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\end{pspicture}
\end{LTXexample}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=10cm}%
\begin{pspicture}(-1,-0.05)(8,0.6)%
@@ -1028,7 +1000,6 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\end{pspicture}
\end{LTXexample}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=0.25cm,yunit=10cm}
\begin{pspicture*}(-1,-0.05)(61,0.52)
@@ -1042,17 +1013,16 @@ the macro \Lcs{psBinomial} and not for the normalized one!
\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)$ we use $P(Z=z)$ with $Z=\dfrac{X-E(X)}{\sigma(X)}$
-and $P\leftarrow P\cdot\sigma$.
-The macros use the rekursive definition of the binomial distribution:
+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)$
+we use $P(Z=z)$ with $Z=\dfrac{X-E(X)}{\sigma(X)}$ and $P\leftarrow P\cdot\sigma$.
+The macros use the recursive definition of the binomial distribution:
%
\begin{align}
-P(k) &= P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p}
+P(k) = P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p}
\end{align}
-
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=5cm}%
\begin{pspicture}(-3,-0.15)(4,0.55)%
@@ -1062,8 +1032,6 @@ P(k) &= P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p}
\end{pspicture}
\end{LTXexample}
-
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{yunit=10}
\begin{pspicture*}(-8,-0.07)(8.1,0.55)
@@ -1086,12 +1054,9 @@ 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}),
then the binomial distribution looks like a normal distribution. This option is only
-valid vor \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyval{curve} was chosen.
-
+valid for \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyval{curve} was chosen.
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=10cm}%
@@ -1103,7 +1068,6 @@ valid vor \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyv
\end{pspicture*}
\end{LTXexample}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=10cm}%
\begin{pspicture*}(-4,-0.06)(4.2,0.57)%
@@ -1114,7 +1078,6 @@ valid vor \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}},
@@ -1122,28 +1085,28 @@ the probability of obtaining exactly $n$ successes in $N$ trials is given by the
limit of a binomial distribution (see Section~\ref{sec:bindistri})
%
\begin{align}
-P_p(n|N) &= \frac{N!}{n!(N-n)!}\cdot p^n(1-p)^{N-n}\label{eq:normaldistri}
+P_p(n|N) = \frac{N!}{n!(N-n)!}\cdot p^n(1-p)^{N-n}\label{eq:normaldistri}
\end{align}
%
-Viewing the distribution as a function of the expected number of successes
+Viewing the distribution as a function of the expected number of successes;
%
\begin{align}\label{eq:nu}
-\lambda &= N\cdot p
+\lambda = N\cdot p
\end{align}
%
instead of the sample size $N$ for fixed $p$, equation (2) then becomes
-eq.~\ref{eq:normaldistri}
+\eqref{eq:normaldistri};
%
\begin{align}\label{eq:nuN}
-P_{\frac{\lambda}{n}}(n|N) &= \frac{N!}{n!(N-n)!}{\frac{\lambda}{N}}^n {\frac{1-\lambda}{N}}^{N-n}
+P_{\frac{\lambda}{n}}(n|N) = \frac{N!}{n!(N-n)!}{\frac{\lambda}{N}}^n {\frac{1-\lambda}{N}}^{N-n}
\end{align}
%
-Viewing the distribution as a function of the expected number of successes
+Viewing the distribution as a function of the expected number of successes;
%
-\[ P_\lambda(X=k)=\frac{\lambda^k}{k!}\,e^{-\lambda} \]
+\[ P_\lambda(X=k)=\frac{\lambda^k}{k!}\,e^{-\lambda} \].
%
-Letting the sample size become large ($N\to\infty$), the distribution then
-approaches (with $p=\frac{\lambda}{n}$)
+Letting the sample size become large ($N\to\infty$), the distribution then
+approaches (with $p=\frac{\lambda}{n}$):
%
\begin{align}
\lim_{n\to\infty} P(X=k) &= \lim_{n\to\infty}\frac{n!}{(n-k)!\,k!}
@@ -1161,7 +1124,6 @@ approaches (with $p=\frac{\lambda}{n}$)
%
which is known as the Poisson distribution and has the follwing syntax:
-
\begin{BDef}
\Lcs{psPoisson}\OptArgs\Largb{N}\Largb{lambda}\\
\Lcs{psPoisson}\OptArgs\Largb{M,N}\Largb{lambda}
@@ -1169,7 +1131,6 @@ which is known as the Poisson distribution and has the follwing syntax:
in which \texttt{M} is an optional argument with a default of 0.
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=20cm}%
\begin{pspicture}(-1,-0.05)(14,0.25)%
@@ -1190,7 +1151,6 @@ in which \texttt{M} is an optional argument with a default of 0.
\end{pspicture}
\end{LTXexample}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1cm,yunit=20cm}%
\begin{pspicture}(-1,-0.05)(14,0.25)%
@@ -1200,14 +1160,12 @@ in which \texttt{M} is an optional argument with a default of 0.
\end{pspicture}
\end{LTXexample}
-
-
\clearpage
\subsection{Gamma distribution}
A gamma distribution is a general type of statistical distribution that is related
to the beta distribution and arises naturally in processes for which the waiting
times between Poisson distributed events are relevant. Gamma distributions have
-two free parameters, labeled $alpha$ and $beta$. It is defined as
+two free parameters, labeled $\alpha$ and $\beta$. It is defined as
%
\[
f(x)=\frac{\beta(\beta x)^{\alpha-1}e^{-\beta x}}{\Gamma(\alpha)} \qquad
@@ -1229,7 +1187,6 @@ and has the syntax
\end{pspicture*}
\end{LTXexample}
-
\clearpage
\subsection{$\chi^2$-distribution}
The $\chi^2$-distribution is a continuous probability distribution. It
@@ -1253,7 +1210,7 @@ is distributed according to chi^2 with r=sum_(j==1)^(k)r_j degrees of freedom.
\fi
The $\chi^2$ with parameter $\nu$ is the same as a Gamma distribution
- with $\alpha=\nu/2$ and $\beta=1/2$ and the syntax
+with $\alpha=\nu/2$ and $\beta=1/2$ and the syntax
\begin{BDef}
\Lcs{psChiIIDist}\OptArgs\Largb{x0}\Largb{x1}
@@ -1272,19 +1229,17 @@ The $\chi^2$ with parameter $\nu$ is the same as a Gamma distribution
The cumulative distribution function is
%
\begin{align*}
-D_r(\chi^2) &= int_0^{\chi^2}\frac{t^{r/2-1}e^{-t/2}\mathrm{d}t}{\Gamma(1/2r)2^{r/2}} \\
+D_r(\chi^2) &= int_0^{\chi^2}\frac{t^{r/2-1}e^{-t/2}\mathrm{d}t}{\Gamma(1/2r)2^{r/2}\\
&= 1-\frac{\Gamma(1/2r,1/2\chi^2)}{\Gamma(1/2r)}
\end{align*}
\fi
-
-
-
\clearpage
\subsection{Student's $t$-distribution}
-A \Index{statistical distribution} published by \Index{William Gosset} in 1908 under his
-pseudonym ,,Student``. The $t$-distribution with parameter $\nu$ has the \Index{density function}
+A \Index{statistical distribution} published by \Index{William Gosset} in 1908
+under his pseudonym ``Student''. The $t$-distribution with parameter $\nu$ has
+the \Index{density function}
%
\[
f(x)=\frac1{\sqrt{\nu\pi}}\cdot
@@ -1298,7 +1253,6 @@ and the following syntax
\Lcs{psTDist}\OptArgs\Largb{x0}\Largb{x1}
\end{BDef}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=1.25cm,yunit=10cm}
\begin{pspicture}(-6,-0.1)(6,.5)
@@ -1310,7 +1264,6 @@ and the following syntax
\end{pspicture}
\end{LTXexample}
-
%The $t_\nu$-distribution has mode 0.
\clearpage
@@ -1318,7 +1271,7 @@ and the following syntax
A continuous statistical distribution which arises in the testing of
whether two observed samples have the same variance.
-The F-distribution with parameters $\mu$ and $\nu$ has the probability function
+The $F$-distribution with parameters $\mu$ and $\nu$ has the probability function
\[
f_{n,m}(x)=\frac{\Gamma[(\mu+\nu)/2]}{\Gamma(\mu/2)\Gamma(\nu/2)}\cdot
\left(\mu/\nu\right)^{\mu/2}\frac{x^{(\mu/2)-1}}{[1+(\mu x/\nu)]^{(\mu+\nu)/2}}\quad
@@ -1345,7 +1298,6 @@ The default settings are $\mu=1$ and $\nu=1$.
\end{pspicture*}
\end{LTXexample}
-
\clearpage
\subsection{Beta distribution}
@@ -1360,7 +1312,7 @@ used as a prior distribution for binomial proportions in \Index{Bayesian analysi
The domain is $[0,1]$, and the probability function $P(x)$ is given by
%
\[
-P(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}(1-x)^{\beta-1}x^{\alpha-1}
+P(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}(1-x)^{\beta-1}x^{\alpha-1}
\quad\text{ $\alpha,\beta>0$}
\]
%
@@ -1370,8 +1322,6 @@ and has the syntax (with a default setting of $\alpha=1$ and $\beta=1$):
\Lcs{psBetaDist}\OptArgs\Largb{x0}\Largb{x1}
\end{BDef}
%
-
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{xunit=10cm,yunit=5cm}
\begin{pspicture*}(-0.1,-0.1)(1.1,2.05)
@@ -1382,7 +1332,6 @@ and has the syntax (with a default setting of $\alpha=1$ and $\beta=1$):
\end{pspicture*}
\end{LTXexample}
-
\clearpage
\subsection{Cauchy distribution}
The \Index{Cauchy distribution}, also called the \Index{Lorentz distribution}, is a continuous distribution
@@ -1415,17 +1364,15 @@ The macro has the syntax (with a default setting of $m=0$ and $b=1$):
\psaxes[Dy=0.4,dy=0.4,Dx=0.5,dx=0.5]{->}(0,0)(-3,0)(3,2)
\end{pspicture*}
\end{LTXexample}
-
-
-
\iffalse
+
\clearpage
\subsection{Bose-Einstein distribution}
A distribution which arises in the study of integer \Index{spin particles} in physics,
\[
-P(x)=\frac{x^s}{e^{x-mu}-1}\qquad\text{with $s\in\mathbb{Z}$ and $\mu\in\mathbb{R}}
+P(x)=\frac{x^s}{e^{x-\mu}-1}\qquad\text{with $s\in\mathbb{Z}$ and $\mu\in\mathbb{R}$}
\]
-%
+%$
and has the syntax (with a default setting of $s=1$ and $\mu=1$):
\begin{BDef}
@@ -1433,13 +1380,10 @@ and has the syntax (with a default setting of $s=1$ and $\mu=1$):
\end{BDef}
\fi
-
\clearpage
\subsection{Weibull distribution}
-
In probability theory and statistics, the Weibull distribution is a continuous probability
-distribution. The probability density function of a
-Weibull random variable $x$ is:
+distribution. The probability density function of a Weibull random variable $x$ is:
\begin{align}
P(x) &= \alpha\beta^{-\alpha} x^{\alpha-1} e^{-\left(\frac{x}{\beta}\right)^\alpha}\\
@@ -1453,15 +1397,15 @@ P(x) &= \frac{\alpha}{\beta}\,x^{\alpha-1} e^{-\frac{x^\alpha}{\beta}}\\
D(x) &= 1 - e^{-\frac{x^\alpha}{\beta}}
\end{align}
-always for $x\in[0;\infty)$.
-where $\alpha > 0$ is the shape parameter and $\beta > 0$ is the scale parameter of the distribution.
+always for $x\in[0;\infty)$, where $\alpha > 0$ is the shape parameter
+and $\beta > 0$ is the scale parameter of the distribution.
$D(x)$ is the cumulative distribution function of the Weibull distribution. The values for
$\alpha$ and $\beta$ are preset to 1, but can be changed in the usual way.
The Weibull distribution is related to a number of other probability distributions; in
-particular, it interpolates between the exponential distribution $(\alpha = 1)$ and the
-Rayleigh distribution $(\alpha = 2)$.
+particular, it interpolates between the exponential distribution $(\alpha = 1)$ and
+the Rayleigh distribution $(\alpha = 2)$.
\begin{center}
\psset{unit=2}
@@ -1507,21 +1451,18 @@ starts \Lcs{psWeinbull} with 0.
For a homogenous portfolio of infinite granularity the portfolio loss
distribution is given by
-
\[
\mathbb{P}(L(P)<x)=1-\mathcal{N}
\left(\frac{\mathcal{N}^{-1}(PD)-\sqrt{1-R2}\cdot\mathcal{N}^{-1}(x)}{R}
\right)
\]
-$L(P)$ denotes the portfolio loss in percent. $pd$ is the uniform default
-probability and $R2$ is the uniform asset correlation.
+$L(P)$ denotes the portfolio loss in percent, $pd$ is the uniform default
+probability, and $R2$ is the uniform asset correlation.
They are preset to $pd=0.22$ and $R2=0.11$ and can be overwritten in the
usual way. The macro uses the PostScript function norminv from the package
-pst-math
-which is loaded by default and also shown in the following example.
-
-
+\LPack{pst-math} which is loaded by default and also shown in the following
+example.
\begin{LTXexample}[pos=t]
\psset{xunit=5}
@@ -1533,24 +1474,20 @@ which is loaded by default and also shown in the following example.
\end{pspicture}
\end{LTXexample}
-
-
\clearpage
\section{The Lorenz curve}
-
-The so-called \Index{Lorenz curve} is used in economics to describe inequality in
-wealth or size. The Lorenz curve is a function of the cumulative proportion of
-\textit{ordered individuals} mapped onto the corresponding cumulative proportion
-of their size. Given a sample of n ordered individuals with $x_i^{\prime}$ the size of
-individual $i$ and $x_1^{\prime}<x_2^{\prime}<\cdots<x_n^{\prime}$, then the sample Lorenz curve is
-the \textit{polygon} joining the points $(h/n,L_h/L_n)$, where $h=0, 1, 2,\ldots n, L_0=0$, and
-$L_h=sum_(i=1)^(h)x_i^{\prime}$.
+The so-called \Index{Lorenz curve} is used in economics to describe inequality in
+wealth or size. The Lorenz curve is a function of the cumulative proportion of
+\textit{ordered individuals} mapped onto the corresponding cumulative proportion
+of their size. Given a sample of $n^{\textup{th}}$ ordered individuals with
+$x_i^{\prime}$ the size of individual $i$ and $x_1^{\prime}<x_2^{\prime}<\cdots<x_n^{\prime}$,
+then the sample Lorenz curve is the \textit{polygon} joining the points $(h/n,L_h/L_n)$,
+where $h=0, 1, 2,\ldots n, L_0=0$ and $L_h=\sum_{i=1}^h x_i^{\prime}$.
\begin{BDef}
\LcsStar{psLorenz}\OptArgs\Largb{data file}
\end{BDef}
-
\begin{LTXexample}[pos=t,preset=\centering]
\psset{lly=-6mm,llx=-5mm}
\psgraph[Dx=0.2,Dy=0.2,axesstyle=frame](0,0)(1,1){6cm}{6cm}
@@ -1579,7 +1516,7 @@ origin of the coordinate system.
A superellipse is a curve with Cartesian equation
%
\begin{align}
-\left|\frac{x}{a}\right|^r + \left|\frac{y}{b}\right|^r & =1
+\left|\frac{x}{a}\right|^r + \left|\frac{y}{b}\right|^r =1
\end{align}
%
first discussed in 1818 by Gabriel Lam\'e (1795--1870)%
@@ -1589,15 +1526,16 @@ are important. He proved the theorem for $n = 7$ in 1839.}.
A superellipse may be described parametrically by
%
\begin{align}
-x = a\cdot\cos^{\frac{2}{r}} t\\
-y = b\cdot\sin^{\frac{2}{r}} t
+x &= a\cdot\cos^{\frac{2}{r}} t\\
+y &= b\cdot\sin^{\frac{2}{r}} t
\end{align}
%
-\Index{Superellipses} with $a=b$ are also known as \Index{Lam\'e} curves or Lam\'e ovals and
-the restriction to $r>2$ is sometimes also made. The following
-table summarizes a few special cases. \Index{Piet Hein} used $\frac{5}{2}$ with a number of different
-$\frac{a}{b}$ ratios for various of his projects. For example, he used $\frac{a}{b}=\frac{6}{5}$
-for Sergels Torg
+\Index{Superellipses} with $a=b$ are also known as \Index{Lam\'e} curves
+or Lam\'e ovals and the restriction to $r>2$ is sometimes also made.
+The following table summarizes a few special cases.
+\Index{Piet Hein} used $\frac{5}{2}$ with a number of different
+$\frac{a}{b}$ ratios for various of his projects.
+For example, he used $\frac{a}{b}=\frac{6}{5}$ for Sergels Torg
(Sergel's Square) in Stockholm, and $\frac{a}{b}=\frac{3}{2}$ for his table.
\begin{center}
@@ -1639,10 +1577,8 @@ and unit.
\end{LTXexample}
\egroup
-
\clearpage
\section{\nxLcs{psThomae} -- the popcorn function}
-
\Index{Thomae's function}, also known as the \Index{popcorn function},
the \Index{raindrop function}, the \Index{ruler function} or the
\Index{Riemann function}, is a modification of the \Index{Dirichlet} function.
@@ -1672,17 +1608,15 @@ The plotted number of points is the third parameter.
\end{pspicture}
\end{LTXexample}
-
\clearpage
\section{\nxLcs{psplotImp} -- plotting implicit defined functions}
-For a given area, the macro calculates in a
-first step row by row for every pixel (1pt) the function $f(x,y)$ and checks for a
-changing of the value from $f(x,y)<0$ to $f(x,y)>0$ or vice versa. If this happens,
-then the pixel must be part of the curve of the function $f(x,y)=0$. In a second step the same is
-done column by column. This may take some time because an area of $400\times 300$
-pixel needs $120$ thousand calculations of the function value. The user still defines
-this area in his own coordinates, the translation into pixel (pt) is done internally by the
-macro itself.
+For a given area, the macro calculates in a first step row by row for every pixel (1pt)
+the function $f(x,y)$ and checks for avchanging of the value from $f(x,y)<0$ to $f(x,y)>0$
+or vice versa. If this happens, then the pixel must be part of the curve of
+the function $f(x,y)=0$. In a second step the same is done column by column.
+This may take some time because an area of $400\times 300$ pixel needs 120 thousand calculations
+of the function value. The user still defines this area in his own coordinates,
+the translation into pixel (pt) is done internally by the macro itself.
The only special keyword is \Lkeyword{stepFactor} which is preset to 0.67 and controls the horizontal
and vertical step width.
@@ -1691,8 +1625,9 @@ and vertical step width.
\end{BDef}
The function must be of $f(x,y)=0$ and described in \PS code, or alternatively with
-the option \Lkeyword{algebraic} (\LPack{pstricks-add}) in an algebraic form. No other value names than $x$ and $y$
-are possible. In general, a starred \Lenv{pspicture*} environment maybe a good choice here.
+the option \Lkeyword{algebraic} (\LPack{pstricks-add}) in an algebraic form.
+No other value names than $x$ and $y$ are possible. In general, a starred \Lenv{pspicture*} environment
+maybe a good choice here.
\medskip
\noindent
@@ -1732,7 +1667,6 @@ The given area for \Lcs{psplotImp} should be \textbf{greater} than the given \Le
\end{pspicture*}
\end{LTXexample}
-
\begin{LTXexample}[preset=\centering]
\begin{pspicture*}(-5,-3.2)(5.5,4.5)
\psaxes{->}(0,0)(-5,-3)(5.2,4)%
@@ -1741,8 +1675,6 @@ The given area for \Lcs{psplotImp} should be \textbf{greater} than the given \Le
\end{pspicture*}
\end{LTXexample}
-
-
Using the \Lkeyword{polarplot} option implies using the variables $r$ and $phi$ for describing
the function, $y$ and $x$ are not respected in this case. Using the \Lkeyword{algebraic} option
for polar plots are also possible (see next example).
@@ -1773,12 +1705,12 @@ for polar plots are also possible (see next example).
\end{pspicture*}
\end{LTXexample}
-
The data of an implicit plot can be written into an external file for further purposes.
Use the optional argument \Lkeyword[pstricks-add]{saveData} to write the $x|y$ values
-into the file \nxLcs{jobname.data}. The file name can be changed with the keyword {\Lkeyword[pstricks-add]{filename}.
-When running a \TeX\ file from within a GUI it may be possible that you get a writeaccess error from GhostScript, because
-it prevents writing into a file when called from another program. In this case run GhostScript on the \PS-output from
+into the file \nxLcs{jobname.data}. The file name can be changed with
+the keyword {\Lkeyword[pstricks-add]{filename}. When running a \TeX\ file from within a GUI
+it may be possible that you get a writeaccess error from GhostScript, because it prevents writing
+into a file when called from another program. In this case run GhostScript on the \PS-output from
the command line.
\psset{mathLabel}
@@ -1826,11 +1758,9 @@ The data then can be read back to get a continous line of the plot.
\end{LTXexample}
\fi
-
\clearpage
\section{\nxLcs{psVolume} -- Rotating functions around the x-axis}
-
-This macro shows the behaviour of a \Index{rotated function} around the x-axis.
+This macro shows the behaviour of a \Index{rotated function} around the $x$-axis.
\begin{BDef}
\Lcs{psVolume}\OptArgs\Largr{xMin,xMax}\Largb{steps}\Largb{function $f(x)$}
@@ -1916,7 +1846,6 @@ $f(x)$ has to be described as usual for the macro \Lcs{psplot}.
\end{pspicture}
\end{lstlisting}
-
\psset{xunit=2}
\makebox[\linewidth]{%
\begin{pspicture}(-0.5,-4)(3,4)
@@ -1950,10 +1879,10 @@ $f(x)$ has to be described as usual for the macro \Lcs{psplot}.
\end{pspicture}
\end{lstlisting}
-\clearpage
+\clearpage
\section{Examples}
-
+\subsection{Filling an area under a distribution curve}
\begin{LTXexample}[preset=\centering]
\psset{xunit=0.5cm,yunit=20cm,arrowscale=1.5}
\begin{pspicture}(-1,-0.1)(21,0.2)
@@ -1965,14 +1894,57 @@ $f(x)$ has to be described as usual for the macro \Lcs{psplot}.
\end{pspicture}
\end{LTXexample}
-\clearpage
-\section{List of all optional arguments for \texttt{pst-func}}
-\xkvview{family=pst-func,columns={key,type,default}}
+\subsection{An animation of a distribution}
+
+\psset{xunit=0.9cm,yunit=9cm}
+\newcommand*\studentT[1]{%
+ \begin{pspicture}(-6,-0.1)(6,0.5)
+ \psaxes[Dy=0.1]{->}(0,0)(-5,0)(5.5,0.45)[$x$,0][$y$,90]
+ \pscustom[fillstyle=solid,fillcolor=blue!40,opacity=0.4,linecolor=red,linestyle=none]{%
+ \psline(0,0)(-5,0)
+ \psTDist[nue=#1]{-5}{5}
+ \psline(5,0)(0,0)
+ }
+ \psTDist[nue=#1,linecolor=red,linewidth=1pt]{-5}{5}
+ \rput(3,0.3){$\nu = #1$}
+ \end{pspicture}}
+
+\begin{center}
+ \begin{animateinline}[poster=first,controls,palindrome]{10}
+ \multiframe{50}{rA=0.02+0.02}{\studentT{\rA}}
+ \end{animateinline}
+ \captionof{figure}{Student's $t$-distribution.}
+\end{center}
+
+\begin{lstlisting}
+\psset{xunit=0.9cm,yunit=9cm}
+\newcommand*\studentT[1]{%
+ \begin{pspicture}(-6,-0.1)(6,0.5)
+ \psaxes[Dy=0.1]{->}(0,0)(-5,0)(5.5,0.45)[$x$,0][$y$,90]
+ \pscustom[fillstyle=solid,fillcolor=blue!40,opacity=0.4,linecolor=red,linestyle=none]{%
+ \psline(0,0)(-5,0)
+ \psTDist[nue=#1]{-5}{5}
+ \psline(5,0)(0,0)
+ }
+ \psTDist[nue=#1,linecolor=red,linewidth=1pt]{-5}{5}
+ \rput(3,0.3){$\nu = #1$}
+ \end{pspicture}}
+\begin{center}
+ \begin{animateinline}[poster=first,controls,palindrome]{10}
+ \multiframe{50}{rA=0.02+0.02}{\studentT{\rA}}
+ \end{animateinline}
+ \captionof{figure}{Student's $t$-distribution.}
+\end{center}
+\end{lstlisting}
+\clearpage
+\section{List of all optional arguments for \texttt{pst-func}}
+\xkvview{family=pst-func,columns={key,type,default}}
+
\bgroup
\raggedright
\nocite{*}
@@ -1982,8 +1954,4 @@ $f(x)$ has to be described as usual for the macro \Lcs{psplot}.
\printindex
-
-
\end{document}
-
-