I have to compute the probability of Poisson distribution in Julia. I just know how to get Poisson distribution. But i have to compute the probability. also i have lambda from 20 to 100.
using Distributions
Poisson()
The objects in Distributions.jl
are like random variables. If you declare a value to be of a distribution, you can sample from it using rand
, but there are a whole lot of other methods you can apply to it. Among them is pdf
:
julia> X = Poisson(30)
Distributions.Poisson{Float64}(λ=30.0)
julia> pdf(X, 2)
4.2109303359780846e-11
julia> pdf(X, 0:1:10)
11-element Array{Float64,1}:
9.35762e-14
2.80729e-12
4.21093e-11
4.21093e-10
3.1582e-9
1.89492e-8
9.47459e-8
4.06054e-7
1.5227e-6
5.07567e-6
1.5227e-5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With