Welcome to the forum.
You want a function that generates random variates with Poisson distribution?
Welcome to the forum.
You want a function that generates random variates with Poisson distribution?
Last edited by shg; 03-09-2010 at 12:01 PM.
Entia non sunt multiplicanda sine necessitate
I am trying to model a stock price simulation with jumps (jump diffusion process). I want the variable to show "1" if the jump occurs. The jump is poisson distributed and can occur more than once in my interval (250 days), I would like to have the ability to adjust the frequency (lambda) of the jumps.
yes, I want a function which generate variates with poisson distribution.
![]()
Function RandPois(Lambda As Single, _ Optional bVolatile As Boolean = False) As Long ' shg 2007 ' UDF or VBA ' Returns a random Poisson variate with variance Lambda ' Knuth, Seminumerical Algorithms, p 132 Dim L As Single Dim k As Long Dim p As Single If bVolatile Then Application.Volatile L = Exp(-Lambda) p = 1 Do k = k + 1 p = p * Rnd Loop Until p <= L RandPois = k - 1 End Function
ignore this reply.
Last edited by jane657; 08-14-2021 at 09:42 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks