fAnSKyer said:
When using random we can get a uniform data sample. But how to transfer
this sample in to a Guassion Sample? Thanks? Did C or C++ provide any
function to do this?
Not built in for most compilers. Also, the built in random function
isn't very good. Probably you won't want to use it for anything
more important than games. And maybe not even then.
The basic idea is, you use the shape of the distribution you
want to generate, and modify the values from a uniform
generator to put them into the range you want.
For an easy to understand introduction to the topic, take a
look at _Numerical Recipes in C_. But be sure to keep in
mind that it should only be treated as an introduction.
There is quite a large literature on random num generation.
Depending on your requirements, you may need a very good
random num generator. You may need to worry about such
things as the repeat cycle, the stride, various statistics, etc.
The words "Monte Carlo" in your subject line tend to make
me think you need at least a medium good generator.
You should look round the net for some libs that provide better
random nums. There are several, and several free ones.
Be sure to read carefully the promises that the docs that
come with such libs make. Or fail to make. And you should
hunt round the net for revues of any lib before you use it.
Socks