[pstricks] Smoothing Logistic Curves
Michael Sharpe
msharpe at ucsd.edu
Mon Oct 26 19:55:55 CET 2009
Rich,
I don't see any problems when I run this code. Here's my file list and
my final output pdf.
Michael
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
pstricks-add.sty 2009/03/17 v. 0.13 package wrapper for pstricks-
add.tex (hv
)
pstricks.sty 2008/11/26 v0.40 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex 2009/05/19 v1.29 `PSTricks' (tvz,hv)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pstricks-add.tex 2009/05/25 v3.34 `PSTricks-add' (hv)
pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
xkeyval.sty 2008/08/13 v2.6a package option processing (HA)
xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
pst-func.sty 2008/03/21 package wrapper for pst-func.tex (hv)
pst-func.tex 2009/10/08 v0.60 `PST-func' (hv)
***********
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scurve1.pdf
Type: application/pdf
Size: 8809 bytes
Desc: not available
URL: <http://tug.org/pipermail/pstricks/attachments/20091026/668d3793/attachment-0001.pdf>
-------------- next part --------------
On Oct 26, 2009, at 11:26 AM, Rich Shepard wrote:
> Thanks to Michael Sharpe (for the PostScript code for logistic and
> Gaussian curves) and Herbert Voss for fine-tuning the axes template
> code,
> I'm much closer to achieving what I need, and understanding what I'm
> doing,
> too.
>
> The following code produces a nice S-curve (a logistic curve) over
> a large
> domain on the x-axis. I assume that the jagged changes at the lower
> left and
> upper right are the results of the asymptotic approach to the limits
> of the
> y-axis. Is there a way to make the curve appear more smooth near the
> extremes?
>
> \documentclass[letterpaper,10pt]{article}
> \usepackage{pstricks-add,pst-func}
>
> \makeatletter
> \pst at addfams{pst-morefunc}
> \define at key[psset]{pst-morefunc}{sigma}{\def\psk at sigma{#1 }\def
> \psk at var{#1 #1 mul }}
> \define at key[psset]{pst-morefunc}{var}{\def\psk at var{#1 }\def
> \psk at sigma{#1 sqrt }}
> \define at key[psset]{pst-morefunc}{mu}{\def\psk at mu{#1 }}
> \define at key[psset]{pst-morefunc}{lscale}{\def\psk at lscale{#1 }}
> \def\gaussfn{ Euler x \psk at mu sub dup mul 2 div \psk at var div neg exp }
> \def\Scurve{1 1 Euler x \psk at mu sub \psk at lscale div neg exp add
> div } \def\Zcurve{Euler x \psk at mu sub \psk at lscale div neg exp dup 1
> add div }
> \makeatother
> \begin{document}
> \psset{axesstyle=axes,Dx=10,Dy=0.25,tickstyle=bottom,
> llx=-1.5cm,lly=-1.1cm,urx=1mm,ury=1mm,
> xAxisLabel=Domain,xAxisLabelPos={c,-0.2},
> yAxisLabel={Membership Grade ($\mu$)},yAxisLabelPos={-14,c}}
> \begin{psgraph}(0,0)(100,1){10cm}{5cm}
> \psplot[mu=50,lscale=10,linewidth=1.0pt,linecolor=blue]{0}{100}
> {\Scurve}
> \end{psgraph}
>
> \end{document}
>
>
> --
> Richard B. Shepard, Ph.D. | Integrity
> Credibility
> Applied Ecosystem Services, Inc. | Innovation
> <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax:
> 503-667-8863
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
More information about the PSTricks
mailing list