question

Jim Montgomery avatar image
0 Likes"
Jim Montgomery asked Jim Montgomery answered

Problem with Poisson Distribution governing arrivals but producing outlyers

I was using the custom arrivals table to simulate patient arrivals to an emergency room (see Fig 1). The problem is that, as poisson is an unbounded distribution, on occasion, this generates an artificially high returned quantity of patients for the hour. For example, in my empirical data set, the number of patients arriving in an hour never exceeds 25. In the model’s poisson-generated data, the number of arrivalls per hour reaches as high as 46. This appears to be causing problems as I attempt to validate the model.

Fig 1

How can I keep the variation in arrivals the poisson distribution gives be, while at the same time, cap the max arrivals to 25 per hour? I attempted to achieve this by adding the the “min” equation to the table (See Fig 2). The modification had no impact on the arrivals. What would be the solution?

Fig 2

Thanks,

Jim

@tee.hiett

FlexSim HC 5.1.0
arrivalspoisson distributioned arrivals
limrz.png (122.5 KiB)
tioye.png (138.9 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

I'm not sure why you say the min function had no impact. It seems to be working fine:

cappoisson.fsm

Statistically, though, this might not be the best solution as it will cause a spike at 25 (since you're taking all the area under the curve from 25 to the right and piling it up at 25). You would probably want to re-sample the distribution rather than just cap the value. You could write a user command with code like the following and put the user command in the Number of Arrivals.

  1. int mean = parval(1);
  2. int cap = 25;
  3.  
  4. int val = cap + 1;
  5. while(val > cap)
  6. val = poisson(mean, 1);
  7.  
  8. return val;

cappoisson.fsm (62.3 KiB)
· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jim Montgomery avatar image
0 Likes"
Jim Montgomery answered

Very cool! Thank you Matthew and Tee for introducing me to User Commands.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.