The equivalent of normalpdf()?

T

TogaKangaroo

A question I'm sure has come up before, but does anyone know how to
write/where to find the std for the equivalent of the normalpdf(X, mu,
sigma) function in matlab? For anyone who does not know what that is
it is the equivalent of finding the probability of X in a normal
distribution with mean mu and standard deviation sigma?
 
V

Victor Bazarov

TogaKangaroo said:
A question I'm sure has come up before, but does anyone know how to
write/where to find the std for the equivalent of the normalpdf(X, mu,
sigma) function in matlab?

If this question has come up before, you should be able to find the
answer to it on Google Groups (http://groups.google.com/)
For anyone who does not know what that is
it is the equivalent of finding the probability of X in a normal
distribution with mean mu and standard deviation sigma?

The Standard library doesn't have any probability functions. You
should try finding a suitable library on the Web. See the archives
on Google for the "Available C++ Libraries FAQ" posted here by Nikki
Locke about monthly. Follow the link in that post.

V
 
A

Alf P. Steinbach

* Victor Bazarov:
TogaKangaroo said:
A question I'm sure has come up before, but does anyone know how to
write/where to find the std for the equivalent of the normalpdf(X, mu,
sigma) function in matlab?

If this question has come up before, you should be able to find the
answer to it on Google Groups (http://groups.google.com/)
For anyone who does not know what that is
it is the equivalent of finding the probability of X in a normal
distribution with mean mu and standard deviation sigma?

The Standard library doesn't have any probability functions. You
should try finding a suitable library on the Web. See the archives
on Google for the "Available C++ Libraries FAQ" posted here by Nikki
Locke about monthly. Follow the link in that post.


Or just Google for a definition of the function.

When I tried that the third Google hit gave a definition.

Now just translate that to C++, which should be trivial since all that's
needed is in the language and the standard library (header <cmath>), with
one exception: you'll have to compute pi, e.g. from arc cos, but this can be
done once at program startup.
 
R

red floyd

Alf said:
you'll have to compute pi, e.g. from arc cos, but this can be
done once at program startup.

Isn't M_PI included by reference from <math.h> via <cmath>?
 
J

Jack Klein

Isn't M_PI included by reference from <math.h> via <cmath>?

There is no M_PI macro in either standard C or standard C++. An
implementation cannot define this symbol in a standard header if
invoked in strictly conforming mode.
 
A

Alf P. Steinbach

* red floyd:
Isn't M_PI included by reference from <math.h> via <cmath>?

It isn't standard but often exists.

I don't any longer have an installation of the OP's compiler so can't check
that.
 
T

TogaKangaroo

I'm sorry, but that is incredibly unhelpful...I've been trying...what
did you search for to find pseudocode? A simple link would be real
nice if you found it. Yes, I see the thing from codecogs, but I don't
have an account there so it's really just taunting me...much like you
are.
Also, I certainly would try to find it in the forum but there's not
exactly a phrase to search for is it? "normpdf" and "normal pdf"
didn't give me anything, I'm lost after that.
I'm sorry for reposting uninteresting questions but I figure that the
veterans could easily redirect me and the subject could die off quickly.
 
F

Free Bird

TogaKangaroo said:
Also, I certainly would try to find it in the forum but there's not
exactly a phrase to search for is it? "normpdf" and "normal pdf"
didn't give me anything, I'm lost after that.

Try normal probability distribution function.
 
A

Alf P. Steinbach

* TogaKangaroo:
I'm sorry, but that is incredibly unhelpful...I've been trying...what
did you search for to find pseudocode?

"normalpdf"

Which gave a formula. Pseudocode is something else and irrelevant here.

That wasn't so incredibly hard, was it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top