question related to Statistics in matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I would like to write a matlab code by using this definition of poisson process
here, I want to simulate a poisson process, where n is chosen randomly between 1 and 10, lambda = 9 for 200 variates.
The codes that I wrote are totally wrong, so I cant post them, please give me a way or hint to do that. Thanks a lot.
My code is as follows:
n = randi ([1,10], 100);
t=1;
if P == (lambda * t)^n/factorial(n) * e(-lambda * t)
N = n
and
N_sum = cumsum(N);
disp(N_sum)
0 comentarios
Respuestas (1)
Jeff Miller
el 15 de Mayo de 2020
r=poissrnd(9,200,1);
will give you 200 random numbers from a poisson distribution with lambda=9. Lots of those numbers will be greater than 10, however, because those numbers occur frequently in that poisson distribution. If you really only want 200 numbers in the 1-10 range (some kind of truncated poisson, I guess), then generate maybe 400 and take the first 200 that are 10 or less.
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!