# Simulating random process (poisson process)

• phyalan
In summary, the conversation discusses a method for simulating the time behavior of a physical system with known time average statistics. The method involves assuming a rate of transition to different states and generating the time for the next transition event using an exponential distribution. It also involves starting the simulation at a random state and updating the time and state of the system based on the smallest time for the next transition. However, there are some unclear aspects of the method, such as the assumption of a common rate for all transitions and the lack of description of jump probabilities.
phyalan

## Homework Statement

I have a physical system, which I know the time average statistics. Its probability of being in state 1 is P1, state 2:P2 and state 3:P3. I want to simulate the time behavior of the system.

N/A

## The Attempt at a Solution

I assume the rate of transition event to state i to be the probability Pi. So I can generate the time for the next transition event by using the fact that the time needed for next transition event is exponential distributed, F(t)=1-exp(-kt), k is the rate of event. I start the simulation at time 0 and at a random state. In each iteration, I generate 3 uniform random numbers, and calculate the time needed for the next transition for all three states (t=-ln(U)/k, U is an uniform random number), take the smallest time and update the time and state of the system to the state corresponding to the smallest time.

Is this a correct way of simulating such a system, coz I find that if I start at any of the state(let say state 1), the time that the system staying in that state seems to be longer than what I expect.
FYI, I am using MATLAB for numerical simulation.

Last edited:
The simplest way, although not very efficient is to use very small time steps dt.
The a probability of transition is p.dt, assuming p is the probability rate per unit time.
Since dt is very small, p.dt << 1 and it will be enough to get a random number x uniformly distributed between 0 and 1.
Whenever x<p.dt , you execute the transition.
If you want a more efficient method, then you have to device something coherent with this small time step model.
For example, you can find out the probability distribution of the time before transition, and proceed in a similar way.
Personally, I like start simple and stupid, since I can compare my improved method with the simple stupid first attempt.

phyalan said:

## Homework Statement

I have a physical system, which I know the time average statistics. Its probability of being in state 1 is P1, state 2:P2 and state 3:P3. I want to simulate the time behavior of the system.

N/A

## The Attempt at a Solution

I assume the rate of transition event to state i to be the probability Pi. So I can generate the time for the next transition event by using the fact that the time needed for next transition event is exponential distributed, F(t)=1-exp(-kt), k is the rate of event. I start the simulation at time 0 and at a random state. In each iteration, I generate 3 uniform random numbers, and calculate the time needed for the next transition for all three states (t=-ln(U)/k, U is an uniform random number), take the smallest time and update the time and state of the system to the state corresponding to the smallest time.

Is this a correct way of simulating such a system, coz I find that if I start at any of the state(let say state 1), the time that the system staying in that state seems to be longer than what I expect.
FYI, I am using MATLAB for numerical simulation.

You need to describe the system more completely. In general, the time spent in state i is exponentially distributed with rate ##r_i## (mean ##1/r_i##), but you seem to be assuming a common value ##r_i = k## for all i. Is that what you intended? Also in general, when the system jumps out of state i it goes to a different state ##j \neq i## with probability ##p_{ij}##. As far as I can see, you have not said what are the ##p_{ij}##. Did you mean that ##p_{ij} = P_j## for all i? Or, did you mean that the transition rate from i to j is ##P_j##?

Of course, you also need to start the system in some state at time t = 0.

During your simulation you say you want to take the smallest time; that makes no sense at all, and is not how these things work. Instead, here is what you need to do:

(1) When you are in state i at time t, generate a 'holding time' ##T_i##, which is how long you will remain in state i. In other words, you jump out of state i at time ##t+T_i##.

(2) For a (stationary) Markov process, whenever you jump out of state i you go next to state j with probability ##p_{ij}##. Here,
$$\sum_{j: j \neq i} p_{ij} = 1 \; \forall \, i$$

Sometimes you are given, instead, the "rate" matrix ##A = (a_{ij}),## where ##a_{ij} \geq 0 ## for all ##j \neq i## and (by definition)
$$a_{ii} = -\sum_{j: j \neq i} a_{ij}$$
The quantity ##r_i = -a_{ii} \geq 0## is the rate parameter ##r_i## I referred to before, and for all ##j \neq i## the jump probability is
$$p_{ij} = \frac{a_{ij}}{r_i} = \frac{a_{ij}}{\sum_{k: k\neq i} a_{ik}}$$

