diff options
author | Karl Berry <karl@freefriends.org> | 2007-09-03 16:33:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-09-03 16:33:26 +0000 |
commit | 8e1addeb313836534d067bb5f1818d0b9a5c1dd7 (patch) | |
tree | a2027db9392e9fe75d7b32c0fdc77aab18a34b22 /Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex | |
parent | f1a51e596292491bcc441288a51aaec8af7dab1e (diff) |
pst-func 0.50
git-svn-id: svn://tug.org/texlive/trunk@4854 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex | 418 |
1 files changed, 339 insertions, 79 deletions
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 a1be51a8928..30846a8a4ba 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 @@ -1,19 +1,25 @@ -\documentclass[a4paper,11pt]{article} +\documentclass[dvips,a4paper,11pt,english]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} -%\usepackage{pamathx} -\usepackage{mathpazo} +\usepackage{pamathx}% use this if you have the palatino math font +%\usepackage{mathpazo}% use this if you do not have the palatino math font \usepackage{url} \usepackage{amsmath} \usepackage{tabularx} \usepackage{longtable} +%\usepackage{fancyhdr} +%\pagestyle{fancy} \usepackage{pstricks} \usepackage{pst-func} \let\pstFuncFV\fileversion \usepackage{pst-math} \usepackage{pstricks-add}% for the alg parser +\usepackage{babel} \usepackage{showexpl} -\lstset{pos=t,wide=true} +\lstset{pos=t,wide=true,language=PSTricks, + morekeywords={psGammaDist,psChiIIDist,psTDist,psFDist,psBetaDist,psPlotImpl}} +\lstdefinestyle{syntax}{backgroundcolor=\color{blue!20},numbers=none,xleftmargin=0pt,xrightmargin=0pt, + frame=single} % \usepackage{xspace} \def\PS{PostScript\xspace} @@ -25,21 +31,36 @@ \usepackage[colorlinks,linktocpage]{hyperref} % \begin{document} -\title{\texttt{pst-func}\\plotting special mathematical functions\\ - \small v.\pstFuncFV} +\title{\texttt{pst-func}\\[1cm] +plotting special mathematical functions\\[5mm] + {\small v.\pstFuncFV}} %\thanks{% % This document was written with \texttt{Kile: 1.6a (Qt: 3.1.1; KDE: 3.1.1;} % \protect\url{http://sourceforge.net/projects/kile/}) and the PDF output % was build with VTeX/Free (\protect\url{http://www.micropress-inc.com/linux})}\\ \author{Herbert Vo\ss\thanks{% -%%JF -%Thanks to: Attila Gati and to John Frampton. -Thanks to: Attila Gati, John Frampton and Lars Kotthoff, Jose-Emilio Vila-Forcen. +Thanks to: + \mbox{Martin Chicoine}, + \mbox{Gerry Coombes}, + \mbox{John Frampton}, + \mbox{Attila Gati}, + \mbox{Lars Kotthoff}, + and \mbox{Jose-Emilio Vila-Forcen}. }} \date{\today} \maketitle +\vfill +\begin{center} +\fbox{\parbox{0.8\textwidth}{% +\texttt{pst-func} loads by default the following packages: \texttt{pst-plot}, +\texttt{pstricks-add}, \texttt{pst-math}, \texttt{pst-xkey}, and, of course \texttt{pstricks}. +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.}} +\end{center} +\vfill +\clearpage \tableofcontents \clearpage @@ -54,9 +75,10 @@ f^{\prime\prime}(x) &= 2a_2 + 6a_3x + \ldots +(n-1)(n-2)a_{n-1}x^{n-3} + n(n-1)a \noindent so \verb+pst-func+ needs only the coefficients of the polynomial to calculate the function. The syntax is -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psPolynomial[<options>]{xStart}{xEnd} -\end{verbatim} +\end{lstlisting} With the option \verb+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}$; \verb+xShift=1+ @@ -236,9 +258,10 @@ s(x) = \frac{a_0}{2} & + a_1\cos{\omega x} + a_2\cos{2\omega x} + \noindent The macro \verb+psFourier+ plots Fourier sums. The syntax is similiar to \verb+psPolynomial+, except that there are two kinds of coefficients: -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psPolynomial[cosCoeff=a0 a1 a2 ..., sinCoeff=b1 b2 ...]{xStart}{xEnd} -\end{verbatim} +\end{lstlisting} The coefficients must have the orders $a_0\ a_1\ a_2\ \ldots$ and $b_1\ b_2\ b_3\ \ldots$ and be separated by \textbf{spaces}. The default is \verb+cosCoeff=0,sinCoeff=1+, @@ -288,19 +311,20 @@ J_n(x) &=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\dt\\ \end{align} \noindent The syntax of the macro is -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psBessel[options]{order}{xStart}{xEnd} -\end{verbatim} +\end{lstlisting} There are two special parameters for the Bessel function, and also the settings of many \verb+pst-plot+ or \verb+pstricks+ parameters affect the plot. -\begin{verbatim} +\begin{lstlisting}[style=syntax] \def\psset@constI#1{\edef\psk@constI{#1}} \def\psset@constII#1{\edef\psk@constII{#1}} \psset{constI=1,constII=0} -\end{verbatim} +\end{lstlisting} These two "'constants"` have the following meaning: \[ @@ -309,9 +333,10 @@ f(t) = constI \cdot J_n + constII \noindent where $constI$ and $constII$ must be real PostScript expressions, e.g.: -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psset{constI=2.3,constII=t k sin 1.2 mul 0.37 add} -\end{verbatim} +\end{lstlisting} 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+ @@ -370,11 +395,12 @@ The integral sin and cosin are defined as \end{align} % \noindent The syntax of the macros is -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psSi[options]{xStart}{xEnd} \pssi[options]{xStart}{xEnd} \psCi[options]{xStart}{xEnd} -\end{verbatim} +\end{lstlisting} \begin{LTXexample}[pos=t] @@ -427,11 +453,12 @@ value of $x$ in the plot. The third one uses the \CMD{psIntegral} macro to perfo to the convolution, where the integration is performed from $a$ to $b$. The syntax of these macros is: -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psIntegral[<options>]{xStart}{xEnd}(a,b){ function } \psCumIngegral[<options>]{xStart}{xEnd}{ function } \psConv[<options>]{xStart}{xEnd}(a,b){ function f }{ function g } -\end{verbatim} +\end{lstlisting} In the first macro, the function should be created such that it accepts two values: \verb|<x t function>| should be a value. For the second and the third functions, they only need to accept one @@ -475,7 +502,24 @@ The result (in red) is a trapezoid function. \clearpage \section{Distributions} -\subsection{Normal Distribution (Gauss)} +All distributions which use the $\Gamma$- or $\ln\Gamma$-function need the \verb+pst-math+ package, +it defines the PostScript functions \verb+GAMMA+ and \verb+GAMMALN+. \verb+\pst-func+ reads by default the PostScript +file \verb+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. + +\begin{LTXexample}[pos=l,width=7cm] +\begin{pspicture*}(-0.5,-0.5)(6.2,5.2) + \psaxes{->}(0,0)(6,5) + \psset{plotpoints=100,linewidth=1pt} + \psplot[linecolor=red]{0.01}{4}{ x GAMMA } + \psplot[linecolor=blue]{0.01}{5}{ x GAMMALN } +\end{pspicture*} +\end{LTXexample} + + + + +\subsection{Normal distribution (Gauss)} The Gauss function is defined as % \begin{align} @@ -483,18 +527,12 @@ f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{\left(x-\mu\right)^2}{2\sigma{} \end{align} % \noindent The syntax of the macros is -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psGauss[options]{xStart}{xEnd} \psGaussI[options]{xStart}{xEnd} -\end{verbatim} +\end{lstlisting} -%%JF -%% comment, the angle brackets below, around "value", make sense -%% as a convention, so I left them in -% -%\noindent where the only new parameter is \verb+sigma=<value>+, with -%the default of \verb+0.5+ and can also be set in the usual way with -%\verb+\psset+. It is only valid for the \verb+psGauss+-macro. \noindent where the only new parameter are \verb+sigma=<value>+ and \verb+mue=<value>+ for the horizontal shift, which can also be set in the usual way with \verb+\psset+. It is @@ -503,7 +541,8 @@ significant only for the \verb+psGauss+- and \verb+\psGaussI+-macro. The default and has one special option, called \verb+Simpson+, which defines the number of intervalls per step and is predefined with 5. -\bgroup + +\begin{LTXexample}[pos=t,preset=\centering,wide=true] \psset{yunit=4cm,xunit=3} \begin{pspicture}(-2,-0.2)(2,1.4) % \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0] @@ -517,27 +556,10 @@ and is predefined with 5. \psGauss[linecolor=cyan, mue=0.5, linewidth=2pt]{-1.75}{1.75}% \psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75} \end{pspicture} -\egroup - - -\begin{lstlisting}[xrightmargin=-2cm] -\psset{yunit=4cm,xunit=3} -\begin{pspicture}(-2,-0.5)(2,1.25) -% \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0] - \psaxes[Dy=0.25]{->}(0,0)(-2,0)(2,1.25) - \uput[-90](6,0){x}\uput[0](0,1){y} - \rput[lb](1,0.75){\textcolor{red}{$\sigma =0.5$}} - \rput[lb](1,0.5){\textcolor{blue}{$\sigma =1$}} - \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{(x-x_0)^2}{2\sigma{}^2}}$} - \psGauss[linecolor=red, linewidth=2pt]{-1.75}{1.75}% - \psGaussI[linewidth=1pt,yunit=0.75cm]{-2}{2}% - \psGauss[linecolor=cyan, mue=0.5, linewidth=2pt]{-1.75}{1.75}% - \psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75} -\end{pspicture} -\end{lstlisting} +\end{LTXexample} -\subsection{Binomial Distribution}\label{sec:bindistri} +\subsection{Binomial distribution}\label{sec:bindistri} These two macros plot binomial distribution, \CMD{psBinomialN} the normalized one. It is always done in the $x$-Intervall $[0;1]$. @@ -556,10 +578,21 @@ P_p(n|N) &= \binom{N}{n}p^nq^{N-n} \\ where $(N; n)$ is a binomial coefficient and $P$ the probability. The syntax is quite easy: -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psBinomial[<options>]{N}{probability p} +\psBinomial[<options>]{m,N}{probability p} +\psBinomial[<options>]{m,n,N}{probability p} \psBinomialN[<options>]{N}{probability p} -\end{verbatim} +\end{lstlisting} + +\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 + the sequence $m\ldots N$ is plotted +\item with three arguments $m,n,N$ the sequence $0\ldots N$ is calculated and + the sequence $m\ldots n$ is plotted +\end{itemize} There is a restriction in using the value for N. It depends to the probability, but in general one should expect problems with $N>100$. PostScript cannot handle such small values and there will @@ -583,7 +616,7 @@ the macro \CMD{psBinomial} and not for the normalized one! \begin{LTXexample}[pos=t,preset=\centering] \psset{xunit=1cm,yunit=10cm}% -\begin{pspicture}(-1,-0.1)(8,0.6)% +\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)$} \psBinomial[linecolor=red,markZeros,printValue,fillstyle=solid, @@ -593,16 +626,26 @@ the macro \CMD{psBinomial} and not for the normalized one! \begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=10cm}% +\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)$} +\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} +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=t,preset=\centering] \psset{xunit=0.25cm,yunit=10cm} -\begin{pspicture*}(-1,-0.1)(61,0.52) +\begin{pspicture*}(-1,-0.05)(61,0.52) \psaxes[Dx=5,dx=5\psxunit,Dy=0.2,dy=0.2\psyunit]{->}(60,0.5) \uput[-90](60,0){$k$} \uput[0](0,0.5){$P(X=k)$} \psBinomial[markZeros,linecolor=red]{4}{.5} \psset{linewidth=1pt} -\psBinomial[linecolor=green]{5}{.5} -\psBinomial[linecolor=blue]{10}{.5} -\psBinomial[linecolor=red]{20}{.5} -\psBinomial[linecolor=magenta]{50}{.5} +\psBinomial[linecolor=green]{5}{.5} \psBinomial[linecolor=blue]{10}{.5} +\psBinomial[linecolor=red]{20}{.5} \psBinomial[linecolor=magenta]{50}{.5} \psBinomial[linecolor=cyan]{75}{.5} \end{pspicture*} \end{LTXexample} @@ -674,8 +717,10 @@ valid vor \CMD{psBinomialN}. The option \verb+showpoints+ is valid if \verb+curv \end{LTXexample} -\subsection{Poisson Distribution} -Given a Poisson process\footnote{\url{http://mathworld.wolfram.com/PoissonProcess.html}}, the probability of obtaining exactly $n$ successes in $N$ trials is given by the limit of a binomial distribution (see Section~\ref{sec:bindistri}) +\subsection{Poisson distribution} +Given a Poisson process\footnote{\url{http://mathworld.wolfram.com/PoissonProcess.html}}, +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} @@ -688,7 +733,7 @@ Viewing the distribution as a function of the expected number of successes \end{align} % instead of the sample size $N$ for fixed $p$, equation (2) then becomes -eq.~\ref{normaldistri} +eq.~\ref{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} @@ -698,7 +743,8 @@ Viewing the distribution as a function of the expected number of successes % \[ 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!} @@ -716,9 +762,13 @@ Letting the sample size become large ($N\to\infty$), the distribution then appr % which is known as the Poisson distribution and has the follwing syntax: -{\ttfamily -\textbackslash psPoisson[settings]\{N\}\{$\lambda$\} -} + +\begin{lstlisting}[style=syntax] +\psPoisson[settings]{N}{lambda} +\psPoisson[settings]{M,N}{lambda} +\end{lstlisting} + +in which \texttt{M} is an optional argument with a default of 0. \begin{LTXexample}[pos=t,preset=\centering] @@ -731,6 +781,214 @@ which is known as the Poisson distribution and has the follwing syntax: \end{pspicture} \end{LTXexample} +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=20cm}% +\begin{pspicture}(-1,-0.05)(14,0.25)% +\uput[-90](14,0){$k$} \uput[90](0,0.2){$P(X=k)$} +\psPoisson[printValue,valuewidth=20]{2,11}{6} % M,N lambda +\psaxes[Dy=0.1,dy=0.1\psyunit]{->}(0,0)(-1,0)(14,0.2) +\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. +The gamma distribution with parameters $\alpha$, $\beta$ is defined as +\[ +f(x)=\frac{\beta(\beta x)^{\alpha-1}e^{-\beta x}}{\Gamma(\alpha)} \qquad +\text{for $x>0$ and $\alpha$, $\beta>0$}\] +% +and has the syntax + +\begin{lstlisting}[style=syntax] +\psGammaDist[options]{x0}{x1} +\end{lstlisting} + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1.2cm,yunit=10cm,plotpoints=200} +\begin{pspicture*}(-0.75,-0.05)(9.5,0.6) + \psGammaDist[linewidth=1pt,linecolor=red]{0.01}{9} + \psGammaDist[linewidth=1pt,linecolor=blue,alpha=0.3,beta=0.7]{0.01}{9} + \psaxes[Dy=0.1]{->}(0,0)(9.5,.6) +\end{pspicture*} +\end{LTXexample} + + +\clearpage +\subsection{$\chi^2$-distribution} +The $\chi^2$-distribution is a continuous probability distribution. It +usually arises when a k-dimensional vector's orthogonal components are +independent and each follow a standard normal distribution. +The length of the vector will then have a $\chi^2$-distribution. + +\iffalse +If Y_i have normal independent distributions with mean 0 and variance 1, then +chi^2=sum_(i==1)^rY_i^2 +(1) + +is distributed as chi^2 with r degrees of freedom. This makes a chi^2 distribution +a gamma distribution with theta=2 and alpha=r/2, where r is the number of degrees of freedom. + +More generally, if chi_i^2 are independently distributed according to a chi^2 +distribution with r_1, r_2, ..., r_k degrees of freedom, then +sum_(j==1)^kchi_j^2 + +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 + +\begin{lstlisting}[style=syntax] +\psChiIIDist[options]{x0}{x1} +\end{lstlisting} + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1.2cm,yunit=10cm,plotpoints=200} +\begin{pspicture*}(-0.75,-0.05)(9.5,.65) + \multido{\rnue=0.5+0.5,\iblue=0+10}{10}{% + \psChiIIDist[linewidth=1pt,linecolor=blue!\iblue,nue=\rnue]{0.01}{9}} + \psaxes[Dy=0.1]{->}(0,0)(9.5,.6) +\end{pspicture*} +\end{LTXexample} + +\iffalse +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}} \\ + + &= 1-\frac{\Gamma(1/2r,1/2\chi^2)}{\Gamma(1/2r)} +\end{align*} +\fi + + + +%The $\chi^2_\nu$-distribution has mode $\nu-2$ for $\nu\geq2$. + +\clearpage +\subsection{Student's $t$-distribution} + +A statistical distribution published by William Gosset in 1908 under his %. His employer, Guinness Breweries, +%required him to publish under a +pseudonym %, so he chosed +"`Student"'. +%Given N independent measurements x_i, let +%t=(x^_-mu)/(s/sqrt(N)), +The $t$-distribution with parameter $\nu$ has the density function +\[ +f(x)=\frac1{\sqrt{\nu\pi}}\cdot + \frac{\Gamma[(\nu+1)/2]}{\Gamma(\nu/2)}\cdot\frac1{[1+(x^2/\nu)]^{(\nu+1)/2}} \qquad +\text{for $-\infty<x<\infty$ and $\nu>0$}\] +% +and the following syntax + +\begin{lstlisting}[style=syntax] +\psTDist[options]{x0}{x1} +\end{lstlisting} + + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1.25cm,yunit=10cm} +\begin{pspicture}(-6,-0.1)(6,.5) + \psaxes[Dy=0.1]{->}(0,0)(-4.5,0)(5.5,0.5) + \psset{linewidth=1pt,plotpoints=100} + \psGauss[mue=0,sigma=1]{-4.5}{4.5} + \psTDist[linecolor=blue]{-4}{4} + \psTDist[linecolor=red,nue=4]{-4}{4} +\end{pspicture} +\end{LTXexample} + + +%The $t_\nu$-distribution has mode 0. + +\clearpage +\subsection{$F$-distribution} +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 +\[ +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 +\text{ for $x>0$ and $\mu$, $\nu>0$}\] +% +and the syntax + +\begin{lstlisting}[style=syntax] +\psFDist[options]{x0}{x1} +\end{lstlisting} +% +The default settings are $\mu=1$ and $\nu=1$. + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=2cm,yunit=10cm,plotpoints=100} +\begin{pspicture*}(-0.5,-0.07)(5.5,0.8) + \psline[linestyle=dashed](0.5,0)(0.5,0.75) + \psline[linestyle=dashed](! 2 7 div 0)(! 2 7 div 0.75) + \psset{linewidth=1pt} + \psFDist{0.1}{5} + \psFDist[linecolor=red,nue=3,mue=12]{0.01}{5} + \psFDist[linecolor=blue,nue=12,mue=3]{0.01}{5} + \psaxes[Dy=0.1]{->}(0,0)(5,0.75) +\end{pspicture*} +\end{LTXexample} + + +\clearpage +\subsection{Beta distribution} + +A general type of statistical distribution which is related to the gamma distribution. +Beta distributions have two free parameters, which are labeled according to one of two +notational conventions. The usual definition calls these $\alpha$ and $\beta$, and the other +uses $\beta^\prime=\beta-1$ and $\alpha^\prime=\alpha-1$. The beta distribution is +used as a prior distribution for binomial proportions in Bayesian analysis. +% +%The plots are for various values of ($\alpha,\beta$) with $\alpha=1$ and $\beta$ ranging from 0.25 to 3.00. +% +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} +\quad\text{ $\alpha,\beta>0$} +\] +% +and has the syntax (with a default setting of $\alpha=1$ and $\beta=1$): + +\begin{lstlisting}[style=syntax] +\psBetaDist[options]{x0}{x1} +\end{lstlisting} +% + + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=10cm,yunit=5cm} +\begin{pspicture*}(-0.1,-0.1)(1.1,2.05) + \psset{linewidth=1pt} + \multido{\rbeta=0.25+0.25,\ired=0+5,\iblue=50.0+-2.5}{20}{% + \psBetaDist[beta=\rbeta,linecolor=red!\ired!blue!\iblue]{0.01}{0.99}} + \psaxes[Dy=0.2,Dx=0.1]{->}(0,0)(1,2.01) +\end{pspicture*} +\end{LTXexample} + + +\iffalse +\clearpage +\subsection{Bose-Einstein distribution} +A distribution which arises in the study of integer 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}} +\] +% +and has the syntax (with a default setting of $s=1$ and $\mu=1$): + +\begin{lstlisting}[style=syntax] +\psBoseEInsteinDist[options]{x0}{x1} +\end{lstlisting} +\fi \clearpage @@ -777,9 +1035,9 @@ If $r$ is a rational, then a superellipse is algebraic. However, for irrational it is transcendental. For even integers $r=n$, the curve becomes closer to a rectangle as $n$ increases. The syntax of the \verb+\psLame+ macro is: -\begin{verbatim} +\begin{lstlisting}[style=syntax] \psLame[settings]{r} -\end{verbatim} +\end{lstlisting} It is internally ploted as a parametric plot with $0\le\alpha\le360$. Available keywords are \verb+radiusA+ and \verb+radiusB+, both are preset to 1, but can have any valid value @@ -811,9 +1069,9 @@ pixel needs $120$ thousand calculations of the function value. The user still de this area in his own coordinates, the translation into pixel (pt) is done internally by the macro. -\begin{verbatim} +\begin{lstlisting}[style=syntax] \psplotImp[<options>](xMin,yMin)(xMax,yMax){<function f(x,y)>} -\end{verbatim} +\end{lstlisting} The function must be of $f(x,y)=0$ and described in PostScript code, or alternatively with the option \verb+algebraic+ (\verb+pstricks-add+) in an algebraic form. No other value names than $x$ and $y$ @@ -901,9 +1159,9 @@ for polar plots are also possible (see next example). This macro shows the behaviour of a rotated function around the x-axis. -\begin{verbatim} +\begin{lstlisting}[style=syntax] \psVolume[<options>](xMin,xMax){<steps>}{<function f(x)>} -\end{verbatim} +\end{lstlisting} $f(x)$ has to be described as usual for the macro psplot. @@ -1023,9 +1281,10 @@ $f(x)$ has to be described as usual for the macro psplot. \section{\CMD{psPrintValue}}\label{sec:printValue} This new macro allows to print single values of a math function. It has the syntax -\begin{verbatim} + +\begin{lstlisting}[style=syntax] \psPrintValue[<options>]{<PostScript code>} -\end{verbatim} +\end{lstlisting} Important is the fact, that \CMD{psPrintValue} works on \PS\ side. For \TeX\ it is only a box of zero dimension. This is the reason why you have to put it into a box, which reserves horizontal @@ -1074,13 +1333,14 @@ valuewidth & <number> & 10 & the width of the string for the converted \section{Credits} -Denis Girou | Manuel Luque | Timothy Van Zandt - +Gerry Coombes | Denis Girou | Christophe Jorssen | Manuel Luque | Timothy Van Zandt +\bgroup +\raggedright \nocite{*} \bibliographystyle{plain} \bibliography{pst-func-doc} - +\egroup \end{document} |