pystra.distributions.lognormal.Lognormal#
- class Lognormal(name, mean, stdv, input_type=None, startpoint=None)[source]#
Bases:
Distribution
Lognormal distribution
- Arguments:
name (str): Name of the random variable
mean (float): Mean or lamb
stdv (float): Standard deviation or zeta
input_type (any): Change meaning of mean and stdv
startpoint (float): Start point for seach
Note: Could use scipy to do the heavy lifting. However, there is a small performance hit, so for this common dist use bespoke implementation for the PDF, CDF.
Methods
Cumulative distribution function
getMean
getName
getStartPoint
getStdv
Compute the Jacobian
Probability density function Note: asssumes x>0 for performance, scipy manages this appropriately
Plots the PDF of the distribution
Inverse cumulative distribution function
Return a sample of the distribution of length n
setStartPoint
Updating the distribution location parameter.
Updating the distribution scale parameter.
Transformation from u to x
Transformation from x to u Note: asssumes x>0 for performance
Attributes
std_normal
- pdf(x)[source]#
Probability density function Note: asssumes x>0 for performance, scipy manages this appropriately
- set_location(loc=0)[source]#
Updating the distribution location parameter. For Lognormal, even though we have a SciPy object, it’s not being used in the functions above for performance, so we need to update pe.arams directly.
- set_scale(scale=1)[source]#
Updating the distribution scale parameter. For Lognormal, even though we have a SciPy object, it’s not being used in the functions above for performance, so we need to update params directly.
- jacobian(u, x)#
Compute the Jacobian
- plot(ax=None, **kwargs)#
Plots the PDF of the distribution
- ppf(u)#
Inverse cumulative distribution function
- sample(n=1000)#
Return a sample of the distribution of length n