def norm_std_from_iqr(mu, iqr):
"""Computes the standard deviation of a normal distribution with mean mu and IQR irq."""
# Assuming normal distribution (so symmetric), Q1 = m - (iqr / 2)
Q1 = mu - (iqr / 2.0)
# Assuming a normal distribution with mean m, std s, and first quartile Q1,
# we have (Q1 - m)/s = ppf(0.25)
return (Q1 - mu) / norm.ppf(0.25)
评论列表
文章目录