How can i simulate a generic poisson process?

25 vues (au cours des 30 derniers jours)
simone
simone le 4 Mai 2023
Commenté : John D'Errico le 5 Mai 2023
As the title says i am currently trying (and succeded, I think) to simulate a Poisson process. I do need help in order to plot the step function.
I saved the times of the process in a vector called Tn, which contains these randomly generated values:
Tn = [0 1.3985 3.7568 4.5718 7.2968 8.0168 8.9812 9.8139]
As i said in the first line, how do i plot the step function? (The values of Tn are inserted in the X-axis of course).
Thanks in advance!

Réponse acceptée

John D'Errico
John D'Errico le 4 Mai 2023
Modifié(e) : John D'Errico le 4 Mai 2023
Not sure how you built the vector. Is it a Poisson process? Could be. :) As I recall, if you have exponential inter-rarrival times, the result will be Poisson. Its been a long time though since I cared about those things. But that suggests you can use a tool like exprnd to generate the interarrivals, then form a cumulative sum, using cumsum. And, of course, exprnd is a trivial thing to replace, even if you were not allowed to use that specific tool.
Anyway, I assume you are asking to generate steps like this:
Tn = [0 1.3985 3.7568 4.5718 7.2968 8.0168 8.9812 9.8139];
stairs(Tn,0:numel(Tn)-1)
  2 commentaires
simone
simone le 4 Mai 2023
This is exactly what i was looking for, thanks! As you already guessed, I generated inter-arrival times (from an exponential distribution) and used the cumsum function to create the Tn vector.
John D'Errico
John D'Errico le 5 Mai 2023
If this solved your problem, please accept the answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by