Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 22 of 22

Thread: Geometric Brownian Motion Help

  1. #21
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,718
    Location
    They are not true random numbers, they are pseudo-random numbers (PRN) and I guess the 'pseudo' depends on many things

    I have two functions that I got somewhere (but can't find a reference) that generates an array of better PRN, including a normal distribution version


    Function RandomNumberArray(Optional n As Long = 1000, Optional LowerLimit As Double = 0#, Optional UpperLimit As Double = 1#, Optional RoundDecimals As Long = 15) As Variant
    
    
    Function RandomNormalArray(Optional n As Long = 1000, Optional SampleMean As Double = 0#, Optional SampleSigma As Double = 1#, Optional RoundDecimals As Long = 15) As Variant

    Capture.JPG


    The Green are linear, and the yellow are normal distributed. I sorted to get the nice curve

    Maybe you could generate an array of PRN and use an index into the array for your simulation
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  2. #22
    Ah okay thank you! Didn't realize it was so sensitive but it seems that including it multiple times ends up restricting how random it is.

    Thank you so much for all the help!!!

Tags for this Thread

Posting Permissions

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