pystra.distributions.shiftedlognormal.ShiftedLognormal#
- class ShiftedLognormal(name, mean, stdv, lower, input_type=None, startpoint=None)[source]#
Bases:
Lognormal
Shifted Lognormal distribution
If X is a lognormal random variable, then Y = X + lower is a shifted lognormal random variable.
- Arguments:
name (str): Name of the random variable
mean (float): Mean
stdv (float): Standard deviation
lower (float): Lower bound of the distribution (i.e. the shift applied to the lognormal)
input_type (any): Change meaning of mean and stdv. Not implemented!
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>lower 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 lower parameter.
Updating the distribution scale parameter.
Transformation from u to x
Transformation from x to u Note: asssumes x>lower for performance
Attributes
std_normal
- pdf(x)[source]#
Probability density function Note: asssumes x>lower for performance, scipy manages this appropriately
- set_lower(lower=0)[source]#
Updating the distribution lower 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
- set_location(loc=0)#
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)#
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.