Generate the next state jumped to, then repeat all the above, starting from the new time.

1 person
Ray Vickson said:
You need to describe the system more completely. In general, the time spent in state i is exponentially distributed with rate ##r_i## (mean ##1/r_i##), but you seem to be assuming a common value ##r_i = k## for all i. Is that what you intended? Also in general, when the system jumps out of state i it goes to a different state ##j \neq i## with probability ##p_{ij}##. As far as I can see, you have not said what are the ##p_{ij}##. Did you mean that ##p_{ij} = P_j## for all i? Or, did you mean that the transition rate from i to j is ##P_j##?

Of course, you also need to start the system in some state at time t = 0.

During your simulation you say you want to take the smallest time; that makes no sense at all, and is not how these things work. Instead, here is what you need to do:

(1) When you are in state i at time t, generate a 'holding time' ##T_i##, which is how long you will remain in state i. In other words, you jump out of state i at time ##t+T_i##.

(2) For a (stationary) Markov process, whenever you jump out of state i you go next to state j with probability ##p_{ij}##. Here,
$$\sum_{j: j \neq i} p_{ij} = 1 \; \forall \, i$$

Sometimes you are given, instead, the "rate" matrix ##A = (a_{ij}),## where ##a_{ij} \geq 0 ## for all ##j \neq i## and (by definition)
$$a_{ii} = -\sum_{j: j \neq i} a_{ij}$$
The quantity ##r_i = -a_{ii} \geq 0## is the rate parameter ##r_i## I referred to before, and for all ##j \neq i## the jump probability is
$$p_{ij} = \frac{a_{ij}}{r_i} = \frac{a_{ij}}{\sum_{k: k\neq i} a_{ik}}$$

Generate the next state jumped to, then repeat all the above, starting from the new time.

Thanks for all the reply. What I mean for Pi in my problem is that if one measure the state of the system at a particular time, there is probability P1 for it being in state 1, and so on. This is the only information I have for the system. I would say Pi is the time average probability of state i. I have no idea how can I get the transition probability Pij and the rate ri that you mentioned from that... I am a bit confused about that.
In this case, do I have, for example, the transition probability from state 1 to state 2 P12=P2/(P2+P3) ?

Last edited:

## 1. What is a Poisson process?

A Poisson process is a type of random process that describes the occurrence of events over a continuous time interval. It is often used to model the arrival of events such as customers to a service system, radioactive decay, or natural disasters.

## 2. How is a Poisson process simulated?

A Poisson process can be simulated by generating a sequence of random numbers using a Poisson distribution. This distribution takes into account the average rate of event occurrences and assigns probabilities to each possible number of events in a given time interval. By repeatedly generating random numbers according to this distribution, we can simulate a Poisson process.

## 3. What are the key assumptions of a Poisson process?

The key assumptions of a Poisson process include that events occur independently of each other, the time between events follows an exponential distribution, and the average rate of events is constant over time.

## 4. Can a Poisson process be used for non-integer event occurrences?

Yes, a Poisson process can be used to model non-integer event occurrences by using a Poisson distribution with a non-integer mean. This can be useful in situations where events occur at a slower rate, such as in an online shopping system.

## 5. What are some applications of simulating a Poisson process?

Simulating a Poisson process can be useful in a variety of fields, including queueing theory, telecommunications, and finance. It can also be used to study the behavior of complex systems, such as traffic flow or disease outbreaks.

• Calculus and Beyond Homework Help
Replies
8
Views
795
• Calculus and Beyond Homework Help
Replies
10
Views
1K
• Calculus and Beyond Homework Help
Replies
17
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
814
• Calculus and Beyond Homework Help
Replies
32
Views
2K
• Calculus and Beyond Homework Help
Replies
2
Views
2K
• Calculus and Beyond Homework Help
Replies
2
Views
1K
• Precalculus Mathematics Homework Help
Replies
4
Views
820
• Calculus and Beyond Homework Help
Replies
2
Views
1K
• Calculus and Beyond Homework Help
Replies
2
Views
1K