Friday, October 24, 2025
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
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS