Results 1 to 7 of 7

Thread: sampling from defined distribution?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    5

    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

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: sampling from defined distribution?

    Not entirely sure what you are asking for help with here...
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    5

    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?

  4. #4
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: sampling from defined distribution?

    Which bit don't you know how to do? Monte Carlo simulations? Generating a distribution? Sampling from a distribution?
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2007
    Posts
    5

    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.

  6. #6
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    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
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  7. #7
    Addicted Member Rassis's Avatar
    Join Date
    Jun 2004
    Location
    Lisbon
    Posts
    248

    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
    Attached Files Attached Files
    ...este projecto dos Deuses que os homens teimam em arruinar...

Posting Permissions

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



Click Here to Expand Forum to Full Width