find sigma for known normcdf parameters

2 views (last 30 days)
Hi,
Knowing p, x and mu I would like to find the corresponding sigma for p = normcdf(x,mu,sigma). I tried with the symbolic toolbox using the following code but it failed.
syms x mu sigma
p = 1/2 - erf((2^(1/2) * (mu - x)) / (2 * sigma)) / 2
solve(p,sigma)
Thanks in advance for your help,
Philippe

Accepted Answer

asm8086
asm8086 on 11 Aug 2011
A friend of mine found the solution :
sigma = 0.5 * (2^(1/2) * (mu - x)) / erfinv(2*(1/2-p))

More Answers (1)

Walter Roberson
Walter Roberson on 11 Aug 2011
That can be rearranged so that the essential part is solving an equation of the form erf(t)=r for t. Unfortunately I have not found a useful analytic method of solving that.
It appears that there is a real solution if and only if p is in the range 0 to 1; however, if mu = x then any non-zero sigma satisfies the equation.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!