Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiny feature request: GeometricShifted #1913

Open
alanedelman opened this issue Nov 10, 2024 · 1 comment
Open

tiny feature request: GeometricShifted #1913

alanedelman opened this issue Nov 10, 2024 · 1 comment

Comments

@alanedelman
Copy link
Contributor

the shifted geometric distribution
(left column in https://en.wikipedia.org/wiki/Geometric_distribution)

@mauricelanghinrichs
Copy link

If I'm not mistaken this can be currently achieved by

using Distributions
GeometricShifted(p) = Geometric(p) + 1

# some tests
p = 0.7
mean(GeometricShifted(p))  1/p # true
var(GeometricShifted(p))  (1-p)/p^2 # true
pdf(GeometricShifted(p), 0)  0 # true
all(pdf(GeometricShifted(p), k)  (1-p)^(k-1)*p for k in 1:100) # true

but I agree, would be nice to have this as a convenience method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants