필터 지우기
필터 지우기

How can i simulate a generic poisson process?

조회 수: 6 (최근 30일)
simone
simone 2023년 5월 4일
댓글: John D'Errico 2023년 5월 5일
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