Gauss Function that has 5 standard deviation compared to Random Numbers generated in Excel. Can be used to simulate return on equities. Copy and paste into a new module. In a cell, just type gauss() to obtain a random gauss number.
Gauss Function that has 5 standard deviation compared to Random Numbers generated in Excel. Can be used to simulate return on equities. Copy and paste into a new module. In a cell, just type gauss() to obtain a random gauss number.
Gauss Function that has 5 standard deviation compared to Random Numbers generated in Excel. Can be used to simulate return on equities. Copy and paste into a new module. In a cell, just type gauss() to obtain a random gauss number.
Rem: Box-Muller or Gaussian Pseudo-random number generator
Public Function gauss()
Dim f As Double Dim r As Double Dim V1 As Double Dim V2 As Double 10 V1 = 2 * Rnd - 1 V2 = 2 * Rnd - 1 r = V1 ^ 2 + V2 ^ 2 If (r >= 1) Then GoTo 10 f = Sqr(-2 * Log(r) / r) gauss = V2 * f End Function