从某个正态分布中获取的点的概率小于或等于从另一个正态分布中获取的点的概率?
Probability of a point taken from a certain normal distribution will be less than or equal to than a point taken from another?
假设我们有两个独立的正态分布
如何计算从分布 X1 中取的某个点是 less than or equal to
从分布 X2 中取的某个点在 Python 中的概率?
关于 this 我可以说 greater than
的公式可能是这样的,
示例,
m1, std1 = 1, 2
m2, std2 = 2, 3
#then,
并且,
# hence,
from scipy.stats import norm
p = 1 - norm.cdf(-(m1 - m2) / np.sqrt(std1 + std2))
# p = 0.32736042300928847
我正在寻找
的代码
假设它们具有相同的均值 l,则概率为 50%。与分布无关。因此,在这种情况下,最好将分布归一化,使它们具有相同的均值。
设 Y 为 X₁ - X₂。你已经证明了
Y ~ N(μ₁ - μ₂, σ₁² + σ₂²)。
你想要 P(Y ≤ 0)。那是 Y 的 CDF 评估为 0.
在代码中:
from math import sqrt
from scipy.stats import norm
m1, std1 = 1, 2
m2, std2 = 2, 3
m = m1 - m2
std = sqrt(std1**2 + std2**2)
print(norm.cdf(0, loc=m, scale=std))
输出是
0.6092443525006433
假设我们有两个独立的正态分布
如何计算从分布 X1 中取的某个点是 less than or equal to
从分布 X2 中取的某个点在 Python 中的概率?
关于 this 我可以说 greater than
的公式可能是这样的,
示例,
m1, std1 = 1, 2
m2, std2 = 2, 3
#then,
并且,
# hence,
from scipy.stats import norm
p = 1 - norm.cdf(-(m1 - m2) / np.sqrt(std1 + std2))
# p = 0.32736042300928847
我正在寻找
假设它们具有相同的均值 l,则概率为 50%。与分布无关。因此,在这种情况下,最好将分布归一化,使它们具有相同的均值。
设 Y 为 X₁ - X₂。你已经证明了 Y ~ N(μ₁ - μ₂, σ₁² + σ₂²)。 你想要 P(Y ≤ 0)。那是 Y 的 CDF 评估为 0.
在代码中:
from math import sqrt
from scipy.stats import norm
m1, std1 = 1, 2
m2, std2 = 2, 3
m = m1 - m2
std = sqrt(std1**2 + std2**2)
print(norm.cdf(0, loc=m, scale=std))
输出是
0.6092443525006433