# How to convert an approximation of CCDF for a standard normal to an approximation with a different mean and variance?

Abramowitz and Stegun give an approximation for the standard normal's complementary cumulative distribution function (CCDF) in Formula 26.2.23

I understand this to be an approximation for when $\mu = 0$ and $\sigma = 1.$ Is there a procedure to transform the coefficients to generate an approximation fitting a CCDF for different values of $\mu$ and $\sigma?$

– 1ijk
Commented Jan 25, 2018 at 18:29
• You might get more useful help here if (a) you define your terminology ('CCDF' is hardly standard terminology, seems to to be used in A&S, and apparently does not mean what I guessed), (b) if you include the restriction on $p$ specified by A&S, and (c) you explain the application you have in mind. Commented Jan 25, 2018 at 19:10
• @BruceET I'm mainly tinkering around. This blog post presents a literate program for computing an inverse normal CDF. The author uses A&S 26.2.23 as a starting point. It's clear, however, that the formula and resulting code specify the inverse function for just the standard norm, hence my question about different mean and standard deviation params. One application might be an analog to Excel's NORMINV(x, mean, standard_deviation). I plan to ask specific questions about the code in SO; just want to know more about the mathematics here.
– 1ijk
Commented Jan 25, 2018 at 22:08
• More on this below. Commented Jan 26, 2018 at 3:37

Comment (with room for notation and code).

In R statistical software the standard normal CDF $\Phi$ is denoted as pnorm: that is, $P(Z \le 1.96) = 0.975,$ where $Z \sim \mathsf{Norm}(\mu=0, \sigma=1).$

pnorm(1.96)
[1] 0.9750021


Also, the inverse CDF $\Phi^{-1}$ or 'quantile function' of $Z$ is denoted as qnorm: that is $c = 1.96$ has $P(Z \le c) = 0.975.$

> qnorm(.975)
[1] 1.959964


The CDF of $X \sim \mathsf{Norm}(\mu, \sigma),$ for general mean $\mu$ and standard deviation $\sigma$ is denoted by pnorm with the mean as the second argument and the SD as the third. And similarly for the quantile function qnorm. Letting $\mu = 100$ and $\sigma = 10,$ we have:

> qnorm(.975, 100, 10)
[1] 119.5996
> pnorm(119.6, 100, 10)
[1] 0.9750021


The relationship between the quantile function of standard normal and the quantile function of $\mathsf{Norm}(100, 10)$ is suggested by:

> (qnorm(.975, 100, 10) - 100)/10
[1] 1.959964

> qnorm(.975)*10 + 100
[1] 119.5996


Maybe this answers some of your questions. I will leave it to you to put this into your favorite notation.

Notes: I believe you may want to use the quantile function to generate random samples from a normal distribution. In R, the straightforward way is to use the function rnorm with appropriate parameters.

set.seed(125);  rnorm(5)  # Sample of 5 from NORM(0,1)
[1]  0.93332697 -0.52503178  1.81443979  0.08304562  0.39571880


The method behind rnorm is to use pseudorandom numbers that behave as a random sample from $\mathsf{Unif}(0,1)$ followed by a rational approximation of $\Phi^{-1}$ due to Michael Wichura. The approximation is accurate to within the ability of R to represent results in double precision. This can be demonstrated by generating a single standard normal observation, as shown below. (You can read more about this on the R documentation page for rnorm .)

> set.seed(125);  rnorm(1)        # One simulated observation from NORM(0,1)
[1] 0.933327
> set.seed(125);  qnorm(runif(1)) # Same seed, emulates 'rnorm', same result
[1] 0.933327


To simulate an observation from $\mathsf{Norm}(100, 10),$ we can use:

> set.seed(125);  qnorm(runif(1))*10 + 100
[1] 109.3333
> set.seed(125);  rnorm(1, 100, 10)
[1] 109.3333

• this sounds like what I needed, thank you. I did realize at some point that "quantile function" is the usual nomenclature for this sort of thing. Coincidentally, I came across Wichura's 1988 paper giving the approximations.... so I'm glad you've confirmed I'm on the right track!
– 1ijk
Commented Jan 26, 2018 at 15:08