Normal Random Generator

M

miong

Hi,

I am working on a simulation project in Excel/VBA and
need to generate normal random variables by function
Norminv. The compiler doesn't know this function. I guess
that I have to select/add a certain Add-In to activate
this function. Does anyone know which Add-In or how to
use this function in VBA?

Thanks

Ming
 
M

Michael R Middleton

Ming -
I am working on a simulation project in Excel/VBA and need to generate
normal random variables by function Norminv. The compiler doesn't know this
function. I guess that I have to select/add a certain Add-In to activate
this function. Does anyone know which Add-In or how to use this function in
VBA? <

Use the same approach you would use with any worksheet function in VBA:

Result = Application.WorksheetFunction.Norminv(prob,mean,stdev)

Be aware of numerical inaccuracies of Norminv in pre-2002 versions of Excel.

- Mike Middleton, www.usfca.edu/~middleton
 
J

Jerry W. Lewis

Michael said:
Ming -


normal random variables by function Norminv. The compiler doesn't know this
function. I guess that I have to select/add a certain Add-In to activate
this function. Does anyone know which Add-In or how to use this function in
VBA? <

Use the same approach you would use with any worksheet function in VBA:

Result = Application.WorksheetFunction.Norminv(prob,mean,stdev)

Be aware of numerical inaccuracies of Norminv in pre-2002 versions of Excel.


Actually you need 2003 for this to be a reasonable RNG method. 2002 has
a better inverse of NormSDist than previous versions, but NormSDist is
still lousy in the tails till 2003.

Jerry
 

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

Top