Shahgee
Shahgee

Reputation: 3405

Probability of variable using Matlab

I have a variable x and its standard deviation sigma. I know , mean mu .How can I compute probabilty of x (using normal distribution ) that it is less / greater than limit a or inbetween limits a and b by using Matlab?

Upvotes: 1

Views: 4821

Answers (3)

George
George

Reputation: 3845

Probability that x is less than a:

normcdf(a,mu,sigma)

Probability that x is between a and b (b > a):

normcdf(b,mu,sigma) - normcdf(a,mu,sigma)

Upvotes: 5

jonsca
jonsca

Reputation: 10381

By integrating the probability density function: enter image description here

In practice, this is usually done by plugging values into the error function, which is erf(x) in Matlab. erf(x) is the integral of the above function.

Upvotes: 0

Mauro
Mauro

Reputation: 2070

Y = normpdf(X,mu,sigma)

See http://www.mathworks.com/help/toolbox/stats/normpdf.html

Upvotes: 1

Related Questions