# Calculate λ with known cdf

**URL:** <https://discourse.julialang.org/t/calculate-with-known-cdf/39463>\
**Category:** Statistics\
**Created:** [May 14, 2020, 12:51pm UTC](https://discourse.julialang.org/t/calculate-with-known-cdf/39463 "2020-05-14T12:51:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Post date:** [May 14, 2020, 12:51pm UTC](https://discourse.julialang.org/t/calculate-with-known-cdf/39463/1 "2020-05-14T12:51:54Z")

</div>

X follows Poisson distribution,

> X = Poisson(λ)

, how to calculate λ if we know the probability of x being 3 or less is 0.82, that is

> cdf(X,3) = 0.82

. is there any syntax or solver?

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [May 14, 2020, 1:07pm UTC](https://discourse.julialang.org/t/calculate-with-known-cdf/39463/2 "2020-05-14T13:07:40Z")

</div>

You can use `find_zero` in [Roots.jl](https://github.com/JuliaMath/Roots.jl) to solve this:

```julia
julia> using Distributions, Roots

julia> find_zero(λ -> cdf(Poisson(λ), 3) - .82, 2)
2.1967047830443853

```

---

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Post date:** [May 14, 2020, 1:19pm UTC](https://discourse.julialang.org/t/calculate-with-known-cdf/39463/3 "2020-05-14T13:19:55Z")

</div>

thank you
