[R] function of probability for normal distribution
Greg.Snow at imail.org
Thu Jan 20 18:19:06 CET 2011
I don't seem to remember signing up to have R-help be my personal e-mail :-)
It is common to use phi to represent the standard normal distribution (with mean 0, and variance 1), the "script/small/lower case" version is for the distribution (height of the bell curve) and the "block/capitol/upper case" is for the cumulative distribution.
So for arbitrary mean and variance you get 1/sigma * phi( (x-mu)/sigma ).
The general idea for any truncated distribution is that it will have the same shape as the non-truncated version, it just needs to be scaled so that the area is 1, the proper scaling is just the area under the original. So the formulas you see on that page start with the regular normal (phi) divided by the area under the curve between A and B which is just the difference in the cumulative distribution at those 2 points.
In R dnorm will correspond to phi and pnorm to PHI. You could use the exact formulas on that page, but it would be simpler to use the arguments to dnorm and pnorm.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of JClark
> Sent: Wednesday, January 19, 2011 4:04 PM
> To: r-help at r-project.org
> Subject: Re: [R] function of probability for normal distribution
> Dear Greg Snow,
> I'm a biologist trying to write a mathematical formula for a doubly
> truncated normal distribution to be used in the language "R". I realise
> is simple stuff for a mathematician but I'm stumped.
> Wikipedia gives what seems a fairly simple formula - with function =
> with mean and standard deviation - but also phi - WHAT IS PHI !!?? -
> especially how do I write this in "R" and why is the top "phi" in
> italics ??
> Hoping you can help.
> Yours sincerely,
> Jeremy Clark
> View this message in context: http://r.789695.n4.nabble.com/Re-R-
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help