'Generate a Beta random variable with parameters m and n Public Function Randbeta(ByVal M As Integer, ByVal N As Integer) As Double Dim i As Integer Dim temp As Double temp = 1 For i = 1 To N temp = temp * alea() Next i Randbeta = -Log(temp) temp = 1 For i = 1 To N + M temp = temp * alea() Next i Randbeta = -Log(temp) End Function