+ Reply to Thread
Results 1 to 4 of 4

NormInv performace in Excel 2003

  1. #1
    webshark
    Guest

    NormInv performace in Excel 2003

    I have compared the speed performance of Excel 2003 vs. Excel 2000 in
    generating series of normally distributed random numbers.

    Sub test()
    ActiveSheet.Range("A1") = Time()
    For i = 1 To 64000
    ActiveSheet.Range("A" & i + 1).Value = Application.NormInv(Rnd(), 0, 1)
    Next i
    ActiveSheet.Range("B1") = Time()
    End Sub


    I get that Excel 2000 is 5.5 faster.
    Does anybody experiance the same problem?
    I wonder if the problem is due to the upgrade of the NormInv function
    in Excel 2003 or there is any other reason.

    Thanks,
    Michael


  2. #2
    Jerry W. Lewis
    Guest

    Re: NormInv performace in Excel 2003

    Your comparison is apples to oranges, since you will likely be unhappy
    with the result of generating normal random numbers this way in Excel
    2000. In Excel 2000, ABS(NormsInv(p)) = 5E6 for Min(p,1-p)< 3E-7.
    Under normality, the probability of seeing ABS(x)>=5E6 is less than
    2*10^(-5.4E12). To put this in context, the smallest number that Excel
    can distinguish from zero is about 10^308, whereas 2*10^(-5.4E12) is
    about 10^(thirty-five trillion) times smaller!

    Normal random numbers that are five million standard deviations from the
    mean are clearly wrong, and could be culled if you are not overly
    concerned about the extreme tail of the distribution that you are
    generating. However less obviously wrong values will also be distorted
    away from normality.

    You could use an accurate VBA inverse normal distribution, such as
    http://groups-beta.google.com/group/...38d6ddefaed7be
    or
    http://members.aol.com/iandjmsmith/examples.xls
    but I guarantee that NormInv in 2003 will be faster.

    Side issue: if you will always be generating standard normal numbers,
    why not use NormSInv instead of NormInv?

    Jerry

    webshark wrote:

    > I have compared the speed performance of Excel 2003 vs. Excel 2000 in
    > generating series of normally distributed random numbers.
    >
    > Sub test()
    > ActiveSheet.Range("A1") = Time()
    > For i = 1 To 64000
    > ActiveSheet.Range("A" & i + 1).Value = Application.NormInv(Rnd(), 0, 1)
    > Next i
    > ActiveSheet.Range("B1") = Time()
    > End Sub
    >
    >
    > I get that Excel 2000 is 5.5 faster.
    > Does anybody experiance the same problem?
    > I wonder if the problem is due to the upgrade of the NormInv function
    > in Excel 2003 or there is any other reason.
    >
    > Thanks,
    > Michael



  3. #3
    webshark
    Guest

    Re: NormInv performace in Excel 2003

    Jerry,

    Thank you for the reply.

    Michael


  4. #4
    Jerry W. Lewis
    Guest

    Re: NormInv performace in Excel 2003

    You're welcome.

    Jerry

    webshark wrote:

    > Jerry,
    >
    > Thank you for the reply.
    >
    > Michael



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1