random value given a standard normal distribution and mean? - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: random value given a standard normal distribution and mean? (/thread-8987.html) |
random value given a standard normal distribution and mean? - Agamemnus - 03-07-2006 I am trying to do a simulation of projected sales. I can't get my head around how to create a random number that follows a certain probability distribution, specifically the standard normal distribution. Given a mean of sample_mean and a standard deviation of sample_sd, how can I get a random number off of them? Anyone? Here is a website that does this, but I can't convert the .class files into meaningful code... http://www-stat.stanford.edu/~naras/jsm/FindProbability.class random value given a standard normal distribution and mean? - DrV - 03-07-2006 You might be better off with the source. random value given a standard normal distribution and mean? - Agamemnus - 03-07-2006 Hey, thanks, but that's actually not it, er.. it doesn't give a random number. random value given a standard normal distribution and mean? - DrV - 03-07-2006 Hmm, you're right... I didn't actually read it. :oops: No idea then, sorry... I think I've read about such things before, but the importance of having "good" random numbers escaped me at the time (and still does )... random value given a standard normal distribution and mean? - Agamemnus - 03-08-2006 I figured out a nice way to translate the sample into a distribution from which you can draw random vars from. Code: for j = 1 to test_var_amount random value given a standard normal distribution and mean? - Zack - 03-08-2006 Why not just do this (for instance): Code: [pseudocode] random value given a standard normal distribution and mean? - Antoni Gual - 03-08-2006 Use the RND to index in an acumulated distribution table... Or as an entry to a function returning the acumulated distribution. random value given a standard normal distribution and mean? - Agamemnus - 03-09-2006 Antoni Gual: Yeah, it is a good way to do it, but you need to actually create the distributions first for each value.. Zack, that's basically what Antoni is suggesting except a lot more convoluted. :wink: But it's ok, I figured it out. |