离散概率分布的“高斯拟合”在统计应用中几乎没有意义,但在数学上几乎可以完美拟合这些有序对。只需找到累积高斯\Phi(x ; ,与数据非常吻合。ms
Φ(x;m,s)=12πs2−−−−√∫x−∞exp(−(t−m)2/s2)dt
为了说明计算,这里是一个最小二乘拟合的例子(在 R 中)。因为概率的总和并不完全为,所以它将它们标准化为总和为单位。1
# The data
x <- c(90, 125, 180, 250, 355, 500, 710)
p <- c(0.0033, 0.0204, 0.0847, 0.2516, 0.4653, 0.1750, 0.0015)
# Standardize the cumulative probabilities
prob <- cumsum(p); prob <- prob / prob[7]
# Compute sum of squared residuals to a fit
f <- function(q) {
res <- pnorm(x, q[1], q[2]) - prob
sum(res * res)
}
# Find the least squares fit
coeff <-(fit <- nlm(f, c(334, 100)))$estimate
# Plot the fit
plot(x, prob)
curve(pnorm(x, coeff[1], coeff[2]), add=TRUE)

最佳值为 ,。m≈279.5s≈80.5