What are the differences between the various Gaussian functions in Matlab?

What are the main differences between these three functions?

+4
source share
2 answers

Y = normpdf(X,mu,sigma)- probability density function for a normal distribution with mean muand sigmastdev. Use this if you want to know the relative probability at a pointX

R = normrnd(mu,sigma)takes random samples from the same distribution as above. So use this function if you want to model something based on a normal distribution.

y = gauss(x,s,m)at first glance it looks exactly the same as normpdf. But there is a slight difference: its calculation

Y = EXP(-(X-M).^2./S.^2)./(sqrt(2*pi).*S)

while normpdfusing

Y = EXP(-(X-M).^2./(2*S.^2))./(sqrt(2*pi).*S)

, gauss() -inf inf 1/sqrt(2). PDF, , - .

p = normcdf(x,mu,sigma). . , -inf x.

+6

, :

. gauss , Mathworks, , Matlab.

, normpdf, normrnd " " , . , , Matlab. , normrnd, randn, Matlab.

+4

Source: https://habr.com/ru/post/1679541/


All Articles