from scipy.stats import lognorm
posterior_fb = lognorm(s=np.log(1.14), scale=0.007)
intervals = post_fb.interval(0.99)
post_fb.interval(0.99) gives me the endpoints of the range that contains 99% of the distribution, i.e., (0.0049, 0.0098)
I need a function that does the inverse. That is you can specify the two points, and the function will calculate the percentage of the distribution that lies within those two points.
For example, inverse_of_interval(0.0049, 0.0098) would give me 0.99.
You can try to use the cdf of the lognorm:
post_fb = lognorm(s=np.log(1.14), scale=0.007)
post_fb.cdf(0.0098) - post_fb.cdf(0.0049)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With