In an urbanization, there are an average of 13 cars damaged in a month.

How I can calculate the probability distribution for the possible number of damaged vehicles in the range of 0 to 30 ?

dpois() qpois() functions work to do this ?

In an urbanization, there are an average of 13 cars damaged in a month.

How I can calculate the probability distribution for the possible number of damaged vehicles in the range of 0 to 30 ?

dpois() qpois() functions work to do this ?

I am not sure what you need to calculate. dpois() tells you the probability mass at a given number of counts. qpois() returns the number of counts below which a certain fraction of the probability lies. ppois() returns how much of the total probability lies at or below a given number of counts.

Compare the the plots generated by this code.

```
X <- seq(0,30)
P <- seq(0.05,0.95,0.05)
plot(X,dpois(X,13))
plot(X,ppois(X,13))
plot(P,qpois(P,13))
```

1 Like

If you want the probability mass at each value from 0 to 30, use

```
X <- seq(0,30)
dpois(X,13)
```

1 Like

a. Ok, I see, I tried it with other parameters like the probability to have the number of damaged cars falling in the range between 7 and 12 inclusive in the next month.

X <- seq(7, 12)

dpois <- (X, 13) # is 13 ?

c. And, the probability to have the number of damaged cars great than or equal to 14.

In this case, how I can apply the >= 14 ?

dpoist gives you the probability mass at a single count value. You can pass it several count values and it will give you the probability mass at each one. ppois gives you the sum of all of the probability masses from zero up to given count value. Here are three results that illustrate that:

```
> dpois(0:12, lambda = 13)
[1] 2.260329e-06 2.938428e-05 1.909978e-04 8.276573e-04 2.689886e-03 6.993704e-03 1.515303e-02
[8] 2.814133e-02 4.572967e-02 6.605396e-02 8.587015e-02 1.014829e-01 1.099398e-01
> sum(dpois(0:12, lambda = 13))
[1] 0.4631047
> ppois(12, lambda = 13)
[1] 0.4631047
```

Since your question seems to be from homework, I want to avoid simply giving you the answers.

You should know what is the sum of all of the probability masses from zero to infinity.

You can calculate the probability of all results up to any number

Knowing those two things, you can get the probability of getting a result greater than a number.

2 Likes

That is an optional exercise. He did this in class

dpois (4, 6.9) # prob x =4

dpois(2, 6.9) prob x = 2

ppois(10, 6.9) - ppois(3, 6.9) # prob for X takes values of 4, 5 ..... 10

1-ppois(10, 6.9) # prob X equals to 5 or greater.

I did not have these very clear calculations. I have some gaps.

I tried this for the c

1-ppois(15, 13)

But I honestly don't know why 1-

What is the probability that you will get a result between zero and infinity? Let's call that Z. If you know that the probability of getting a count between 0 and 3 is 0.25, then the probability of getting a count greater than 3 is Z - 0.25.

Ok, so what I did is ok ?

ppois(15,13) gives you the probability that the counts will be >= 0 and <= 15 if lambda is 13. One minus that does not tell you the probability that the counts will be >= 14. The ppois(15,13) result already includes that probabilities at 14 and 15. You want to divide the probability values into those from 0 to 13 | those >= 14

I have something, fixed, I wrote 1 and is 0

1 - sum(dpois(0:13, 13))

or

1-ppois(15, 15) both work

Hi,

Let me try again.

In the urbanization, there are on average 13 damaged cars in a month. I need to compute the probability distribution for possible number of damaged cars in the range from 0 to 30.

The ppois() function tells you the cumulative probability from 0 up to a given number of counts.

```
> ppois(7, lambda = 13)
[1] 0.05402825
```

shows ~5.4% lies at 7 or few counts.

1 Like

Ok, so if I have 0 to # is dpois. Ppois is for specific like 7 to 12.

So for >= 14 is ppois ?