Creating a Normal Probability Curve
Mostrar comentarios más antiguos
Hello,
I have a problem. I want to create a probability density function for a distribution. Initialy the only known values were the maximum and the minimum 95th percentile of the distribution. With maximum at 1.5 and minimum 0.66.
Using these values I calculated the mu = 1.08 and sigma = 0.24, based on 0.66 = mu - 2*sigma and 1.5 = mu +2*sigma But the problem is that whenever I insert the code in Matlab the probability density function graph is going over 1
This is my code
% Drag Coefficient
mu = 1.08;
sigma = 0.24;
x = (mu - 5 * sigma) : (sigma / 100) : (mu + 5 * sigma);
pdfNormal = normpdf(x, mu, sigma);
string = 'the maximal pdfNormal is';
string = sprintf('%s :%d', string,max(pdfNormal));
disp(string)
plot(x, pdfNormal);
Thank you in advance for your reply :)
3 comentarios
Torsten
el 11 de Ag. de 2016
Why do you think it should not exceed 1 ?
Best wishes
Torsten.
Georgios Vamvakopoulos
el 11 de Ag. de 2016
Torsten
el 11 de Ag. de 2016
You mean
normcdf(x,mu,sigma)
?
Best wishes
Torsten.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Triangular Distribution en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!