简体   繁体   English

如何解决同时具有指数分布和泊松分布的 R 问题?

[英]How to solve an R problem with both exponential and poisson distribution?

I have come across questions in R which deal with exponential and poisson distributions separately, but I am unsure about how to go about it when you need to use both in the same question我在 R 中遇到过分别处理指数分布和泊松分布的问题,但是我不确定当您需要在同一个问题中同时使用这两种分布时如何解决 go

The number of customers attending a shop in (0,t) has Poisson distribution with parameter βt. (0,t) 中一家商店的顾客数量服从参数为 βt 的泊松分布 The time that each customer spends in the shop has Exponential distribution with parameter λ.每个顾客在商店中花费的时间服从参数为 λ 的指数分布 Find the probability that while a particular customer is shopping, maximum k other customer arrive.找出当一个特定顾客正在购物时,最多 k 个其他顾客到达的概率。 Use (any) β=λ and k=2.使用(任意)β=λ 和 k=2。 Use 10,000 samples.使用 10,000 个样本。

How would this be solved?这将如何解决?

Simulate how long it will take for that customer to be served (using rexp ), then simulate how many customers arrive during that time (using rpois ).模拟为该客户提供服务需要多长时间(使用rexp ),然后模拟在此期间有多少客户到达(使用rpois )。 You should be able to combine both steps in a single expression.您应该能够将这两个步骤组合在一个表达式中。 Make 10,000 such 2-step simulations.进行 10,000 次这样的两步模拟。 In what percentage is the number of arrivals <= 2?到达人数 <= 2 的百分比是多少?

Since this seems to be homework, I don't want to say any more than that.由于这似乎是作业,所以我不想多说。

Nit-pick: I don't like the wording of the problem when it says "find the probability... " It would be more precise to say " estimate the probability... ". Nit-pick:我不喜欢问题的措辞,当它说“找到概率......”时,说“估计概率......”会更准确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM