[pstricks] CDF GAUSS OPERATOR

Matthias Ruess matthias.ruess at db.com
Fri Oct 29 13:40:53 CEST 2010


Hi,
I am trying to introduce a new CDF-normal operator (GAUSSI) to 
pst-math.pro.
Unfortunately, the code does not work. What am I doing wrong? Any Ideas?

/GAUSSI {dup mul 2 mul  %x mu 2*sigma^2     3 Elements
dup                     %x mu 2*sigma^2 2*sigma^2     4 Elements
4 -2 roll               %2*sigma^2 2*sigma^2 x mu     4 Elements
t exch                  %2*sigma^2 2*sigma^2 x t mu     5 Elements
sub dup mul             %2*sigma^2 2*sigma^2 x (t-mu)^2     4 Elements
4 -1 roll               %2*sigma^2 x (t-mu)^2 2*sigma^2     4 Elements
div neg                 %2*sigma^2 x -(t-mu)^2/(2*sigma^2)     3 Elements
EXP                     %2*sigma^2 x exp(-(t-mu)^2/(2*sigma^2))     3 
Elements
3 -1 roll               %x exp(-(t-mu)^2/(2*sigma^2)) 2*sigma^2     3 
Elements
PI mul                  %x exp(-(t-mu)^2/(2*sigma^2)) 2*sigma^2*Pi     3 
Elements
sqrt div                %x exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi)  
2 Elements
{ exch } 0.001          %x { exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) 
} .001     5 Elements
-10 /t                  %x { exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) 
} .001 -10 /t     7 Elements   Note:-10 is an approximation for -infinity
7 -1 roll               %{ exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) } 
.001 -10 /t x     7 Elements
exch                    %{ exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) } 
.001 -10 x /t     7 Elements
7 -4 roll               %-10 x /t { 
exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) } .001     7 Elements
SIMPSON                 %-10 x /t { 
exp(-(t-mu)^2/(2*sigma^2))/sqrt(2*sigma^2*Pi) } .001 SIMPSON   8 Elements
} bind def

\documentclass[a4paper,10pt]{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{pst-plot}
\begin{document}
    \psset{xunit=0.7, yunit=4}
    \begin{pspicture}(-6,0)(6,1.1)
        \psaxes[Ox=0, dy=0.1, Dy=0.1]{->}(0,0)(-6,0)(6,1.1)
        \psplot[plotpoints=1000, linecolor=red,linewidth=1.5pt]{-5}{5}{x 0 
1 GAUSS}        %PDF N(0,1)
        \psplot[plotpoints=1000, linecolor=blue,linewidth=1.5pt]{-5}{5}{x 
0 1 GAUSSI}     %CDF N(0,1) 
    \end{pspicture}
\end{document}

Mit freundlichen Grüßen / Kind regards,
Matthias

-- 

Informationen (einschließlich Pflichtangaben) zu einzelnen, innerhalb der EU tätigen Gesellschaften und Zweigniederlassungen des Konzerns Deutsche Bank finden Sie unter http://www.deutsche-bank.de/de/content/pflichtangaben.htm. Diese E-Mail enthält vertrauliche und/ oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for information (including mandatory corporate particulars) on selected Deutsche Bank branches and group companies registered or incorporated in the European Union. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20101029/ef01c51f/attachment.html>


More information about the PSTricks mailing list