Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hi there I am trying to create a function that will grab random values from a given distribution (lognormal and beta in particular). I am currently using the following code for lognormal: dblValue = Application.WorksheetFunction.LogInv(Rnd(), v1, v2) where v1 is my mean and v2 is my standard deviation. But each time I try to run it, I get the error "Unable to get the LogInv property of the Worksheet Function class" Any suggestions? -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What are the values in V1 and V2 when that line runs?
V2 better be greater than 0. leebean337 wrote: Hi there I am trying to create a function that will grab random values from a given distribution (lognormal and beta in particular). I am currently using the following code for lognormal: dblValue = Application.WorksheetFunction.LogInv(Rnd(), v1, v2) where v1 is my mean and v2 is my standard deviation. But each time I try to run it, I get the error "Unable to get the LogInv property of the Worksheet Function class" Any suggestions? -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Hey, v1=8500 (mean) v2=3000 (sd) I figured out the first part of the problem, that being that my values are too large and excel can't handle the resulting figures. Also, when I change v1=ln(8500) and v2=ln(3000) I end up with a result (and even a decent one!) But I'm still concerned that I'm not actually suppose to modify my specified mean and sd. What do you think? Thanks -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's been way too long since my last stats course.
But maybe someone will chime in. leebean337 wrote: Hey, v1=8500 (mean) v2=3000 (sd) I figured out the first part of the problem, that being that my values are too large and excel can't handle the resulting figures. Also, when I change v1=ln(8500) and v2=ln(3000) I end up with a result (and even a decent one!) But I'm still concerned that I'm not actually suppose to modify my specified mean and sd. What do you think? Thanks -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See Help for LOGINV. You are attempting to calculate EXP(8500+3000*x) where
it should be true that ABS(x)<38. EXP(8500) is about 12 orders of magnitude larger than the largest number that Excel can calculate. Jerry "leebean337" wrote: Hey, v1=8500 (mean) v2=3000 (sd) I figured out the first part of the problem, that being that my values are too large and excel can't handle the resulting figures. Also, when I change v1=ln(8500) and v2=ln(3000) I end up with a result (and even a decent one!) But I'm still concerned that I'm not actually suppose to modify my specified mean and sd. What do you think? Thanks -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
What version of Excel? Try just Application.LogInv(). Version of Excel
prior to 97 did not support the WorksheetFunction keyword. Jerry "leebean337" wrote: Hi there I am trying to create a function that will grab random values from a given distribution (lognormal and beta in particular). I am currently using the following code for lognormal: dblValue = Application.WorksheetFunction.LogInv(Rnd(), v1, v2) where v1 is my mean and v2 is my standard deviation. But each time I try to run it, I get the error "Unable to get the LogInv property of the Worksheet Function class" Any suggestions? -- leebean337 ------------------------------------------------------------------------ leebean337's Profile: http://www.excelforum.com/member.php...o&userid=31099 View this thread: http://www.excelforum.com/showthread...hreadid=507712 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Generate random numbers between two values and with a given mean | Excel Worksheet Functions | |||
How can I get Positive values only from the random number generat. | Excel Discussion (Misc queries) | |||
Generating Correlated Random Values in Excel | Excel Discussion (Misc queries) |