Hi
It's a great idea to publish some probability logic, and of course the Gaussian
is an obvious place to start - I was actually a little surprised to find that
there was no built-in support for this most fundamental of distributions.
I note that you are missing a function for the CDF itself - here's one I made
earlier (ref http://www.jstatsoft.org/v11/i04/v11i04.pdf)
phi =: (%: o.2) %~ [: ^ [: - 2 %~ *:
smoo =: (+/ @ }: @ ]) , ((*: @ [) * (({. % {:) @ }. @ ])) , (2 + {: @ ])
Phi_recursion =: (smoo ` ]) @. (({. = +/) @ }: @ ])
Phi =: 0.5 + phi * {. @ (] (Phi_recursion ^: _) 0 , ] , 3:) " 0
Ali
----- Original Message ----
From: Ewart Shaw <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Wednesday, 1 November, 2006 5:00:12 PM
Subject: [Jprogramming] Algorithm for Inverse Normal CDF (Work in Progress)
I'm currently rationalising my J code for probability distributions.
Many published algorithms are in FORTRAN, and translating into J is
(at least initially) a compromise between transliteration (which
makes errors easier to spot) and reinterpretation.
I've put an initial example under the JWiki
-> Code Workshop -> Work in Progress -> EwartShaw/N01CdfInv
Anyone who needs the inverse Normal CDF (aka 'quantile function'
or 'normal deviates') might find it useful. See the Wiki page
for further comments.
-- Ewart Shaw
J.E.H.Shaw [Ewart Shaw] [EMAIL PROTECTED] TEL: +44 2476 523069
Department of Statistics, University of Warwick, Coventry CV4 7AL, UK
http://www.warwick.ac.uk/statsdept http://www.ewartshaw.co.uk
Will read usenet posts up to the first insult (which may be in the Subject)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
Send instant messages to your online friends http://uk.messenger.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm