Skip to main content
added 12 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right form of the geometric.

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An essentially identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right form of the geometric.

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right form of the geometric.

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An essentially identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

added 18 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right one!form of the geometric.

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right one!

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right form of the geometric.

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

added 197 characters in body
Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right one!

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right one!

You can see that the code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

[The underlying issue here is not to do with R, but with the geometric distribution itself (so you could quite reasonably drop "in R" from your title; R simply revealed the problem to you).]

Note that there are two ways of writing the geometric distribution; one as the number of failures to the first success, and the other as the number of trials to the first success.

(Wikipedia gives both forms).

It's important to make sure you're dealing with the right one!

You can see that the first code you gave produces a minimum value of 1, so it's of the "number of trials" form. R's geometric random number function produces a minimum value of 0, which is of the "number of failures" form.

To convert from the "number of failures" form to the "number of trials" form, you simply add 1.

An identical issue occurs more generally with the negative binomial distribution -- again you have to be careful to use the right one.

Source Link
Glen_b
  • 290.5k
  • 37
  • 652
  • 1.1k
Loading