1. ## Random Number Generation

hello ,veryone!
I have a problem with number generator of IMSL 5.0 for C#.
How can I find random number for normal distribution other than N(0,1) , for example N(29,5.2)? Which function should I use and how?
eagerly Regards

2. You can use Random.NextNormal() or Random.NextNormalAR() to get a random number that fits N(0, 1). To fit this to N(m, s) first multiply the output by s then add m.

N(m, s) = s * N(0, 1) + m.

3. ## thanks for your help, manager

i have another question:
int nObservations = 1000;
Imsl.Stat.Random r = new Imsl.Stat.Random(123457);
for (int i = 0; i < nObservations; i++)
{
double rn = r.NextNormal();
}
when the code run,why the variable rn has Negative phenomena?

4. The Random.NextNormal() will give you a random number that falls into the normal distribution with mean=0 and std.dev=1, so about half of the values should be negative.

5. ## thank you ，manager very much

i get it!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•