How can i simulate a generic poisson process?

6 次查看(过去 30 天)
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!

采纳的回答

John D'Errico
John D'Errico 2023-5-4
编辑:John D'Errico 2023-5-4
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 个评论
simone
simone 2023-5-4
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 2023-5-5
If this solved your problem, please accept the answer.

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by