I have a left-censored normal distribution: it is 'flat' (equal to zero) up to mu
, and then normal.
I know how to calculate cdf for a standard normal distribution:
from scipy.stats import norm
norm(mu, sigma).cdf(1)
for instance. But of course that is not correct for this 'truncated' version. Neither is correct:
norm(mu, sigma).cdf(1) - norm(mu, sigma).cdf(0)
because I should adjust values proportionally to the fact that the left tail is non-existent. What is the right way to do it?
As suggested in the comment,
from scipy.stats import truncnorm
truncnorm(loc=1, scale=2, a=0, b=np.inf).cdf(x)
Where
loc
- meanscale
- standard deviationa
- left truncation pointb
- right truncation pointx
- evaluation point