Solving normcdf for sigma

4 visualizaciones (últimos 30 días)
Jovita Yip
Jovita Yip el 8 de Abr. de 2018
Comentada: Torsten el 9 de Abr. de 2018
Hello
I am trying to solve the following equation for sigma but keep encountering errors: normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)=0.02 The code I've entered is: syms sigma solve(normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)==0.02)
Any help would be greatly appreciated.
Thanks

Respuestas (1)

John D'Errico
John D'Errico el 8 de Abr. de 2018
The symbolic toolbox does not understand normcdf very well. But fzero will work just fine.
fun = @(sigma) normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)-0.02;
[sigma,fval] = fzero(fun,1)
sigma =
0.59835074767517
fval =
1.73472347597681e-17
As a test:
normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)
ans =
0.02
If you really, absolutely needed the utmost accuracy (why???) you could use the transformation for normcdf into erf. But that makes absolutely no sense in this context, since you have only 3 significant digits on your other numbers.
  4 comentarios
Jovita Yip
Jovita Yip el 9 de Abr. de 2018
I tried switching the 0.02 to 0.98 because this would then calculate all the values within the specifications? However, it produces NaN.
Torsten
Torsten el 9 de Abr. de 2018
I suggest that you plot the function
fun = @(sigma) normcdf(1.43,1.415,sigma)-normcdf(1.4,1.415,sigma)-0.98;
to see where its zero is approximately located.
Best wishes
Torsten.

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by