sampling from defined distribution?
hey guys,
i'm trying to run some monte carlo simulations and need to draw a sample from a distribution which is defined by its parameters (e.g.a normal distribution with given mean and stdev).
i have no idea how to do this. any help would be much appreciated. thanks.
-j
Re: sampling from defined distribution?
Not entirely sure what you are asking for help with here...
Re: sampling from defined distribution?
Quote:
Originally Posted by zaza
Not entirely sure what you are asking for help with here...
i just dont know how to do this in VB. i have no clue what sort of sub or functions you'd need to do this... i've tried searching the forums...but am not getting much. is there some critical keyword i'm lacking?
Re: sampling from defined distribution?
Which bit don't you know how to do? Monte Carlo simulations? Generating a distribution? Sampling from a distribution?
Re: sampling from defined distribution?
Quote:
Originally Posted by zaza
Which bit don't you know how to do? Monte Carlo simulations? Generating a distribution? Sampling from a distribution?
both generating and sampling from a distribution.
Re: sampling from defined distribution?
There's a link in my sig to some code for generating a Gaussian random number distribution. In the past I have used this to generate n random numbers, scaled appropriately and then fed each into the bootstrap Monte Carlo method to generate the results.
The generator is effectively the same as the sample from a Gaussian, and of course you can run it many times over to get a number of different possibilities.
zaza
1 Attachment(s)
Re: sampling from defined distribution?
I don´t know how to do it in VB but it is quite easy to do it in MS-EXCEL. I think it won´t be difficult for you to translate the code in cell I15 in sheet "data and Results" into VB.
To get new random values from the Normal distribution with parameters entered in cells I6 and I7, just press the function key F9.
Rui