Open In App

sympy.stats.LogNormal() in python

Last Updated : 05 Jun, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
With the help of sympy.stats.LogNormal() method, we can get the continuous random variable which represents the Log-Normal distribution.
Syntax : sympy.stats.LogNormal(name, mean, std) Where, mean and standard deviation are real number. Return : Return the continuous random variable.
Example #1 : In this example we can see that by using sympy.stats.LogNormal() method, we are able to get the continuous random variable representing Log-Normal distribution by using this method. Python3 1=1
# Import sympy and LogNormal
from sympy.stats import LogNormal, density
from sympy import Symbol, pprint

z = Symbol("z")
mean = Symbol("mean", positive = True)
std = Symbol("std", positive = True)

# Using sympy.stats.LogNormal() method
X = LogNormal("x", mean, std)
gfg = density(X)(z)

pprint(gfg)
Output :
2 -(-mean + log(z)) ------------------- 2 ___ 2*std \/ 2 *e -------------------------- ____ 2*\/ pi *std*z
Example #2 : Python3 1=1
# Import sympy and LogNormal
from sympy.stats import LogNormal, density
from sympy import Symbol, pprint

z = 2.1
mean = 7.6
std = 4

# Using sympy.stats.LogNormal() method
X = LogNormal("x", mean, std)
gfg = density(X)(z)

pprint(gfg)
Output :
0.0136890249307238*\/ 2 ------------------------ ____ \/ pi

Next Article
Practice Tags :

Similar Reads