HomeLanguagessympy.stats.Skellam() function in Python

sympy.stats.Skellam() function in Python

With the help of sympy.stats.Skellam() method, we can create a discrete random variable with a Skellam distribution. 

The Skellam is the distribution of the difference N1 – N2 of two statistically independent random variables N1 and N2 each Poisson-distributed with respective expected values mu1 and mu2.

Syntax:  sympy.stats.Skellam(name, mu1, mu2)

Parameters:
 mu1:  A non-negative value
 mu2:  A non-negative value


Returns: discrete random variable with a Skellam distribution.

Example #1 :

Python3




# import sympy, Skellam, density, Symbol
from sympy.stats import Skellam, density
from sympy import Symbol
  
mu1 = Symbol("mu1", positive = True)
mu2 = Symbol("mu2", positive = True)
  
# using sympy.stats.Skellam() method
X = Skellam("x", mu1, mu2)
skeDist = density(X)(z)
  
print(skeDist)


Output:

(mu1/mu2)**(z/2)*exp(-mu1 - mu2)*besseli(z, 2*sqrt(mu1)*sqrt(mu2))

Example #2 :

Python3




# import sympy, Skellam, density
from sympy.stats import Skellam, density
  
# using sympy.stats.Skellam() method
X = Skellam("x", 1, 2)
skeDist = density(X)(3)
  
print(skeDist)


Output:

sqrt(2)*exp(-3)*besseli(3, 2*sqrt(2))/4
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32548 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6922 POSTS0 COMMENTS
Nicole Veronica
12038 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12143 POSTS0 COMMENTS
Shaida Kate Naidoo
7058 POSTS0 COMMENTS
Ted Musemwa
7298 POSTS0 COMMENTS
Thapelo Manthata
7015 POSTS0 COMMENTS
Umr Jansen
7003 POSTS0 COMMENTS