[pstricks] graphs of the t-distribution?

Alan Ristow ristow at ece.gatech.edu
Thu Feb 16 23:55:32 CET 2006


Ryan Higginbottom wrote:
> Dear PSTricks list:
> 
> I have searched a bit online for the tools to do this, but I have yet to
> find the answer.  I would like to plot the t-distribution and the standard
> normal distribution on the same set of axes.  I have found the \psGauss
> command to handle the standard normal distribution.  Is there any similar
> macro to draw a t-distribution with n degrees of freedom?  If not, does
> anyone have any suggestions for me?

In theory you could do it with \psplot, provided you know how to write 
mathematical expressions in Postscript. From a practical perspective, 
though, I think trying to compute the definite integral in the gamma 
function might be tricky. I've never tried anything that advanced with 
\psplot, but as I recall Postscript uses 8-bit arithmetic for its 
calculations -- even if you figure out how to program it, you might have 
problems with roundoff error.

If you only need to do it once or twice, I'd suggest computing the curve 
using another piece of software and using \listplot to plot it. If you 
scale it correctly, you should be able to plot it together with \psGauss 
on the same axis. I wouldn't bother trying to program the t-distribution 
in Postscript unless it's something you have to do a lot.

Hope that helps.

Alan




More information about the PSTricks mailing list